Skip to content

[no-ci] cuda.bindings: import the CUDA 12 maintenance source on main - #3172

Merged
rwgk merged 3 commits into
mainfrom
rwgk/cb12-on-main-01-source-import
Oct 21, 2026
Merged

rwgk merged 3 commits into
mainfrom
rwgk/cb12-on-main-01-source-import

Conversation

@rwgk

@rwgk rwgk commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Import the CUDA 12 maintenance sources into cuda_bindings_12/ on main, as the first step in rebuilding #2737 as a reviewable stack. The CUDA 13 source-root rename has landed in #3147.

The imported directory is byte-for-byte identical to cuda_bindings/ at 12.9.x commit ca0f150. It includes the 12.9.10 release notes and host-function graph replay fix. This PR does not register, build, test, or release the copied package. Later layers add that integration.

A temporary three-line pre-commit exclusion keeps this inactive historical source untouched by repository hooks. A temporary exclusion in the independent Bandit/Ruff security scan also skips cuda_bindings_12/, whose tests retain historical security annotations. The integration layer (#3173) removes both exclusions, adapts those annotations, and adds the relevant per-root checks.

Stack / Review Boundary

Layer 1 of 7. Next: #3173. All layers and integrated validation.

The seven PRs are review boundaries for one change. Only the top PR, #3178, is fully integrated and is the full-CI target.

Validation

  • All 215 imported entries reproduce source tree e45c075053f8cab4c6f77e9585134f66c10cc5a9 exactly, including file modes and the archival symlink.
  • All 62 existing generated-file seals are valid.
  • Full pre-commit run --all-files --show-diff-on-failure passed.
  • Independent Bandit/Ruff security scan (Ruff 0.17.1) passed with only the inactive CUDA 12 directory excluded.

Native CUDA 12 validation belongs to the layers that enable this source tree.

Checklist

  • Existing checks cover the active repository; imported source identity and seals were checked separately.
  • The description explains the deliberately inactive intermediate state.

rwgk added 2 commits October 20, 2026 21:24
Copy cuda_bindings from NVIDIA/cuda-python:12.9.x at ca0f150 into cuda_bindings_12 without modifying the source tree. Package registration and build/test integration follow in later layers.

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@rwgk rwgk added this to the cuda.bindings next milestone Oct 21, 2026
@rwgk rwgk added enhancement Any code-related improvements CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module labels Oct 21, 2026
@copy-pr-bot

copy-pr-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@rwgk rwgk changed the title cuda.bindings: import the CUDA 12 maintenance source on main [no-ci] cuda.bindings: import the CUDA 12 maintenance source on main Oct 21, 2026
@rwgk
rwgk marked this pull request as ready for review October 21, 2026 13:44
@rwgk

rwgk commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @mdboom!

I tweaked the PR Description slightly, but didn't change the source tree after your approval.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/cuda-python/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 3dddf63e-72da-4389-ad89-762dfd2e8df8
📥 Commits

Reviewing files that changed from the base of the PR and between 36807f7 and 290382e.

📒 Files selected for processing: 1
  • .github/workflows/bandit.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features
    • Added CUDA 12 bindings for Driver, Runtime, NVRTC, NVVM, nvJitLink, nvFatbin, NVML, and cuFile APIs.
    • Added PTX utilities, native handle access, installation support, examples, and performance benchmarks.
  • Documentation
    • Added API, installation, configuration, support, contribution, and versioned release documentation.
  • Deprecations
    • Legacy CUDA module paths now issue warnings and direct users to cuda.bindings.
  • Tests
    • Added broad coverage for CUDA APIs, interoperability, NVML, compilation, utilities, and benchmarks.

Changes

CUDA 12 bindings package

Layer / File(s) Summary
Package and build integration
.pre-commit-config.yaml, cuda_bindings_12/build_hooks.py, cuda_bindings_12/pyproject.toml, cuda_bindings_12/setup.py, cuda_bindings_12/site-packages/*
Adds package metadata, CUDA header parsing, generated-source preparation, platform-specific extension builds, editable-wheel support, and the import redirector.
Core CUDA and library bindings
cuda_bindings_12/cuda/bindings/**, cuda_bindings_12/cuda/*.pyx
Adds generated Driver, Runtime, cuFile, NVRTC, NVVM, nvJitLink, nvFatbin, and NVML interfaces, including dynamic symbol loading and deprecated compatibility modules.
Examples, benchmarks, and tests
cuda_bindings_12/examples/**, cuda_bindings_12/benchmarks/**, cuda_bindings_12/tests/**
Adds CUDA examples, launch and pointer benchmarks, Cython interoperability tests, API tests, NVML tests, compiler tests, and utility tests.
Documentation and release records
cuda_bindings_12/docs/**, cuda_bindings_12/README.md, cuda_bindings_12/DESCRIPTION.rst
Adds installation, API, module, build, support, version-selection, overview, and historical release documentation.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 29038

The CUDA 12 copy is not yet part of the normal build or release path, so this import is mergeable with follow-up. Its documentation, examples, and some tests need correction before the copied package is integrated.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 8


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/cuda-python/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 206b6681-73fc-41f4-848f-c1a1a32b6e3f
📥 Commits

Reviewing files that changed from the base of the PR and between efd58e4 and 36807f7.

⛔ Files ignored due to path filters: 3
  • cuda_bindings_12/docs/source/_static/images/Nsight-Compute-CLI-625x473.png is excluded by !**/*.png
  • cuda_bindings_12/docs/source/_static/logo-dark-mode.png is excluded by !**/*.png
  • cuda_bindings_12/docs/source/_static/logo-light-mode.png is excluded by !**/*.png
📒 Files selected for processing: 213
  • .pre-commit-config.yaml
  • cuda_bindings_12/.git_archival.txt
  • cuda_bindings_12/DESCRIPTION.rst
  • cuda_bindings_12/LICENSE
  • cuda_bindings_12/MANIFEST.in
  • cuda_bindings_12/README.md
  • cuda_bindings_12/benchmarks/conftest.py
  • cuda_bindings_12/benchmarks/kernels.py
  • cuda_bindings_12/benchmarks/pytest.ini
  • cuda_bindings_12/benchmarks/test_cupy.py
  • cuda_bindings_12/benchmarks/test_launch_latency.py
  • cuda_bindings_12/benchmarks/test_numba.py
  • cuda_bindings_12/benchmarks/test_pointer_attributes.py
  • cuda_bindings_12/build_hooks.py
  • cuda_bindings_12/cuda/bindings/__init__.pxd
  • cuda_bindings_12/cuda/bindings/__init__.py
  • cuda_bindings_12/cuda/bindings/_bindings/__init__.py
  • cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pxd.in
  • cuda_bindings_12/cuda/bindings/_bindings/cyruntime.pyx.in
  • cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pxd.in
  • cuda_bindings_12/cuda/bindings/_bindings/cyruntime_ptds.pyx.in
  • cuda_bindings_12/cuda/bindings/_internal/__init__.py
  • cuda_bindings_12/cuda/bindings/_internal/_fast_enum.py
  • cuda_bindings_12/cuda/bindings/_internal/cufile.pxd
  • cuda_bindings_12/cuda/bindings/_internal/cufile_linux.pyx
  • cuda_bindings_12/cuda/bindings/_internal/driver.pxd
  • cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx
  • cuda_bindings_12/cuda/bindings/_internal/driver_windows.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvfatbin.pxd
  • cuda_bindings_12/cuda/bindings/_internal/nvfatbin_linux.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvfatbin_windows.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvjitlink.pxd
  • cuda_bindings_12/cuda/bindings/_internal/nvjitlink_linux.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvjitlink_windows.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvml.pxd
  • cuda_bindings_12/cuda/bindings/_internal/nvml_linux.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvml_windows.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvrtc.pxd
  • cuda_bindings_12/cuda/bindings/_internal/nvrtc_linux.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvrtc_windows.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvvm.pxd
  • cuda_bindings_12/cuda/bindings/_internal/nvvm_linux.pyx
  • cuda_bindings_12/cuda/bindings/_internal/nvvm_windows.pyx
  • cuda_bindings_12/cuda/bindings/_internal/utils.pxd
  • cuda_bindings_12/cuda/bindings/_internal/utils.pyx
  • cuda_bindings_12/cuda/bindings/_lib/__init__.py
  • cuda_bindings_12/cuda/bindings/_lib/cyruntime/__init__.py
  • cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxd
  • cuda_bindings_12/cuda/bindings/_lib/cyruntime/cyruntime.pxi
  • cuda_bindings_12/cuda/bindings/_lib/dlfcn.pxd
  • cuda_bindings_12/cuda/bindings/_lib/utils.pxd
  • cuda_bindings_12/cuda/bindings/_lib/utils.pxi
  • cuda_bindings_12/cuda/bindings/_lib/windll.pxd
  • cuda_bindings_12/cuda/bindings/_test_helpers/__init__.py
  • cuda_bindings_12/cuda/bindings/_test_helpers/arch_check.py
  • cuda_bindings_12/cuda/bindings/cufile.pxd
  • cuda_bindings_12/cuda/bindings/cufile.pyx
  • cuda_bindings_12/cuda/bindings/cycufile.pxd
  • cuda_bindings_12/cuda/bindings/cycufile.pyx
  • cuda_bindings_12/cuda/bindings/cydriver.pxd
  • cuda_bindings_12/cuda/bindings/cydriver.pyx
  • cuda_bindings_12/cuda/bindings/cynvfatbin.pxd
  • cuda_bindings_12/cuda/bindings/cynvfatbin.pyx
  • cuda_bindings_12/cuda/bindings/cynvjitlink.pxd
  • cuda_bindings_12/cuda/bindings/cynvjitlink.pyx
  • cuda_bindings_12/cuda/bindings/cynvml.pxd
  • cuda_bindings_12/cuda/bindings/cynvml.pyx
  • cuda_bindings_12/cuda/bindings/cynvrtc.pxd
  • cuda_bindings_12/cuda/bindings/cynvrtc.pyx
  • cuda_bindings_12/cuda/bindings/cynvvm.pxd
  • cuda_bindings_12/cuda/bindings/cynvvm.pyx
  • cuda_bindings_12/cuda/bindings/cyruntime.pxd.in
  • cuda_bindings_12/cuda/bindings/cyruntime.pyx.in
  • cuda_bindings_12/cuda/bindings/cyruntime_functions.pxi.in
  • cuda_bindings_12/cuda/bindings/cyruntime_types.pxi.in
  • cuda_bindings_12/cuda/bindings/driver.pxd
  • cuda_bindings_12/cuda/bindings/driver.pyx
  • cuda_bindings_12/cuda/bindings/nvfatbin.pxd
  • cuda_bindings_12/cuda/bindings/nvfatbin.pyx
  • cuda_bindings_12/cuda/bindings/nvjitlink.pxd
  • cuda_bindings_12/cuda/bindings/nvjitlink.pyx
  • cuda_bindings_12/cuda/bindings/nvml.pxd
  • cuda_bindings_12/cuda/bindings/nvml.pyx
  • cuda_bindings_12/cuda/bindings/nvrtc.pxd
  • cuda_bindings_12/cuda/bindings/nvrtc.pyx
  • cuda_bindings_12/cuda/bindings/nvvm.pxd
  • cuda_bindings_12/cuda/bindings/nvvm.pyx
  • cuda_bindings_12/cuda/bindings/runtime.pxd.in
  • cuda_bindings_12/cuda/bindings/runtime.pyx.in
  • cuda_bindings_12/cuda/bindings/utils/__init__.py
  • cuda_bindings_12/cuda/bindings/utils/_ptx_utils.py
  • cuda_bindings_12/cuda/ccuda.pxd
  • cuda_bindings_12/cuda/ccuda.pyx
  • cuda_bindings_12/cuda/ccudart.pxd
  • cuda_bindings_12/cuda/ccudart.pyx
  • cuda_bindings_12/cuda/cnvrtc.pxd
  • cuda_bindings_12/cuda/cnvrtc.pyx
  • cuda_bindings_12/cuda/cuda.pyx
  • cuda_bindings_12/cuda/cudart.pyx
  • cuda_bindings_12/cuda/nvrtc.pyx
  • cuda_bindings_12/docs/Makefile
  • cuda_bindings_12/docs/README.md
  • cuda_bindings_12/docs/build_docs.sh
  • cuda_bindings_12/docs/make.bat
  • cuda_bindings_12/docs/source/_static/javascripts/version_dropdown.js
  • cuda_bindings_12/docs/source/_templates/main.html
  • cuda_bindings_12/docs/source/_templates/sidebar/variant-selector.html
  • cuda_bindings_12/docs/source/api.rst
  • cuda_bindings_12/docs/source/conduct.md
  • cuda_bindings_12/docs/source/conf.py
  • cuda_bindings_12/docs/source/contribute.md
  • cuda_bindings_12/docs/source/environment_variables.md
  • cuda_bindings_12/docs/source/index.rst
  • cuda_bindings_12/docs/source/install.md
  • cuda_bindings_12/docs/source/license.rst
  • cuda_bindings_12/docs/source/module/cufile.rst
  • cuda_bindings_12/docs/source/module/driver.rst
  • cuda_bindings_12/docs/source/module/nvfatbin.rst
  • cuda_bindings_12/docs/source/module/nvjitlink.rst
  • cuda_bindings_12/docs/source/module/nvrtc.rst
  • cuda_bindings_12/docs/source/module/nvvm.rst
  • cuda_bindings_12/docs/source/module/runtime.rst
  • cuda_bindings_12/docs/source/module/utils.rst
  • cuda_bindings_12/docs/source/motivation.md
  • cuda_bindings_12/docs/source/overview.md
  • cuda_bindings_12/docs/source/release.rst
  • cuda_bindings_12/docs/source/release/11.4.0-notes.md
  • cuda_bindings_12/docs/source/release/11.5.0-notes.md
  • cuda_bindings_12/docs/source/release/11.6.0-notes.md
  • cuda_bindings_12/docs/source/release/11.6.1-notes.md
  • cuda_bindings_12/docs/source/release/11.7.0-notes.md
  • cuda_bindings_12/docs/source/release/11.7.1-notes.md
  • cuda_bindings_12/docs/source/release/11.8.0-notes.md
  • cuda_bindings_12/docs/source/release/11.8.1-notes.md
  • cuda_bindings_12/docs/source/release/11.8.2-notes.md
  • cuda_bindings_12/docs/source/release/11.8.3-notes.md
  • cuda_bindings_12/docs/source/release/11.8.4-notes.md
  • cuda_bindings_12/docs/source/release/11.8.5-notes.md
  • cuda_bindings_12/docs/source/release/11.8.6-notes.md
  • cuda_bindings_12/docs/source/release/11.8.7-notes.rst
  • cuda_bindings_12/docs/source/release/12.0.0-notes.md
  • cuda_bindings_12/docs/source/release/12.1.0-notes.md
  • cuda_bindings_12/docs/source/release/12.2.0-notes.md
  • cuda_bindings_12/docs/source/release/12.2.1-notes.md
  • cuda_bindings_12/docs/source/release/12.3.0-notes.md
  • cuda_bindings_12/docs/source/release/12.4.0-notes.md
  • cuda_bindings_12/docs/source/release/12.5.0-notes.md
  • cuda_bindings_12/docs/source/release/12.6.0-notes.md
  • cuda_bindings_12/docs/source/release/12.6.1-notes.md
  • cuda_bindings_12/docs/source/release/12.6.2-notes.md
  • cuda_bindings_12/docs/source/release/12.8.0-notes.md
  • cuda_bindings_12/docs/source/release/12.9.0-notes.rst
  • cuda_bindings_12/docs/source/release/12.9.10-notes.rst
  • cuda_bindings_12/docs/source/release/12.9.8-notes.rst
  • cuda_bindings_12/docs/source/release/12.9.9-notes.rst
  • cuda_bindings_12/docs/source/release/12.X.Y-notes.rst
  • cuda_bindings_12/docs/source/support.rst
  • cuda_bindings_12/docs/source/tips_and_tricks.rst
  • cuda_bindings_12/docs/versions.json
  • cuda_bindings_12/examples/0_Introduction/clock_nvrtc_test.py
  • cuda_bindings_12/examples/0_Introduction/simpleCubemapTexture_test.py
  • cuda_bindings_12/examples/0_Introduction/simpleP2P_test.py
  • cuda_bindings_12/examples/0_Introduction/simpleZeroCopy_test.py
  • cuda_bindings_12/examples/0_Introduction/systemWideAtomics_test.py
  • cuda_bindings_12/examples/0_Introduction/vectorAddDrv_test.py
  • cuda_bindings_12/examples/0_Introduction/vectorAddMMAP_test.py
  • cuda_bindings_12/examples/2_Concepts_and_Techniques/streamOrderedAllocation_test.py
  • cuda_bindings_12/examples/3_CUDA_Features/globalToShmemAsyncCopy_test.py
  • cuda_bindings_12/examples/3_CUDA_Features/simpleCudaGraphs_test.py
  • cuda_bindings_12/examples/4_CUDA_Libraries/conjugateGradientMultiBlockCG_test.py
  • cuda_bindings_12/examples/common/common.py
  • cuda_bindings_12/examples/common/helper_cuda.py
  • cuda_bindings_12/examples/common/helper_string.py
  • cuda_bindings_12/examples/extra/isoFDModelling_test.py
  • cuda_bindings_12/examples/extra/jit_program_test.py
  • cuda_bindings_12/examples/extra/numba_emm_plugin.py
  • cuda_bindings_12/examples/pytest.ini
  • cuda_bindings_12/pyproject.toml
  • cuda_bindings_12/setup.py
  • cuda_bindings_12/site-packages/_cuda_bindings_redirector.pth
  • cuda_bindings_12/site-packages/_cuda_bindings_redirector.py
  • cuda_bindings_12/tests/cufile.json
  • cuda_bindings_12/tests/cython/build_tests.bat
  • cuda_bindings_12/tests/cython/build_tests.sh
  • cuda_bindings_12/tests/cython/test_ccuda.pyx
  • cuda_bindings_12/tests/cython/test_ccudart.pyx
  • cuda_bindings_12/tests/cython/test_cython.py
  • cuda_bindings_12/tests/cython/test_interoperability_cython.pyx
  • cuda_bindings_12/tests/nvml/README.md
  • cuda_bindings_12/tests/nvml/__init__.py
  • cuda_bindings_12/tests/nvml/conftest.py
  • cuda_bindings_12/tests/nvml/test_compute_mode.py
  • cuda_bindings_12/tests/nvml/test_cuda.py
  • cuda_bindings_12/tests/nvml/test_device.py
  • cuda_bindings_12/tests/nvml/test_gpu.py
  • cuda_bindings_12/tests/nvml/test_init.py
  • cuda_bindings_12/tests/nvml/test_nvlink.py
  • cuda_bindings_12/tests/nvml/test_page_retirement.py
  • cuda_bindings_12/tests/nvml/test_pynvml.py
  • cuda_bindings_12/tests/nvml/util.py
  • cuda_bindings_12/tests/pytest.ini
  • cuda_bindings_12/tests/test_cuda.py
  • cuda_bindings_12/tests/test_cudart.py
  • cuda_bindings_12/tests/test_cufile.py
  • cuda_bindings_12/tests/test_graphics_apis.py
  • cuda_bindings_12/tests/test_interoperability.py
  • cuda_bindings_12/tests/test_kernelParams.py
  • cuda_bindings_12/tests/test_nvfatbin.py
  • cuda_bindings_12/tests/test_nvjitlink.py
  • cuda_bindings_12/tests/test_nvrtc.py
  • cuda_bindings_12/tests/test_nvvm.py
  • cuda_bindings_12/tests/test_utils.py
  • cuda_bindings_12/tests/utils/check_cyclical_import.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Comment on lines +43 to +46
if [[ $LATEST_ONLY == "0" ]]; then
cp -r build/html/${SPHINX_CUDA_BINDINGS_VER} build/html/latest
else
mv build/html/${SPHINX_CUDA_BINDINGS_VER} build/html/latest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

important: Replace latest before publishing a new build.

If build/html/latest already exists, cp -r or mv places the versioned directory inside latest. The previous documentation remains at latest/, even though the build completes. Remove or replace the existing destination before either operation.


ddElement.appendChild(aElement);
// Attach event listeners to version links
ddElement.addEventListener('click', change_current_version);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

important: Handle clicks on the version link, not its container.

The listener runs when a user clicks the <dd> or its <strong> wrapper. In those cases, event.target.href is undefined, and change_current_version navigates away from the selected documentation. Attach the listener to aElement before wrapping it, and read event.currentTarget in the handler. (developer.mozilla.org)

author = "NVIDIA"

# The full version, including alpha/beta/rc tags
release = os.environ["SPHINX_CUDA_BINDINGS_VER"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

important: Allow the direct Sphinx entrypoints to determine the version.

make html and make.bat html do not set SPHINX_CUDA_BINDINGS_VER. Sphinx loads this configuration for either command, so the direct build stops with KeyError unless the caller sets the variable manually. Derive a default release here, or set the variable in both entrypoints. The documented build_docs.sh path already sets it. (sphinx-doc.org)

`cuda.bindings` supports the same platforms as CUDA. Runtime dependencies are:

* Linux (x86-64, arm64) and Windows (x86-64)
* Python 3.9 - 3.13

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

important: Update the Python support range for this release.

This page says support ends at Python 3.13, but docs/source/release/12.9.10-notes.rst says the imported release ships Python 3.15 wheels. Update this range and the matching statement in docs/source/support.rst so users do not rule out a supported installation.

:maxdepth: 3

12.X.Y <release/12.X.Y-notes.rst>
12.9.0 <release/12.9.0-notes.rst>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

important: Include the imported maintenance releases in documentation navigation.

The release-note files for 12.9.8, 12.9.9, and 12.9.10 exist, but this toctree stops at 12.9.0. Readers cannot reach those notes through the release page. Add the entries here and update docs/versions.json when publishing their versioned documentation.

Comment on lines +7 to +15
def checkCmdLineFlag(stringRef):
return any(stringRef == i and k < len(sys.argv) - 1 for i, k in enumerate(sys.argv))


def getCmdLineArgumentInt(stringRef):
for i, k in enumerate(sys.argv):
if stringRef == i and k < len(sys.argv) - 1:
return sys.argv[k + 1]
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

suggestion: enumerate(sys.argv) yields (index, value). Both helpers bind the index to i and the argument string to k. As a result, stringRef == i compares a string to an int, and k < len(sys.argv) - 1 compares a string to an int. checkCmdLineFlag therefore always returns False. The device=, wA=, kernel=, and help options in the examples are silently ignored. This file is a byte-identical import, so apply the fix in the integration layer or upstream, for example for k, i in enumerate(sys.argv).

Comment on lines +107 to +111
@pytest.fixture
def mig_handles(nmigs):
handles = [nvml.device_get_mig_device_handle_by_index(i) for i in range(nmigs)]
assert len(handles) == nmigs
return handles

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C3 'def device_get_mig_device_handle_by_index\s*\(' cuda_bindings_12/cuda/bindings

Repository: NVIDIA/cuda-python

Length of output: 156


🏁 Script executed:

set -eu
printf '%s\n' '--- changed fixture and nearby tests ---'
nl -ba cuda_bindings_12/tests/nvml/conftest.py | sed -n '1,145p'
rg -n -F -- 'device_get_mig_device_handle_by_index' cuda_bindings_12 cuda_bindings tests || test "$?" -eq 1
printf '%s\n' '--- candidate NVML declarations ---'
rg -n -F -- 'MigDeviceHandleByIndex' cuda_bindings_12 cuda_bindings tests || test "$?" -eq 1
printf '%s\n' '--- test_device_get_attributes references ---'
rg -n -C4 -F -- 'test_device_get_attributes' cuda_bindings_12/tests cuda_bindings/tests || test "$?" -eq 1

Repository: NVIDIA/cuda-python

Length of output: 5205


🏁 Script executed:

set -eu
printf '%s\n' '--- resolved binding implementation ---'
nl -ba cuda_bindings_12/cuda/bindings/nvml.pyx | sed -n '35735,35765p'
printf '%s\n' '--- mig_handles consumers ---'
rg -n -C5 -F -- 'mig_handles' cuda_bindings_12/tests
printf '%s\n' '--- test_device_get_attributes ---'
rg -n -C8 -F -- 'test_device_get_attributes' cuda_bindings_12/tests || test "$?" -eq 1
printf '%s\n' '--- NVML test files ---'
find cuda_bindings_12/tests/nvml -maxdepth 2 -type f -print | sort

Repository: NVIDIA/cuda-python

Length of output: 5362


🏁 Script executed:

set -eu
printf '%s\n' '--- PR file changes ---'
git diff --name-status efd58e498da894a5f823927268bd307abc7b3120 36807f72b60c03335cd8d14507044e4d8b3c6c64
printf '%s\n' '--- references outside imported tree ---'
rg -n -F --glob '!cuda_bindings_12/**' -- 'cuda_bindings_12' . || test "$?" -eq 1
printf '%s\n' '--- build and hook configuration files ---'
find . -maxdepth 2 -type f \( -name 'pyproject.toml' -o -name 'setup.py' -o -name 'setup.cfg' -o -name 'pre-commit-config.yaml' \) -print
printf '%s\n' '--- configuration references ---'
rg -n -C3 -F -- 'cuda_bindings' pyproject.toml setup.py setup.cfg pre-commit-config.yaml 2>/dev/null || test "$?" -eq 1

Repository: NVIDIA/cuda-python

Length of output: 11405


important: When this tree is integrated, pass the parent device handle to nvml.device_get_mig_device_handle_by_index. Make mig_handles depend on handles, use handles[0], and handle nvml.NvmlError for unpopulated MIG slots. The current call omits the required device argument and raises TypeError whenever nmigs > 0, before test_device_get_attributes can run.

Comment on lines +39 to +40
def supportsCudaAPI(name):
return name in dir(cuda) or dir(cudart)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

suggestion: name in dir(cuda) or dir(cudart) parses as (name in dir(cuda)) or dir(cudart). The non-empty list makes the expression always truthy. As a result, the cudaGraphConditionalHandleCreate guard on test_cudart_conditional has no effect. This copy must stay byte-identical, so apply the fix in the integration layer or upstream: return name in dir(cuda) or name in dir(cudart).

Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
@rwgk

rwgk commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@mdboom I had to add one tiny commit to exclude the cuda_bindings_12/ tree from the security scan:

290382e

This is documented in the updated PR description. That exclusion is removed again in the next layer (#3173).

@rwgk

rwgk commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

I'm deliberately ignoring all CodeRabbit findings: all findings are for files under the cuda_bindings_12/ tree, which we want to keep byte-for-byte identical to what's on the 12.9.x branch in this layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure cuda.bindings Everything related to the cuda.bindings module enhancement Any code-related improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants