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计算能力 ≥ 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版本——已安装的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语言库和头文件已经存在。仅当您需要不带Python的C API时,才单独安装
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

验证

bash
undefined
bash
undefined

conda:

conda环境:

find $CONDA_PREFIX -name "cuopt_c.h" find $CONDA_PREFIX -name "libcuopt.so"
find $CONDA_PREFIX -name "cuopt_c.h" find $CONDA_PREFIX -name "libcuopt.so"

pip (venv):

pip(虚拟环境):

find "$(python -c 'import sys; print(sys.prefix)')" -name "cuopt_c.h" find "$(python -c 'import sys; print(sys.prefix)')" -name "libcuopt.so"
undefined
find "$(python -c 'import sys; print(sys.prefix)')" -name "cuopt_c.h" find "$(python -c 'import sys; print(sys.prefix)')" -name "libcuopt.so"
undefined

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并为代码库做贡献。