CUDA Python is supported on all platforms that CUDA is supported. Specific dependencies are as follows:
Driver: Linux (450.80.02 or later) Windows(456.38 or later)
CUDA Toolkit 11.0 to 11.7
Only the NVRTC redistributable component is required from the CUDA Toolkit. CUDA Toolkit Documentation Installation Guides can be used for guidance. Note that the NVRTC component in the Toolkit can be obtained via PiPy, Conda or Local Installer.
Installing from PyPI#
pip install cuda-python
Installing from Conda#
conda install -c nvidia cuda-python
Installing from Source#
Latest list of dependencies can be found at requirements.txt
As per release 11.7.1, the latest CTK headers are required. Mobile platforms facing “has not been declared” error may use headers in https://gitlab.com/nvidia/headers/cuda as a temporary workaround. Consult the release notes for further direction.
To compile the extension in-place, run:
python setup.py build_ext --inplace
To compile for debugging the extension modules with gdb, pass the
argument to setup.py.
You can use
pip install -e .
to install the module as editible in your current Python environment (e.g. for testing of porting other libraries to use the binding).
Build the Docs#
conda env create -f docs_src/environment-docs.yml conda activate cuda-python-docs
Then compile and install
cuda-python following the steps above.
cd docs_src make html open build/html/index.html
Publish the Docs#
git checkout gh-pages cd docs_src make html cp -a build/html/. ../docs/