NVIDIA / numba-cuda

BSD 2-Clause "Simplified" License
36 stars 8 forks source link

Fixups following #23 / #56 #59

Closed gmarkall closed 1 month ago

gmarkall commented 1 month ago

Some small fixups I'd have suggested, and renaming the environment /config variable as per #58.

brandon-b-miller commented 1 month ago

This LGTM but I think we should add docs here as well. What do you think of this patch as something to start out with?

``` diff --git a/docs/source/reference/envvars.rst b/docs/source/reference/envvars.rst index aae4b98..a106f74 100644 --- a/docs/source/reference/envvars.rst +++ b/docs/source/reference/envvars.rst @@ -120,4 +120,14 @@ target. ``/usr/local/cuda/include``. On Windows, the default is ``$env:CUDA_PATH\include``. +.. envvar:: NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY + + Enable minor version compatibility for the CUDA driver. Requires the + ``cubinlinker`` and ``ptxcompiler`` packages to be installed. Provides minor + version compatibility for driver versions less than 12.0. +.. envvar:: NUMBA_CUDA_ENABLE_PYNVJITLINK + + Use ``pynvjitlink`` for minor version compatibility. Requires the ``pynvjitlink`` + package to be installed. Provides minor version compatibility for driver versions + greater than 12.0. diff --git a/docs/source/user/minor_version_compatibility.rst b/docs/source/user/minor_version_compatibility.rst index a421c07..879616f 100644 --- a/docs/source/user/minor_version_compatibility.rst +++ b/docs/source/user/minor_version_compatibility.rst @@ -65,7 +65,8 @@ MVC support is enabled by setting the environment variable: .. code:: bash - export NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY=1 + export NUMBA_CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY=1 # CUDA 11 + export NUMBA_CUDA_ENABLE_PYNVJITLINK=1 # CUDA 12 or by setting a configuration variable prior to using any CUDA functionality in @@ -74,7 +75,8 @@ Numba: .. code:: python from numba import config - config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY = True + config.CUDA_ENABLE_MINOR_VERSION_COMPATIBILITY = True # CUDA 11 + config.CUDA_ENABLE_PYNVJITLINK = True # CUDA 12 References ```

In addition I debated documenting NUMBA_CUDA_TEST_BIN_DIR. As a final thought it might now be necessary for users who run the tests locally to make the tests in order for them to pass. We might consider documenting this as part of contributing process or similar.

gmarkall commented 1 month ago

What do you think of this patch as something to start out with?

I think that looks perfect as-is.

In addition I debated documenting NUMBA_CUDA_TEST_BIN_DIR. As a final thought it might now be necessary for users who run the tests locally to make the tests in order for them to pass. We might consider documenting this as part of contributing process or similar.

Let's leave this for now - I was trying to think if there's any way to streamline this a bit more / make it more transparent for users, since it's not going to be a straightforward explanation to have to run make somewhere in someone's install tree if they're running from a package.

gmarkall commented 1 month ago

/ok to test

gmarkall commented 1 month ago

@brandon-b-miller I'm happy with the docs you provided - are you happy for this to be merged?