Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions buildscripts/condarecipe.local/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ requirements:
# Exclude 0.3.20 too
# https://github.com/numba/numba/issues/8096
- libopenblas >=0.3.18, !=0.3.20 # [arm64]
# CUDA 10.2 or later is required for CUDA support
- cudatoolkit >=10.2
# CUDA 11.2 or later is required for CUDA support
- cuda-version >=11.2
- cudatoolkit >=11.2
# scipy 1.0 or later
- scipy >=1.0
# CUDA Python 11.6 or later
Expand Down
45 changes: 34 additions & 11 deletions docs/source/cuda/minor_version_compatibility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,61 @@ CUDA Minor Version Compatibility

CUDA `Minor Version Compatibility
<https://docs.nvidia.com/deploy/cuda-compatibility/index.html#minor-version-compatibility>`_
(MVC) enables the use of a newer CUDA toolkit version than the CUDA version
supported by the driver, provided that the toolkit and driver both have the same
major version. For example, use of CUDA toolkit 11.5 with CUDA driver 450 (CUDA
(MVC) enables the use of a newer CUDA Toolkit version than the CUDA version
supported by the driver, provided that the Toolkit and driver both have the same
major version. For example, use of CUDA Toolkit 11.5 with CUDA driver 450 (CUDA
version 11.0) is supported through MVC.

Numba supports MVC for CUDA 12 on Linux using the external ``pynvjitlink``
package.

Numba supports MVC for CUDA 11 on Linux using the external ``cubinlinker`` and
``ptxcompiler`` packages, subject to the following limitations:

- Linking of archives is unsupported.
- Cooperative Groups are unsupported, because they require an archive to be
linked.

MVC is not yet supported on CUDA 12 - this will be added in a future release of
Numba.

MVC is not supported on Windows.


Enabling MVC Support
--------------------
Installation
------------

CUDA 12
~~~~~~~

To use MVC support, the ``pynvjitlink`` package must be installed. To install
using conda, use:

.. code:: bash

conda install -c rapidsai pynvjitlink

To install with pip, use the NVIDIA package index:

.. code:: bash

pip install --extra-index-url https://pypi.nvidia.com pynvjitlink-cu12

CUDA 12
Comment thread
gmarkall marked this conversation as resolved.
Resolved
~~~~~~~

To use MVC support, the ``cubinlinker`` and ``ptxcompiler`` compiler packages
must be installed from the appropriate channels. To install using conda, use:

.. code:: bash

conda install rapidsai::cubinlinker conda-forge::ptxcompiler
conda install -c rapidsai -c conda-forge cubinlinker ptxcompiler

To install with pip, use the NVIDIA package index:

.. code:: bash

pip install ptxcompiler-cu11 cubinlinker-cu11 --extra-index-url=https://pypi.nvidia.com
pip install --extra-index-url https://pypi.nvidia.com ptxcompiler-cu11 cubinlinker-cu11

Enabling MVC Support
--------------------

MVC support is enabled by setting the environment variable:

Expand All @@ -62,6 +84,7 @@ Further information about Minor Version Compatibility may be found in:

- The `CUDA Compatibility Guide
<https://docs.nvidia.com/deploy/cuda-compatibility/index.html>`_.
- The `README for pynvjitlink
<https://github.com/rapidsai/pynvjitlink/blob/main/README.md>`_.
- The `README for ptxcompiler
<https://github.com/rapidsai/ptxcompiler/blob/main/README.md>`_.

26 changes: 15 additions & 11 deletions docs/source/cuda/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@ Presently 11.2 is the minimum required toolkit version. An NVIDIA driver
sufficient for the toolkit version is also required (see also
:ref:`minor-version-compatibility`).

If you are using Conda, you can install the CUDA toolkit with::
Conda users can install the CUDA Toolkit into a conda environment.

$ conda install cudatoolkit
For CUDA 12, ``cuda-nvcc`` and ``cuda-nvrtc`` are required::

$ conda install -c conda-forge cuda-nvcc cuda-nvrtc "cuda-version>=12.0"

For CUDA 11, ``cudatoolkit`` is required::

$ conda install -c conda-forge cudatoolkit "cuda-version>=11.2,<12.0"

If you are not using Conda or if you want to use a different version of CUDA
toolkit, the following describes how Numba searches for a CUDA toolkit
Expand All @@ -82,7 +88,7 @@ release.

You can install the NVIDIA bindings with::

$ conda install nvidia::cuda-python
$ conda install -c conda-forge cuda-python

if you are using Conda, or::

Expand All @@ -100,23 +106,21 @@ Setting CUDA Installation Path

Numba searches for a CUDA toolkit installation in the following order:

1. Conda installed `cudatoolkit` package.
1. Conda installed CUDA Toolkit packages
2. Environment variable ``CUDA_HOME``, which points to the directory of the
installed CUDA toolkit (i.e. ``/home/user/cuda-10``)
installed CUDA toolkit (i.e. ``/home/user/cuda-12``)
3. System-wide installation at exactly ``/usr/local/cuda`` on Linux platforms.
Versioned installation paths (i.e. ``/usr/local/cuda-10.0``) are intentionally
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.
Note that on macOS, the CUDA SDK must be installed to get the required driver,
and the driver is only supported on macOS prior to 10.14 (Mojave). If the
``libcuda`` library is in a non-standard location, users can set environment
variable ``NUMBA_CUDA_DRIVER`` to the file path (not the directory path) of the
shared library file.
If the ``libcuda`` library is in a non-standard location, users can set
environment variable ``NUMBA_CUDA_DRIVER`` to the file path (not the directory
path) of the shared library file.


Missing CUDA Features
Expand Down
4 changes: 2 additions & 2 deletions docs/source/reference/envvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,8 @@ GPU support

The default compute capability (a string of the type ``major.minor``) to
target when compiling to PTX using ``cuda.compile_ptx``. The default is
5.2, which is the lowest non-deprecated compute capability in the most
recent version of the CUDA toolkit supported (11.0 at present).
5.0, which is the lowest non-deprecated compute capability in the most
recent version of the CUDA toolkit supported (12.4 at present).

.. envvar:: NUMBA_ENABLE_CUDASIM

Expand Down
11 changes: 8 additions & 3 deletions docs/source/user/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ Note that Numba, like Anaconda, only supports PPC in 64-bit little-endian mode.
To enable CUDA GPU support for Numba, install the latest `graphics drivers from
NVIDIA <https://www.nvidia.com/Download/index.aspx>`_ for your platform.
(Note that the open source Nouveau drivers shipped by default with many Linux
distributions do not support CUDA.) Then install the ``cudatoolkit`` package::
distributions do not support CUDA.) Then install the CUDA Toolkit package.

$ conda install cudatoolkit
For CUDA 12, ``cuda-nvcc`` and ``cuda-nvrtc`` are required::

You do not need to install the CUDA SDK from NVIDIA.
$ conda install -c conda-forge cuda-nvcc cuda-nvrtc "cuda-version>=12.0"

For CUDA 11, ``cudatoolkit`` is required::

$ conda install -c conda-forge cudatoolkit "cuda-version>=11.2,<12.0"

You do not need to install the CUDA SDK from NVIDIA.

Installing using pip on x86/x86_64 Platforms
--------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions docs/upcoming_changes/9487.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CUDA 12 conda installation documentation
----------------------------------------

Installation instructions have been added for CUDA 12 conda users.
7 changes: 4 additions & 3 deletions numba/cuda/cudadrv/libs.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Cudatoolkit libraries lookup utilities.
"""CUDA Toolkit libraries lookup utilities.

Cudatoolkit libraries can be available via either:
CUDA Toolkit libraries can be available via either:

- the `cudatoolkit` conda package,
- the `cuda-nvcc` and `cuda-nvrtc` conda packages for CUDA 12,
- the `cudatoolkit` conda package for CUDA 11,
- a user supplied location from CUDA_HOME,
- a system wide location,
- package-specific locations (e.g. the Debian NVIDIA packages),
Expand Down
11 changes: 8 additions & 3 deletions numba/cuda/cudadrv/nvvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def get_log(self):
(12, 1): ((5, 0), (9, 0)),
(12, 2): ((5, 0), (9, 0)),
(12, 3): ((5, 0), (9, 0)),
(12, 4): ((5, 0), (9, 0)),
}


Expand Down Expand Up @@ -416,10 +417,14 @@ def get_arch_option(major, minor):


MISSING_LIBDEVICE_FILE_MSG = '''Missing libdevice file.
Please ensure you have package cudatoolkit >= 11.0
Install package by:
Please ensure you have a CUDA Toolkit 11.2 or higher.
For CUDA 12, ``cuda-nvcc`` and ``cuda-nvrtc`` are required:

conda install cudatoolkit
$ conda install -c conda-forge cuda-nvcc cuda-nvrtc "cuda-version>=12.0"

For CUDA 11, ``cudatoolkit`` is required:

$ conda install -c conda-forge cudatoolkit "cuda-version>=11.2,<12.0"
'''


Expand Down