-
Notifications
You must be signed in to change notification settings - Fork 71
[DOCS] Improve the introduction and installation section of the documentation #293
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 2 commits
c10ee51
10a7dea
10dad52
3cabec6
352861f
2301177
b0b4fbe
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,3 +1,4 @@ | ||
| .. _numba-cuda-examples: | ||
|
|
||
| ======== | ||
| Examples | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ User guide | |
|
|
||
| .. toctree:: | ||
|
|
||
| overview.rst | ||
| installation.rst | ||
| kernels.rst | ||
| memory.rst | ||
| device-functions.rst | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| .. _numba-cuda-installation: | ||
|
|
||
| ============ | ||
| Installation | ||
| ============ | ||
|
|
||
| Requirements | ||
| ============ | ||
|
|
||
| Supported GPUs | ||
| -------------- | ||
|
|
||
| Numba supports all NVIDIA GPUs that are supported by the CUDA Toolkit it uses. | ||
| Presently for CUDA 11 this ranges from Compute Capabilities 3.5 to 9.0, and for | ||
| CUDA 12 this ranges from 5.0 to 12.1, depending on the exact installed version. | ||
|
|
||
|
|
||
| Supported CUDA Toolkits | ||
| ----------------------- | ||
|
|
||
| Numba-CUDA aims to support all minor versions of the two most recent CUDA | ||
| Toolkit releases. Presently 11 and 12 are supported; CUDA 11.2 is the minimum | ||
| required, because older releases (11.0 and 11.1) have a version of NVVM based on | ||
| a previous and incompatible LLVM version. | ||
|
|
||
| For further information about version compatibility between toolkit and driver | ||
| versions, refer to :ref:`minor-version-compatibility`. | ||
|
|
||
|
|
||
| Installation with a Python package manager | ||
| ========================================== | ||
|
|
||
| Conda users can install the CUDA Toolkit into a conda environment. | ||
|
|
||
| For CUDA 12, ``cuda-nvcc`` and ``cuda-nvrtc`` are required:: | ||
|
|
||
| $ conda install -c conda-forge numba-cuda cuda-nvcc cuda-nvrtc "cuda-version>=12.0" | ||
|
|
||
| Alternatively, you can install all CUDA 12 dependencies from PyPI via ``pip``:: | ||
|
|
||
| $ pip install numba-cuda[cu12] | ||
|
|
||
| For CUDA 11, ``cudatoolkit`` is required:: | ||
|
|
||
| $ conda install -c conda-forge numba-cuda cudatoolkit "cuda-version>=11.2,<12.0" | ||
|
kkraus14 marked this conversation as resolved.
Outdated
|
||
|
|
||
| or:: | ||
|
|
||
| $ pip install numba-cuda[cu11] | ||
|
|
||
| If you are not using Conda/pip or if you want to use a different version of CUDA | ||
| toolkit, :ref:`cudatoolkit-lookup` describes how Numba searches for a CUDA toolkit. | ||
|
|
||
|
|
||
| Configuration | ||
| ============= | ||
|
|
||
| .. _cuda-bindings: | ||
|
|
||
| CUDA Bindings | ||
| ------------- | ||
|
|
||
| Numba supports interacting with the CUDA Driver API via either the `NVIDIA CUDA | ||
| Python bindings <https://nvidia.github.io/cuda-python/>`_ or its own ctypes-based | ||
| bindings. Functionality is equivalent between the two binding choices. The | ||
| NVIDIA bindings are the default, and the ctypes bindings are now deprecated. | ||
|
|
||
| If the NVIDIA bindings are not present in your environment, you can install them | ||
| with:: | ||
|
|
||
| $ conda install -c conda-forge cuda-bindings | ||
|
|
||
| if you are using Conda, or:: | ||
|
|
||
| $ pip install cuda-bindings[cu11] | ||
|
Contributor
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. Is
Contributor
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. No it is not. We should be doing
Contributor
Author
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. I would be happy to change this but I'm not clear what the exact correct thing to write should be. Can you make a suggestion please?
Member
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. I believe we can just keep the text but remove all conda/pip install commands from this section. In the previous section, we already taught users how to install things, and
Contributor
Author
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. Thanks Leo - I've now removed these, and it does read better. |
||
|
|
||
| for CUDA 11 bindings with pip, or:: | ||
|
|
||
| $ pip install cuda-bindings[cu12] | ||
|
|
||
| for CUDA 12 bindings with pip. Note that the bracket notation | ||
| ``numba-cuda[cuXX]`` introduced above will bring in this dependency for you. | ||
|
|
||
| If you do not want to use the NVIDIA bindings, the (deprecated) ctypes bindings | ||
| can be enabled by setting the environment variable | ||
| :envvar:`NUMBA_CUDA_USE_NVIDIA_BINDING` to ``"0"``. | ||
|
|
||
|
|
||
| .. _cudatoolkit-lookup: | ||
|
|
||
| Setting CUDA Installation Path | ||
| ------------------------------ | ||
|
|
||
| Numba searches for a CUDA toolkit installation in the following order: | ||
|
Contributor
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. I think this order is for the ctypes based bindings and doesn't reflect the
Contributor
Author
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. Thanks - I didn't realise this until our sync meeting today, after I made this PR. Will update.
Member
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. Might be better to add a note explaining the search order might change in the future?
Contributor
Author
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. I'll make it clear that the behaviour using the NVIDIA bindings follows path-finder's logic, and that the ctypes behaviour is for the deprecated path. |
||
|
|
||
| 1. Conda-installed CUDA Toolkit packages | ||
| 2. Pip-installed CUDA Toolkit packages | ||
| 3. The environment variable ``CUDA_HOME``, which points to the directory of the | ||
| installed CUDA toolkit (i.e. ``/home/user/cuda-12``) | ||
| 4. System-wide installation at exactly ``/usr/local/cuda`` on Linux platforms. | ||
| Versioned installation paths (i.e. ``/usr/local/cuda-12.0``) are intentionally | ||
| ignored. Users can use ``CUDA_HOME`` to select specific versions. | ||
|
|
||
| In addition to the CUDA toolkit libraries, which can be installed by conda into | ||
| an environment or installed system-wide by the `CUDA SDK installer | ||
| <https://developer.nvidia.com/cuda-downloads>`_, the CUDA target in Numba | ||
| also requires an up-to-date NVIDIA graphics driver. Updated graphics drivers | ||
| are also installed by the CUDA SDK installer, so there is no need to do both. | ||
| If the ``libcuda`` library is in a non-standard location, users can set | ||
| environment variable :envvar:`NUMBA_CUDA_DRIVER` to the file path (not the | ||
| directory path) of the shared library file. | ||
This file was deleted.
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.
Should we consider just adding these to the conda recipe?
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.
To add, once we depend on
cuda-bindingsin the conda recipe,cuda-nvrtcis already a dependency. What iscuda-nvccneeded for?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.
I'm stretching my memory a bit here, but I think it might have been the only way to get libdevice installed (I'm not sure if that's still current).
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.
If it's only for
libdevicethen that comes from thecuda-nvvm-toolsconda package these days that we should depend on instead.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.
cuda-nvccwas probably used to provide libnvvm. I need to look it up and check which 12.x did we split it from nvcc-impl.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.
I just remembered - if you want to run the full test suite, you need to have nvcc installed to build the test binaries. I don't know whether this means it makes sense to have it installed for end-users though.
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.
If I run
(using the NVIDIA channel only because 0.15.0 is not yet on conda-forge right now)
then it will install (amongst others)
so it looks like
mamba install numba-cudais going to be sufficient to pull in all required dependencies for running Numba-CUDA - I'll simplify the docs here.