Skip to content
Open
Changes from all 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
38 changes: 38 additions & 0 deletions cuda_core/docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,44 @@ the CUDA Toolkit wheels, and let ``cuda-core`` choose the ``cuda-bindings`` vers
A pin of your own can conflict with the floor of a later ``cuda-core`` release.


Matching CUDA Toolkit Version to System Driver (PTX Compatibility)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When compiling PTX dynamically with ``cuda.core``'s compilation APIs, the resulting PTX ISA version
must be supported by the host system GPU driver. By default, installing ``cuda-core[cu12]`` or
``cuda-core[cu13]`` resolves ``cuda-toolkit`` to the latest wheel release for that major version. If
your system display driver is older than the minimum driver required by that latest toolkit release,
attempting to JIT-compile and execute the PTX will fail with a driver mismatch or unsupported PTX version error.

To ensure PTX compatibility with your system's installed CUDA driver:

1. **Use the system-installed CUDA Toolkit**:
If an appropriate CUDA Toolkit matching your driver is already installed on the system, install
only the bindings extra in a clean environment (or ensure conflicting wheels like ``nvidia-cuda-nvrtc-cu12``
have been removed, as ``cuda.pathfinder`` inspects installed Python packages before system paths):

.. code-block:: console

$ pip install cuda-core[minimal-sysctk12]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
# or for CUDA 13:
$ pip install cuda-core[minimal-sysctk13]

2. **Constrain the Toolkit Wheel Version**:
If installing toolkit wheels via PyPI, constrain the NVRTC compiler wheel (e.g. ``nvidia-cuda-nvrtc-cu12`` or
``cuda-toolkit[nvrtc]``) alongside ``cuda-toolkit`` so that ``pip`` does not resolve an unconstrained, newer
compiler package:

.. code-block:: console

$ pip install "cuda-core[cu12]" "nvidia-cuda-nvrtc-cu12<12.5" "cuda-toolkit<12.5"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

important: Constrain the NVVM compiler wheel.

cuda-core[cu12] installs nvidia-cuda-nvcc-cu12 with no version bound, through cuda-bindings[all]. The cuda-toolkit<12.5 and nvidia-cuda-nvrtc-cu12<12.5 constraints do not bound that wheel. For NVVM IR input, Program can load libNVVM from it. A newer libNVVM can emit PTX that a CUDA 12.4 driver cannot load. Add the same bound to the nvcc wheel:

Suggested fix

--- "a/cuda_core/docs/source/install.rst"
+++ "b/cuda_core/docs/source/install.rst"
@@ -103,7 +103,7 @@
 
    .. code-block:: console
 
-      $ pip install "cuda-core[cu12]" "nvidia-cuda-nvrtc-cu12<12.5" "cuda-toolkit<12.5"
+      $ pip install "cuda-core[cu12]" "nvidia-cuda-nvcc-cu12<12.5" "nvidia-cuda-nvrtc-cu12<12.5" "cuda-toolkit<12.5"
 
    In Conda environments, pin ``cuda-version`` to the specific minor version:
 
Committable suggestion

IMPORTANT
Review the replacement and indentation, then test before committing.

Suggested change
$ pip install "cuda-core[cu12]" "nvidia-cuda-nvrtc-cu12<12.5" "cuda-toolkit<12.5"
$ pip install "cuda-core[cu12]" "nvidia-cuda-nvcc-cu12<12.5" "nvidia-cuda-nvrtc-cu12<12.5" "cuda-toolkit<12.5"


In Conda environments, pin ``cuda-version`` to the specific minor version:

.. code-block:: console

$ conda install -c conda-forge cuda-core cuda-version=12.4


Installing from Conda (conda-forge)
-----------------------------------

Expand Down
Loading