diff --git a/cuda_bindings/README.md b/cuda_bindings/README.md index 7a2d8fc85..3ece5667d 100644 --- a/cuda_bindings/README.md +++ b/cuda_bindings/README.md @@ -19,9 +19,9 @@ Differences between these options are described in [Installation](https://nvidia 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 12.0 to 12.6 +* CUDA Toolkit 12.x -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. +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). ### Supported Python Versions @@ -63,8 +63,8 @@ Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA Multiple testing options are available: -* Cython Unit Tests * Python Unit Tests +* Cython Unit Tests * Samples * Benchmark @@ -73,18 +73,18 @@ Multiple testing options are available: 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. To run these tests: -* `python -m pytest tests/` against local builds +* `python -m pytest tests/` against editable installations * `pytest tests/` against installed packages ### Cython Unit Tests -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: +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: 1. Setup environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation. 2. Run `build_tests` script located in `test/cython` appropriate to your platform. This will both cythonize the tests and build them. To run these tests: -* `python -m pytest tests/cython/` against local builds +* `python -m pytest tests/cython/` against editable installations * `pytest tests/cython/` against installed packages ### Samples @@ -102,7 +102,7 @@ In addition, extra examples are included: wrappers of the driver API. To run these samples: -* `python -m pytest tests/cython/` against local builds +* `python -m pytest tests/cython/` against editable installations * `pytest tests/cython/` against installed packages ### Benchmark (WIP) @@ -110,5 +110,5 @@ To run these samples: 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. The intended way to run these benchmarks was: -* `python -m pytest --benchmark-only benchmark/` against local builds +* `python -m pytest --benchmark-only benchmark/` against editable installations * `pytest --benchmark-only benchmark/` against installed packages diff --git a/cuda_bindings/docs/source/install.md b/cuda_bindings/docs/source/install.md index 6bd307192..b5c3e6254 100644 --- a/cuda_bindings/docs/source/install.md +++ b/cuda_bindings/docs/source/install.md @@ -2,91 +2,51 @@ ## Runtime Requirements -CUDA Python is supported on all platforms that CUDA is supported. Specific -dependencies are as follows: +`cuda.bindings` supports the same platforms as CUDA. Runtime dependencies are: * Driver: Linux (450.80.02 or later) Windows (456.38 or later) -* CUDA Toolkit 12.0 to 12.6 +* CUDA Toolkit 12.x -```{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. +```{note} +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). ``` ## Installing from PyPI -```{code-block} shell -pip install cuda-python +```console +$ pip install cuda-python ``` ## Installing from Conda -```{code-block} shell -conda install -c nvidia cuda-python +```console +$ conda install -c conda-forge cuda-python ``` -Conda packages are assigned a dependency to CUDA Toolkit: - -* cuda-cudart (Provides CUDA headers to enable writting NVRTC kernels with CUDA types) -* cuda-nvrtc (Provides NVRTC shared library) - ## Installing from Source -### Build Requirements +### Requirements -* CUDA Toolkit headers -* Cython -* pyclibrary +* CUDA Toolkit headers[^1] -Remaining build and test dependencies are outlined in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt) +[^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. -The version of CUDA Toolkit headers must match the major.minor of CUDA Python. Note that minor version compatibility will still be maintained. +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: -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: - -``` -export CUDA_HOME=/usr/local/cuda +```console +$ export CUDA_HOME=/usr/local/cuda ``` -### In-place - -To compile the extension in-place, run: - -```{code-block} shell -python setup.py build_ext --inplace +```{note} +Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement. ``` -To compile for debugging the extension modules with gdb, pass the `--debug` -argument to setup.py. - -### Develop +### Editable Install You can use -```{code-block} shell -pip install -e . +```console +$ pip install -v -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 - -```{code-block} shell -conda env create -f docs_src/environment-docs.yml -conda activate cuda-python-docs -``` -Then compile and install `cuda-python` following the steps above. - -```{code-block} shell -cd docs_src -make html -open build/html/index.html -``` - -### Publish the Docs - -```{code-block} shell -git checkout gh-pages -cd docs_src -make html -cp -a build/html/. ../docs/ -``` +to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding). diff --git a/cuda_core/README.md b/cuda_core/README.md index f66d05e1b..de68bc9e4 100644 --- a/cuda_core/README.md +++ b/cuda_core/README.md @@ -39,5 +39,5 @@ for more details, including how to sign your commits. ## Testing To run these tests: -* `python -m pytest tests/` against local builds +* `python -m pytest tests/` against editable installations * `pytest tests/` against installed packages