cuopt-install

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

cuOpt Install (user)

cuOpt 安装指南(用户版)

Install cuOpt to use it from Python, C, or as a REST server. For building cuOpt from source to contribute or modify it, see
cuopt-developer
.
安装cuOpt以在Python、C语言环境中使用,或作为REST服务器运行。如需从源码构建cuOpt以进行贡献或修改,请查看
cuopt-developer

System requirements

系统要求

  • GPU: NVIDIA Compute Capability ≥ 7.0 (Volta or newer). Examples: V100, A100, H100, RTX 20xx/30xx/40xx. Not supported: GTX 10xx (Pascal).
  • CUDA: 12.x or 13.x. The package CUDA suffix must match the runtime CUDA (e.g.
    cuopt-cu12
    /
    libcuopt-cu12
    with CUDA 12).
  • Driver: NVIDIA driver compatible with the CUDA version.
  • cuopt-cuXX
    (Python) depends on
    libcuopt-cuXX
    (C), so installing the Python package also installs the C library and headers. Installing
    libcuopt-cuXX
    on its own does not install the Python API.
  • GPU:NVIDIA Compute Capability ≥ 7.0(Volta或更新架构)。示例型号:V100、A100、H100、RTX 20xx/30xx/40xx。不支持:GTX 10xx(Pascal架构)。
  • CUDA:12.x 或 13.x。包的CUDA后缀必须与运行时CUDA版本匹配(例如,CUDA 12对应
    cuopt-cu12
    /
    libcuopt-cu12
    )。
  • 驱动:与CUDA版本兼容的NVIDIA驱动。
  • cuopt-cuXX
    (Python版)依赖于
    libcuopt-cuXX
    (C版),因此安装Python包时也会同时安装C库和头文件。单独安装
    libcuopt-cuXX
    不会安装Python API。

Required questions

需确认的问题

Ask these if not already clear:
  1. Interface — Python, C, or REST server? Server can be called from any language via HTTP.
  2. CUDA version — What is installed? Check with
    nvcc --version
    or
    nvidia-smi
    .
  3. Package manager — pip, conda, or Docker preferred?
  4. Environment — Local machine with GPU, cloud instance, Docker/Kubernetes, or remote/server (no local GPU)?
若以下信息不明确,请先确认:
  1. 接口类型 — Python、C语言还是REST服务器?服务器可通过HTTP被任意语言调用。
  2. CUDA版本 — 已安装的版本是什么?可通过
    nvcc --version
    nvidia-smi
    查看。
  3. 包管理器 — 优先使用pip、conda还是Docker?
  4. 运行环境 — 带GPU的本地机器、云实例、Docker/Kubernetes环境,还是无本地GPU的远程/服务器?

Python API

Python API

Choose one — do not run both. The second install would override the first and can cause CUDA / package mismatch.
选择其中一种方式 — 不要同时运行两种。第二种安装会覆盖第一种,可能导致CUDA/包版本不匹配。

pip

pip

  • CUDA 13.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com cuopt-cu13
  • CUDA 12.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com 'cuopt-cu12==26.2.*'
  • CUDA 13.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com cuopt-cu13
  • CUDA 12.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com 'cuopt-cu12==26.2.*'

conda

conda

bash
conda install -c rapidsai -c conda-forge -c nvidia cuopt
bash
conda install -c rapidsai -c conda-forge -c nvidia cuopt

Verify

验证安装

python
import cuopt
print(cuopt.__version__)
from cuopt import routing
dm = routing.DataModel(n_locations=3, n_fleet=1, n_orders=2)
python
import cuopt
print(cuopt.__version__)
from cuopt import routing
dm = routing.DataModel(n_locations=3, n_fleet=1, n_orders=2)

C API

C API

The C API ships in
libcuopt-cuXX
, which is also pulled in as a dependency of
cuopt-cuXX
— so if you already installed the Python package, the C library and headers are already present. Install
libcuopt
standalone only when you want the C API without Python. Choose one of pip or conda — do not run both.
C API包含在
libcuopt-cuXX
中,它也是
cuopt-cuXX
的依赖项——因此如果您已安装Python包,C库和头文件已存在。仅当您需要独立的C API而不需要Python时,才单独安装
libcuopt
选择pip或conda中的一种方式 — 不要同时运行两种。

pip

pip

  • CUDA 13.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com libcuopt-cu13
  • CUDA 12.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com 'libcuopt-cu12==26.2.*'
  • CUDA 13.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com libcuopt-cu13
  • CUDA 12.x:
    bash
    pip install --extra-index-url=https://pypi.nvidia.com 'libcuopt-cu12==26.2.*'

conda

conda

bash
conda install -c rapidsai -c conda-forge -c nvidia libcuopt
bash
conda install -c rapidsai -c conda-forge -c nvidia libcuopt

Verify

验证安装

See
references/verification_examples.md
for the canonical C-API header/library
find
commands (conda and pip/venv variants).
请查看
references/verification_examples.md
获取标准的C API头文件/库查找命令(包含conda和pip/venv两种环境的示例)。

Server (REST)

服务器(REST)

pip

pip

bash
pip install --extra-index-url=https://pypi.nvidia.com cuopt-server-cu12 cuopt-sh-client
bash
pip install --extra-index-url=https://pypi.nvidia.com cuopt-server-cu12 cuopt-sh-client

conda

conda

bash
conda install -c rapidsai -c conda-forge -c nvidia cuopt-server cuopt-sh-client
bash
conda install -c rapidsai -c conda-forge -c nvidia cuopt-server cuopt-sh-client

Docker

Docker

bash
docker pull nvidia/cuopt:latest-cuda12.9-py3.13
docker run --gpus all -it --rm -p 8000:8000 nvidia/cuopt:latest-cuda12.9-py3.13
bash
docker pull nvidia/cuopt:latest-cuda12.9-py3.13
docker run --gpus all -it --rm -p 8000:8000 nvidia/cuopt:latest-cuda12.9-py3.13

Verify

验证安装

bash
python -m cuopt_server.cuopt_service --ip 0.0.0.0 --port 8000 &
sleep 5
curl -s http://localhost:8000/cuopt/health | jq .
bash
python -m cuopt_server.cuopt_service --ip 0.0.0.0 --port 8000 &
sleep 5
curl -s http://localhost:8000/cuopt/health | jq .

Common Issues

常见问题

  • No module named 'cuopt'
    → check
    pip list | grep cuopt
    ,
    which python
    , reinstall with the correct extra-index-url.
  • CUDA not available → run
    nvidia-smi
    and
    nvcc --version
    ; ensure the package CUDA suffix (
    cu12
    vs
    cu13
    ) matches the installed CUDA.
  • Python vs C →
    cuopt-cuXX
    pulls in
    libcuopt-cuXX
    as a transitive dependency, so the C library (
    libcuopt.so
    ) and headers (
    cuopt_c.h
    ) are already available after installing the Python package. The reverse is not true:
    libcuopt-cuXX
    alone does not install the Python bindings.
  • No module named 'cuopt'
    → 检查
    pip list | grep cuopt
    which python
    ,使用正确的extra-index-url重新安装。
  • CUDA不可用 → 运行
    nvidia-smi
    nvcc --version
    ;确保包的CUDA后缀(
    cu12
    vs
    cu13
    )与已安装的CUDA版本匹配。
  • Python与C的关系 →
    cuopt-cuXX
    会将
    libcuopt-cuXX
    作为传递依赖引入,因此安装Python包后,C库(
    libcuopt.so
    )和头文件(
    cuopt_c.h
    )已可用。反之则不成立:单独安装
    libcuopt-cuXX
    不会安装Python绑定。

See also

另请参阅

  • verification_examples.md — full verification recipes for Python, C, server, and Docker.
  • cuopt-developer
    — build cuOpt from source and contribute to the codebase.
  • verification_examples.md — Python、C语言、服务器和Docker环境下的完整验证教程。
  • cuopt-developer
    — 从源码构建cuOpt并为代码库做贡献。