|
1 | | -# Installation |
| 1 | +Installation |
| 2 | +============ |
2 | 3 |
|
3 | | -## Runtime Requirements |
| 4 | +Runtime Requirements |
| 5 | +-------------------- |
4 | 6 |
|
5 | | -`cuda.bindings` supports the same platforms as CUDA. Runtime dependencies are: |
| 7 | +``cuda.bindings`` supports the same platforms as CUDA. Runtime dependencies are: |
6 | 8 |
|
7 | 9 | * Linux (x86-64, arm64) and Windows (x86-64) |
8 | 10 | * Python 3.9 - 3.13 |
9 | 11 | * Driver: Linux (580.65.06 or later) Windows (580.88 or later) |
10 | 12 | * Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x |
11 | 13 |
|
12 | | -```{note} |
13 | | -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). |
14 | | -``` |
| 14 | +.. note:: |
15 | 15 |
|
16 | | -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. |
| 16 | + 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). |
17 | 17 |
|
| 18 | +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. |
18 | 19 |
|
19 | | -## Installing from PyPI |
| 20 | +Installing from PyPI |
| 21 | +-------------------- |
20 | 22 |
|
21 | | -```console |
22 | | -$ pip install -U cuda-python |
23 | | -``` |
| 23 | +.. code-block:: console |
| 24 | +
|
| 25 | + $ pip install -U cuda-python |
24 | 26 |
|
25 | 27 | Install all optional dependencies with: |
26 | | -```{code-block} shell |
27 | | -pip install -U cuda-python[all] |
28 | | -``` |
| 28 | +.. code-block:: shell |
| 29 | +
|
| 30 | + pip install -U cuda-python[all] |
29 | 31 |
|
30 | 32 | Where the optional dependencies include: |
31 | 33 |
|
32 | | -* `nvidia-cuda-nvrtc` (NVRTC runtime compilation library) |
33 | | -* `nvidia-nvjitlink` (nvJitLink library) |
34 | | -* `nvidia-nvvm` (NVVM library) |
35 | | -* `nvidia-cufile` (cuFile library, Linux only) |
| 34 | +* ``nvidia-cuda-nvrtc`` (NVRTC runtime compilation library) |
| 35 | +* ``nvidia-nvjitlink`` (nvJitLink library) |
| 36 | +* ``nvidia-nvvm`` (NVVM library) |
| 37 | +* ``nvidia-cufile`` (cuFile library, Linux only) |
| 38 | + |
| 39 | +These are now installed through the ``cuda-toolkit`` metapackage for improved dependency resolution. |
36 | 40 |
|
37 | | -These are now installed through the `cuda-toolkit` metapackage for improved dependency resolution. |
| 41 | +Installing from Conda |
| 42 | +--------------------- |
38 | 43 |
|
| 44 | +.. code-block:: console |
39 | 45 |
|
40 | | -## Installing from Conda |
| 46 | + $ conda install -c conda-forge cuda-python |
41 | 47 |
|
42 | | -```console |
43 | | -$ conda install -c conda-forge cuda-python |
44 | | -``` |
| 48 | +.. note:: |
45 | 49 |
|
46 | | -```{note} |
47 | | -When using conda, the `cuda-version` metapackage can be used to control the versions of CUDA Toolkit components that are installed to the conda environment. |
48 | | -``` |
| 50 | + When using conda, the ``cuda-version`` metapackage can be used to control the versions of CUDA Toolkit components that are installed to the conda environment. |
49 | 51 |
|
50 | 52 | For example: |
51 | | -```console |
52 | | -$ conda install -c conda-forge cuda-python cuda-version=13 |
53 | | -``` |
| 53 | +.. code-block:: console |
54 | 54 |
|
| 55 | + $ conda install -c conda-forge cuda-python cuda-version=13 |
55 | 56 |
|
56 | | -## Installing from Source |
| 57 | +Installing from Source |
| 58 | +---------------------- |
57 | 59 |
|
58 | | -### Requirements |
| 60 | +Requirements |
| 61 | +^^^^^^^^^^^^ |
59 | 62 |
|
60 | 63 | * CUDA Toolkit headers[^1] |
61 | 64 | * CUDA Runtime static library[^2] |
62 | 65 |
|
63 | | -[^1]: User projects that `cimport` CUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by the `cuda.bindings` major.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python. |
| 66 | +[^1]: User projects that ``cimport`` CUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by the ``cuda.bindings`` major.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python. |
64 | 67 |
|
65 | | -[^2]: The CUDA Runtime static library (`libcudart_static.a` on Linux, `cudart_static.lib` on Windows) is part of the CUDA Toolkit. If using conda packages, it is contained in the `cuda-cudart-static` package. |
| 68 | +[^2]: The CUDA Runtime static library (``libcudart_static.a`` on Linux, ``cudart_static.lib`` on Windows) is part of the CUDA Toolkit. If using conda packages, it is contained in the ``cuda-cudart-static`` package. |
66 | 69 |
|
67 | | -Source 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: |
| 70 | +Source 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: |
68 | 71 |
|
69 | | -```console |
70 | | -$ export CUDA_HOME=/usr/local/cuda |
71 | | -``` |
| 72 | +.. code-block:: console |
72 | 73 |
|
73 | | -See [Environment Variables](environment_variables.md) for a description of other build-time environment variables. |
| 74 | + $ export CUDA_HOME=/usr/local/cuda |
74 | 75 |
|
75 | | -```{note} |
76 | | -Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement. |
77 | | -``` |
| 76 | +See `Environment Variables <environment_variables.md>`_ for a description of other build-time environment variables. |
78 | 77 |
|
| 78 | +.. note:: |
79 | 79 |
|
80 | | -### Editable Install |
| 80 | + Only ``cydriver``, ``cyruntime`` and ``cynvrtc`` are impacted by the header requirement. |
| 81 | + |
| 82 | +Editable Install |
| 83 | +^^^^^^^^^^^^^^^^ |
81 | 84 |
|
82 | 85 | You can use |
83 | 86 |
|
84 | | -```console |
85 | | -$ pip install -v -e . |
86 | | -``` |
| 87 | +.. code-block:: console |
| 88 | +
|
| 89 | + $ pip install -v -e . |
87 | 90 |
|
88 | 91 | to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding). |
0 commit comments