Skip to content

cuda.bindings: backport CUDA 12 runtime maintenance fixes - #3182

Draft
rwgk wants to merge 5 commits into
rwgk/cb12-on-main-07-maintenance-policyfrom
rwgk/cb12-on-main-08-runtime-maintenance
Draft

rwgk wants to merge 5 commits into
rwgk/cb12-on-main-07-maintenance-policyfrom
rwgk/cb12-on-main-08-runtime-maintenance

Conversation

@rwgk

@rwgk rwgk commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

— codex GPT-6 on behalf of Ralf —

Layer 8 of 8. Previous: #3178. Functionally independent of the CI layers; stacked only for ordering. Stack map at the bottom.

These fixes are also isolated in #3355 (12.9.x) and #3356 (main). They remain in this stack until #3356 lands; rebasing afterward will remove the duplicate runtime changes from this layer.

What this PR does

Ports three helper fixes that CUDA 13 already has to the CUDA 12 runtime, with their tests. The diff is +48/-4 across 8 files, including a one-line CI workaround: the existing Core pool-trim test runs serially for the known driver synchronization issue #3350. All test cases remain enabled.

Fix CUDA 13 origin Test here
Accept bytes as well as str compiler options in the nested-resource helper #1665, #1698 nvJitLink bytes-options test; NVVM parameterized case
Keep borrowed coredump setter buffers alive; free getter-owned storage in __dealloc__ #2399 existing coredump API tests (no instrumented leak test)
Propagate exceptions raised inside a registered handle getter instead of reporting "unknown type" #2551 regression: an internal KeyError propagates

Where to look

Validation
Stack map: review scopes and merge units
Layer PR Scope Merge unit
1 #3172 import cuda_bindings_12/, byte-identical to the 12.9.x branch merged
2 #3173 integrate the import with the shared build tooling merged
3 #3174 registry, packaging, version selectors, developer environment, guidance group: #3174 + #3175 + #3176 land together
4 #3175 build both majors from main; planner; version preview bootstrap group
5 #3176 test, document, nightly, coverage; first CI-complete state group
6 #3177 releases driven by the tagged source's configuration after the group
7 #3178 maintenance policy, manual backport workflow, retire backport_branch after #3177
8 #3182 three CUDA 12 runtime fixes independent of the CI layers; stacked only for ordering

Layers 3 to 5 are review boundaries, not working intermediate states: #3174 alone breaks CI (workflows still read the removed cuda.build.version), and #3175 alone fails actionlint (callers pass an input the test workflows only accept in #3176). The plan is to review them separately and land the reviewed group as one merge. #3176 is the full-CI target for the group.

The staged stack #3314-#3322 is the alternative in which every layer is mergeable on its own; both stacks reach the same end state, except that the staged stack keeps compatibility routes for older artifact sources and retained CUDA 13 tags.

@rwgk rwgk added this to the cuda.bindings next milestone Oct 21, 2026
@rwgk rwgk added bug Something isn't working cuda.bindings Everything related to the cuda.bindings module labels Oct 21, 2026
@rwgk rwgk self-assigned this 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 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7856417

@github-actions

Copy link
Copy Markdown
Contributor

@mdboom
mdboom force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from 7856417 to b01e4ad Compare October 23, 2026 15:04
@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch 2 times, most recently from cc44420 to 4f6212a Compare October 26, 2026 00:20
@rwgk

rwgk commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4f6212a

@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from 775392e to 341d286 Compare October 30, 2026 03:20
@rwgk

rwgk commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 341d286

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between e2a6f30 and 0b5dbe3.

Files selected for processing: 7
  • cuda_bindings_12/cuda/bindings/_internal/utils.pyx
  • cuda_bindings_12/cuda/bindings/_lib/utils.pxd
  • cuda_bindings_12/cuda/bindings/_lib/utils.pxi
  • cuda_bindings_12/cuda/bindings/utils/__init__.py
  • cuda_bindings_12/tests/test_nvjitlink.py
  • cuda_bindings_12/tests/test_nvvm.py
  • cuda_bindings_12/tests/test_utils.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.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • CUDA options supplied as bytes are now handled correctly, including architecture and NVVM compiler options.
    • Nested character values accept only strings or bytes; strings are encoded as UTF-8, while unsupported types raise a TypeError identifying the received type.
    • Errors raised by a registered CUDA handle getter now propagate instead of being reported as an unknown type.

Nested character resources now accept strings and bytes. The cuCoredumpSettings helper retains borrowed setter buffers. get_cuda_native_handle now allows KeyError from a registered getter to propagate.

Changes: CUDA bindings runtime fixes

Layer / File(s) Summary
Nested character values
cuda_bindings_12/cuda/bindings/_internal/utils.pyx, cuda_bindings_12/tests/test_nvjitlink.py, cuda_bindings_12/tests/test_nvvm.py
Nested char elements accept exact str or bytes values. Strings are UTF-8 encoded, while bytes are passed unchanged. Tests cover byte-string options for nvJitLink and NVVM.
cuCoredumpSettings buffer lifetime
cuda_bindings_12/cuda/bindings/_lib/utils.pxd, cuda_bindings_12/cuda/bindings/_lib/utils.pxi
The helper retains init_value for setter-side file and pipe settings. Its destructor frees _charstar only for getters.
Native handle getter errors
cuda_bindings_12/cuda/bindings/utils/__init__.py, cuda_bindings_12/tests/test_utils.py
A missing registered getter still raises TypeError. A KeyError raised by a registered getter now propagates. The test checks the propagated error message.

Possibly related PRs

  • NVIDIA/cuda-python#3173: Integrates the CUDA 12 source tree with shared build and test tooling; its scope defers runtime backports to this PR.

Suggested reviewers: mdboom, juenglin

Change: Bug fix

Merge Risk: Minimal · up to 0b5db

No merge-blocking issue was identified in the runtime maintenance changes.

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

@rwgk
rwgk marked this pull request as draft November 4, 2026 05:36
@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from 0b5dbe3 to 1273e61 Compare November 4, 2026 06:18
rwgk added 4 commits November 3, 2026 22:26
Carry forward the runtime behavior from #1665/#1698 with its nvJitLink regression and NVVM bytes-options case. Extracted from #3173 so source integration can be reviewed independently.

Signed-off-by: Ralf W. Grosse-Kunstleve <[email protected]>
Carry forward #2399: retain borrowed setter bytes and release getter-owned storage. Keep this runtime maintenance separate from the build integration.

Signed-off-by: Ralf W. Grosse-Kunstleve <[email protected]>
Carry forward #2551 and its regression test. A KeyError inside a registered getter must propagate instead of being reported as an unknown handle type.

Signed-off-by: Ralf W. Grosse-Kunstleve <[email protected]>
Signed-off-by: Ralf W. Grosse-Kunstleve <[email protected]>
@rwgk
rwgk force-pushed the rwgk/cb12-on-main-08-runtime-maintenance branch from 1273e61 to 63e4d8c Compare November 4, 2026 06:32
Refs: #3350. Preserve every parameter and assertion; only concurrent execution is disabled for this affected test.
Signed-off-by: Ralf W. Grosse-Kunstleve <[email protected]>
@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Nov 4, 2026

This branch has not been deployed

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

Labels

bug Something isn't working cuda.bindings Everything related to the cuda.bindings module cuda.core Everything related to the cuda.core module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant