Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion cuda_bindings_13/cuda/bindings/utils/_nvvm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def check_nvvm_compiler_options(options: Sequence[str]) -> bool:

If the test program compiles successfully, True is returned.

If libNVVM cannot be found, False is returned.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Minor · Maintainability & Code Quality · Quick win

Add check_nvvm_compiler_options to the utils module reference.

docs/source/module/utils.rst autosummary omits check_nvvm_compiler_options, even though cuda.bindings.utils exports it. Its return contract changes in this PR, so the module reference should list it. This keeps the new False return documented where users look for the API.

Suggested fix

 .. autosummary::
    :toctree: generated/
 
+   check_nvvm_compiler_options
    get_cuda_native_handle
    get_minimal_required_cuda_ver_from_ptx_ver
    get_ptx_ver


cuda.bindings.nvvm returns exceptions instead of return codes.

Parameters
Expand All @@ -58,8 +60,12 @@ def check_nvvm_compiler_options(options: Sequence[str]) -> bool:
raise

from cuda.bindings._internal.nvvm import _inspect_function_pointer
from cuda.pathfinder import DynamicLibNotFoundError

if _inspect_function_pointer("__nvvmCreateProgram") == 0:
try:
if _inspect_function_pointer("__nvvmCreateProgram") == 0:
return False
except DynamicLibNotFoundError:
return False

program = nvvm.create_program()
Expand Down
14 changes: 14 additions & 0 deletions cuda_bindings_13/docs/source/release/13.6.0-notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0

.. module:: cuda.bindings

``cuda-bindings`` 13.6.0 Release notes
======================================

Behavior changes
----------------

- ``cuda.bindings.utils.check_nvvm_compiler_options()`` now returns ``False`` when libNVVM
cannot be found. Previously it raised ``cuda.pathfinder.DynamicLibNotFoundError``.
(`Issue #3565 <https://github.com/NVIDIA/cuda-python/issues/3565>`_)
27 changes: 23 additions & 4 deletions cuda_bindings_13/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from pathlib import Path

import pytest
from cuda_python_test_helpers.subprocess_runner import run_python_snippet

from cuda.bindings import driver, runtime
from cuda.bindings._internal.utils import get_c_compiler
Expand Down Expand Up @@ -197,8 +198,26 @@ def test_check_nvvm_compiler_options_arch_detection():
assert check_nvvm_compiler_options(["-arch=compute_99999"]) is False


# This test is not currently run in any CI job
@pytest.mark.agent_authored(model="claude-opus-5-5")
def test_check_nvvm_compiler_options_no_libnvvm():
if _libnvvm_available:
pytest.skip("libNVVM is available; this test targets the fallback path")
assert check_nvvm_compiler_options(["-arch=compute_90"]) is False
# The NVVM function table is process-global and filled in only once, so
# simulate a missing libNVVM in a fresh interpreter.
result = run_python_snippet(
"""
import cuda.bindings._internal.nvvm as nvvm_internal
from cuda.bindings.utils import check_nvvm_compiler_options
from cuda.pathfinder import DynamicLibNotFoundError

calls = []


def load_nvidia_dynamic_lib(libname):
calls.append(libname)
raise DynamicLibNotFoundError(f"simulated: {libname} not found")


nvvm_internal.load_nvidia_dynamic_lib = load_nvidia_dynamic_lib
print(check_nvvm_compiler_options(["-arch=compute_90"]), calls)
"""
)
assert result.stdout.strip() == "False ['nvvm']"
16 changes: 16 additions & 0 deletions cuda_python/docs/source/release/13.6.0-notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0

CUDA Python 13.6.0 Release notes
=================================

Highlights
----------

* ``cuda-python`` 13.6.0 pulls in ``cuda-bindings`` 13.6.0. See the
``cuda-bindings`` 13.6.0 release notes for its changes.

Known issues
------------

* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``.
Loading