Skip to content

Commit ee8d7cd

Browse files
authored
Merge pull request #372 from vzhurba01/doc-cython-layer-requirements
Document header requirements for Cython users
2 parents 09a1f5d + 083347c commit ee8d7cd

File tree

3 files changed

+29
-69
lines changed

3 files changed

+29
-69
lines changed

cuda_bindings/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Differences between these options are described in [Installation](https://nvidia
1919
CUDA Python is supported on all platforms that CUDA is supported. Specific dependencies are as follows:
2020

2121
* Driver: Linux (450.80.02 or later) Windows (456.38 or later)
22-
* CUDA Toolkit 12.0 to 12.6
22+
* CUDA Toolkit 12.x
2323

24-
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.
24+
Only the NVRTC and nvJitLink redistributable components are required from the CUDA Toolkit, which can be obtained via PyPI, Conda, 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).
2525

2626
### Supported Python Versions
2727

@@ -63,8 +63,8 @@ Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA
6363

6464
Multiple testing options are available:
6565

66-
* Cython Unit Tests
6766
* Python Unit Tests
67+
* Cython Unit Tests
6868
* Samples
6969
* Benchmark
7070

@@ -73,18 +73,18 @@ Multiple testing options are available:
7373
Responsible for validating different binding usage patterns. Unit test `test_kernelParams.py` is particularly special since it demonstrates various approaches in setting up kernel launch parameters.
7474

7575
To run these tests:
76-
* `python -m pytest tests/` against local builds
76+
* `python -m pytest tests/` against editable installations
7777
* `pytest tests/` against installed packages
7878

7979
### Cython Unit Tests
8080

81-
Cython tests are located in `tests/cython` and need to be built. Furthermore they need CUDA Toolkit headers matching the major-minor of CUDA Python. To build them:
81+
Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [Installing from Source](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them:
8282

8383
1. Setup environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation.
8484
2. Run `build_tests` script located in `test/cython` appropriate to your platform. This will both cythonize the tests and build them.
8585

8686
To run these tests:
87-
* `python -m pytest tests/cython/` against local builds
87+
* `python -m pytest tests/cython/` against editable installations
8888
* `pytest tests/cython/` against installed packages
8989

9090
### Samples
@@ -102,13 +102,13 @@ In addition, extra examples are included:
102102
wrappers of the driver API.
103103

104104
To run these samples:
105-
* `python -m pytest tests/cython/` against local builds
105+
* `python -m pytest tests/cython/` against editable installations
106106
* `pytest tests/cython/` against installed packages
107107

108108
### Benchmark (WIP)
109109

110110
Benchmarks were used for performance analysis during initial release of CUDA Python. Today they need to be updated the 12.x toolkit and are work in progress.
111111

112112
The intended way to run these benchmarks was:
113-
* `python -m pytest --benchmark-only benchmark/` against local builds
113+
* `python -m pytest --benchmark-only benchmark/` against editable installations
114114
* `pytest --benchmark-only benchmark/` against installed packages

cuda_bindings/docs/source/install.md

Lines changed: 20 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,91 +2,51 @@
22

33
## Runtime Requirements
44

5-
CUDA Python is supported on all platforms that CUDA is supported. Specific
6-
dependencies are as follows:
5+
`cuda.bindings` supports the same platforms as CUDA. Runtime dependencies are:
76

87
* Driver: Linux (450.80.02 or later) Windows (456.38 or later)
9-
* CUDA Toolkit 12.0 to 12.6
8+
* CUDA Toolkit 12.x
109

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}
11+
Only the NVRTC and nvJitLink redistributable components are required from the CUDA Toolkit, which can be obtained via PyPI, Conda, 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).
1212
```
1313

1414
## Installing from PyPI
1515

16-
```{code-block} shell
17-
pip install cuda-python
16+
```console
17+
$ pip install cuda-python
1818
```
1919

2020
## Installing from Conda
2121

22-
```{code-block} shell
23-
conda install -c nvidia cuda-python
22+
```console
23+
$ conda install -c conda-forge cuda-python
2424
```
2525

26-
Conda packages are assigned a dependency to CUDA Toolkit:
27-
28-
* cuda-cudart (Provides CUDA headers to enable writting NVRTC kernels with CUDA types)
29-
* cuda-nvrtc (Provides NVRTC shared library)
30-
3126
## Installing from Source
3227

33-
### Build Requirements
28+
### Requirements
3429

35-
* CUDA Toolkit headers
36-
* Cython
37-
* pyclibrary
30+
* CUDA Toolkit headers[^1]
3831

39-
Remaining build and test dependencies are outlined in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt)
32+
[^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.
4033

41-
The version of CUDA Toolkit headers must match the major.minor of CUDA Python. Note that minor version compatibility will still be maintained.
34+
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:
4235

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:
44-
45-
```
46-
export CUDA_HOME=/usr/local/cuda
36+
```console
37+
$ export CUDA_HOME=/usr/local/cuda
4738
```
4839

49-
### In-place
50-
51-
To compile the extension in-place, run:
52-
53-
```{code-block} shell
54-
python setup.py build_ext --inplace
40+
```{note}
41+
Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement.
5542
```
5643

57-
To compile for debugging the extension modules with gdb, pass the `--debug`
58-
argument to setup.py.
59-
60-
### Develop
44+
### Editable Install
6145

6246
You can use
6347

64-
```{code-block} shell
65-
pip install -e .
48+
```console
49+
$ pip install -v -e .
6650
```
6751

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
83-
```
84-
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-
```
52+
to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding).

cuda_core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ for more details, including how to sign your commits.
3939
## Testing
4040

4141
To run these tests:
42-
* `python -m pytest tests/` against local builds
42+
* `python -m pytest tests/` against editable installations
4343
* `pytest tests/` against installed packages

0 commit comments

Comments
 (0)