-
Notifications
You must be signed in to change notification settings - Fork 171
Various documentation improvements #547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
35ae798
3cad06b
f010f9b
7934aa8
277c23d
cfdfd8c
d8ed713
24ec109
2759ae8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,7 @@ | ||
******************************************************* | ||
**************************************** | ||
cuda.bindings: Low-level CUDA interfaces | ||
******************************************************* | ||
**************************************** | ||
|
||
`cuda.bindings` is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. Checkout the `Overview <https://nvidia.github.io/cuda-python/cuda-bindings/latest/overview.html>`_ for the workflow and performance results. | ||
`cuda.bindings` is a standard set of low-level interfaces, providing full coverage of and 1:1 access to the CUDA host APIs from Python. Checkout the `Overview <https://nvidia.github.io/cuda-python/cuda-bindings/latest/overview.html>`_ for the workflow and performance results. | ||
|
||
Installation | ||
============ | ||
|
||
`cuda.bindings` can be installed from: | ||
|
||
* PyPI | ||
* Conda (conda-forge/nvidia channels) | ||
* Source builds | ||
|
||
Differences between these options are described in `Installation <https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html>`_ documentation. Each package guarantees minor version compatibility. | ||
|
||
Runtime Dependencies | ||
==================== | ||
|
||
`cuda.bindings` is supported on all the same platforms as CUDA. Specific dependencies are as follows: | ||
|
||
* Driver: Linux (450.80.02 or later) Windows (456.38 or later) | ||
* CUDA Toolkit 12.x | ||
|
||
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). | ||
For the installation instruction, please refer to the `Installation <https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html>`_ page. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,13 @@ | |
|
||
`cuda.bindings` supports the same platforms as CUDA. Runtime dependencies are: | ||
|
||
* Linux (x86-64, arm64) and Windows (x86-64) | ||
* Python 3.9 - 3.13 | ||
* Driver: Linux (450.80.02 or later) Windows (456.38 or later) | ||
* CUDA Toolkit 12.x | ||
* Optionally, NVRTC, nvJitLink, and NVVM from CUDA Toolkit 12.x | ||
|
||
```{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). | ||
The optional CUDA Toolkit components can be installed via PyPI, 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). | ||
``` | ||
|
||
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. | ||
|
@@ -44,13 +46,17 @@ $ conda install -c conda-forge cuda-python | |
### Requirements | ||
|
||
* CUDA Toolkit headers[^1] | ||
* CUDA Runtime static library[^2] | ||
|
||
[^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. | ||
|
||
[^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. | ||
|
||
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: | ||
|
||
```console | ||
$ export CUDA_HOME=/usr/local/cuda | ||
$ export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH | ||
Comment on lines
58
to
+59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note for the future: we really shouldn't need to set these when things are installed in standard locations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, at some point we should revisit the build-time search behavior. Currently we limit to full explicitness at build time (no implicit auto-discovery behind users' back), while the ongoing path finder project (#451) focuses on run-time use cases. Once the path finder is mature we can consider using it at build time too (cc @rwgk for vis). FWIW though, right now it is not as bad as it seems. If CUDA is installed via Linux system pkg mgr or conda, we need at most BTW, Python projects can be built against CUDA wheels, as long as they don't contain device code that needs to be compiled by nvcc. I've enabled this for |
||
``` | ||
|
||
See [Environment Variables](environment_variables.md) for a description of other build-time environment variables. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. default-role:: cpp:any | ||
|
||
nvjitlink | ||
========= | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. default-role:: cpp:any | ||
|
||
nvvm | ||
==== | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to add nvrtc or the CUDA runtime / driver APIs here?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the two codegens set different expectations regarding API doc generation. The codegen used by driver/runtime/nvrtc regenerates the entire C API references in the docs (with signatures adjusted to match Python), whereas the codegen used by nvvm/nvjitlink generates basic docs with a
see also
link to the corresponding C API. The addition of these links here contain properobjects.inv
that allows cross-linking, e.g.https://nvidia.github.io/cuda-python/pr-preview/pr-547/cuda-bindings/latest/module/nvjitlink.html#cuda.bindings.nvjitlink.create
The see also link works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(FWIW regarding
objects.inv
, it's a binary that is generated by Sphinx and can be introspected by the intersphinx plugin.)