|
2 | 2 |
|
3 | 3 | ## Runtime Requirements |
4 | 4 |
|
5 | | -CUDA Python is supported on all platforms that CUDA is supported. Specific |
6 | | -dependencies are as follows: |
| 5 | +`cuda-python` supports the same platforms as CUDA. Runtime dependencies are: |
7 | 6 |
|
8 | 7 | * Driver: Linux (450.80.02 or later) Windows (456.38 or later) |
9 | 8 | * CUDA Toolkit 12.0 to 12.6 |
10 | 9 |
|
11 | | -```{note} Only the NVRTC redistributable component is required from the CUDA Toolkit. [CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/index.html) Installation Guides can be used for guidance. Note that the NVRTC component in the Toolkit can be obtained via PYPI, Conda or Local Installer. |
| 10 | +```{note} Only the NVRTC redistributable component is required from the CUDA Toolkit. [CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/index.html) Installation Guides can be used for guidance. Note that the NVRTC component in the Toolkit can be obtained via PYPI, Conda or local installers. |
12 | 11 | ``` |
13 | 12 |
|
14 | 13 | ## Installing from PyPI |
15 | 14 |
|
16 | | -```{code-block} shell |
17 | | -pip install cuda-python |
| 15 | +```console |
| 16 | +$ pip install cuda-python |
18 | 17 | ``` |
19 | 18 |
|
20 | 19 | ## Installing from Conda |
21 | 20 |
|
22 | | -```{code-block} shell |
23 | | -conda install -c nvidia cuda-python |
| 21 | +```console |
| 22 | +$ conda install -c nvidia cuda-python |
24 | 23 | ``` |
25 | 24 |
|
26 | | -Conda packages are assigned a dependency to CUDA Toolkit: |
| 25 | +Conda packages have dependencies to CUDA Toolkit components: |
27 | 26 |
|
28 | | -* cuda-cudart (Provides CUDA headers to enable writting NVRTC kernels with CUDA types) |
| 27 | +* cuda-cudart (Provides CUDA headers to enable writing NVRTC kernels with CUDA types) |
29 | 28 | * cuda-nvrtc (Provides NVRTC shared library) |
30 | 29 |
|
31 | 30 | ## Installing from Source |
32 | 31 |
|
33 | | -### Build Requirements |
| 32 | +### Requirements |
34 | 33 |
|
35 | | -* CUDA Toolkit headers |
36 | | -* Cython |
37 | | -* pyclibrary |
| 34 | +* CUDA Toolkit headers[^1] |
| 35 | +* [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/cuda_bindings/requirements.txt) |
38 | 36 |
|
39 | | -Remaining build and test dependencies are outlined in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt) |
| 37 | +[^1]: User projects that `cimport` CUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by the `cuda-python` major.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python. |
40 | 38 |
|
41 | | -The version of CUDA Toolkit headers must match the major.minor of CUDA Python. Note that minor version compatibility will still be maintained. |
42 | | - |
43 | | -During the build process, environment variable `CUDA_HOME` or `CUDA_PATH` are used to find the location of CUDA headers. In particular, if your headers are located in path `/usr/local/cuda/include`, then you should set `CUDA_HOME` as follows: |
| 39 | +Source builds require that the provided CUDA headers are of the same major.minor version as the `cuda-python` bindings you're trying to build. Despite of 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: |
44 | 40 |
|
| 41 | +```console |
| 42 | +$ export CUDA_HOME=/usr/local/cuda |
45 | 43 | ``` |
46 | | -export CUDA_HOME=/usr/local/cuda |
| 44 | + |
| 45 | +```{note} Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement. |
47 | 46 | ``` |
48 | 47 |
|
49 | 48 | ### In-place |
50 | 49 |
|
51 | 50 | To compile the extension in-place, run: |
52 | 51 |
|
53 | | -```{code-block} shell |
54 | | -python setup.py build_ext --inplace |
| 52 | +```console |
| 53 | +$ python setup.py build_ext --inplace |
55 | 54 | ``` |
56 | 55 |
|
57 | | -To compile for debugging the extension modules with gdb, pass the `--debug` |
58 | | -argument to setup.py. |
| 56 | +To compile for debugging the extension modules with gdb, pass the `--debug` argument to setup.py. |
59 | 57 |
|
60 | 58 | ### Develop |
61 | 59 |
|
62 | 60 | You can use |
63 | 61 |
|
64 | | -```{code-block} shell |
65 | | -pip install -e . |
66 | | -``` |
67 | | - |
68 | | -to install the module as editible in your current Python environment (e.g. for |
69 | | -testing of porting other libraries to use the binding). |
70 | | - |
71 | | -## Build the Docs |
72 | | - |
73 | | -```{code-block} shell |
74 | | -conda env create -f docs_src/environment-docs.yml |
75 | | -conda activate cuda-python-docs |
76 | | -``` |
77 | | -Then compile and install `cuda-python` following the steps above. |
78 | | - |
79 | | -```{code-block} shell |
80 | | -cd docs_src |
81 | | -make html |
82 | | -open build/html/index.html |
| 62 | +```console |
| 63 | +$ pip install -e . |
83 | 64 | ``` |
84 | 65 |
|
85 | | -### Publish the Docs |
86 | | - |
87 | | -```{code-block} shell |
88 | | -git checkout gh-pages |
89 | | -cd docs_src |
90 | | -make html |
91 | | -cp -a build/html/. ../docs/ |
92 | | -``` |
| 66 | +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