cuda.bindings supports the same platforms as CUDA. Runtime dependencies are:
- Linux (x86-64, arm64) and Windows (x86-64)
- Python 3.9 - 3.13
- Driver: Linux (580.65.06 or later) Windows (580.88 or later)
- Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x
The optional CUDA Toolkit components are now installed via the `cuda-toolkit` metapackage from PyPI for improved dependency resolution. Components can also be installed via Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit [Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) and [Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) Installation Guides).
Starting from v12.8.0, cuda-python becomes a meta package which currently depends only on cuda-bindings; in the future more sub-packages will be added to cuda-python. In the instructions below, we still use cuda-python as example to serve existing users, but everything is applicable to cuda-bindings as well.
$ pip install -U cuda-pythonInstall all optional dependencies with:
pip install -U cuda-python[all]
Where the optional dependencies include:
nvidia-cuda-nvrtc(NVRTC runtime compilation library)nvidia-nvjitlink(nvJitLink library)nvidia-nvvm(NVVM library)nvidia-cufile(cuFile library, Linux only)
These are now installed through the cuda-toolkit metapackage for improved dependency resolution.
$ conda install -c conda-forge cuda-pythonWhen using conda, the `cuda-version` metapackage can be used to control the versions of CUDA Toolkit components that are installed to the conda environment.
For example:
$ conda install -c conda-forge cuda-python cuda-version=13Source builds require that the provided CUDA headers are of the same major.minor version as the cuda.bindings you're trying to build. Despite this requirement, note that the minor version compatibility is still maintained. Use the CUDA_HOME (or CUDA_PATH) environment variable to specify the location of your headers. For example, if your headers are located in /usr/local/cuda/include, then you should set CUDA_HOME with:
$ export CUDA_HOME=/usr/local/cudaSee Environment Variables for a description of other build-time environment variables.
Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement.
You can use
$ pip install -v -e .to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding).
Footnotes
-
User projects that
cimportCUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by thecuda.bindingsmajor.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python. ↩ -
The CUDA Runtime static library (
libcudart_static.aon Linux,cudart_static.libon Windows) is part of the CUDA Toolkit. If using conda packages, it is contained in thecuda-cudart-staticpackage. ↩