cuopt-install
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesecuOpt 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-developerSystem 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-cu12with CUDA 12).libcuopt-cu12 - Driver: NVIDIA driver compatible with the CUDA version.
- (Python) depends on
cuopt-cuXX(C), so installing the Python package also installs the C library and headers. Installinglibcuopt-cuXXon its own does not install the Python API.libcuopt-cuXX
- 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驱动。
- (Python版)依赖于
cuopt-cuXX(C语言版),因此安装Python包时也会同时安装C语言库和头文件。单独安装libcuopt-cuXX不会安装Python API。libcuopt-cuXX
Required questions
需要确认的问题
Ask these if not already clear:
- Interface — Python, C, or REST server? Server can be called from any language via HTTP.
- CUDA version — What is installed? Check with or
nvcc --version.nvidia-smi - Package manager — pip, conda, or Docker preferred?
- Environment — Local machine with GPU, cloud instance, Docker/Kubernetes, or remote/server (no local GPU)?
如果以下信息不明确,请询问用户:
- 使用界面——Python、C语言还是REST服务器?服务器可通过HTTP被任何语言调用。
- CUDA版本——已安装的CUDA版本是什么?可通过或
nvcc --version命令查看。nvidia-smi - 包管理器——偏好使用pip、conda还是Docker?
- 运行环境——带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 cuoptbash
conda install -c rapidsai -c conda-forge -c nvidia cuoptVerify
验证
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 , which is also pulled in as a dependency of — so if you already installed the Python package, the C library and headers are already present. Install standalone only when you want the C API without Python. Choose one of pip or conda — do not run both.
libcuopt-cuXXcuopt-cuXXlibcuoptC API包含在中,它也是的依赖项——因此如果您已经安装了Python包,C语言库和头文件已经存在。仅当您需要不带Python的C API时,才单独安装。选择pip或conda中的一种方式——不要同时运行两种。
libcuopt-cuXXcuopt-cuXXlibcuoptpip
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 libcuoptbash
conda install -c rapidsai -c conda-forge -c nvidia libcuoptVerify
验证
bash
undefinedbash
undefinedconda:
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"
undefinedfind "$(python -c 'import sys; print(sys.prefix)')" -name "cuopt_c.h"
find "$(python -c 'import sys; print(sys.prefix)')" -name "libcuopt.so"
undefinedServer (REST)
服务器(REST)
pip
pip
bash
pip install --extra-index-url=https://pypi.nvidia.com cuopt-server-cu12 cuopt-sh-clientbash
pip install --extra-index-url=https://pypi.nvidia.com cuopt-server-cu12 cuopt-sh-clientconda
conda
bash
conda install -c rapidsai -c conda-forge -c nvidia cuopt-server cuopt-sh-clientbash
conda install -c rapidsai -c conda-forge -c nvidia cuopt-server cuopt-sh-clientDocker
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.13bash
docker pull nvidia/cuopt:latest-cuda12.9-py3.13
docker run --gpus all -it --rm -p 8000:8000 nvidia/cuopt:latest-cuda12.9-py3.13Verify
验证
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
常见问题
- → check
No module named 'cuopt',pip list | grep cuopt, reinstall with the correct extra-index-url.which python - CUDA not available → run and
nvidia-smi; ensure the package CUDA suffix (nvcc --versionvscu12) matches the installed CUDA.cu13 - Python vs C → pulls in
cuopt-cuXXas a transitive dependency, so the C library (libcuopt-cuXX) and headers (libcuopt.so) are already available after installing the Python package. The reverse is not true:cuopt_c.halone does not install the Python bindings.libcuopt-cuXX
- → 检查
No module named 'cuopt'、pip list | grep cuopt,使用正确的extra-index-url重新安装。which python - CUDA不可用 → 运行和
nvidia-smi;确保软件包的CUDA后缀(nvcc --versionvscu12)与已安装的CUDA版本匹配。cu13 - Python与C语言的关系 → 会将
cuopt-cuXX作为传递依赖项引入,因此安装Python包后,C语言库(libcuopt-cuXX)和头文件(libcuopt.so)已可用。反之则不成立:单独安装cuopt_c.h不会安装Python绑定。libcuopt-cuXX
See also
另请参阅
- verification_examples.md — full verification recipes for Python, C, server, and Docker.
- — build cuOpt from source and contribute to the codebase.
cuopt-developer
- verification_examples.md —— Python、C语言、服务器及Docker的完整验证示例。
- —— 从源码构建cuOpt并为代码库做贡献。
cuopt-developer