Skip to content

[no-ci] fix(bindings): apply CUDA 12 utility runtime fixes on main - #3356

Open
rwgk wants to merge 1 commit into
mainfrom
rwgk/cb12-runtime-fixes-main
Open

rwgk wants to merge 1 commit into
mainfrom
rwgk/cb12-runtime-fixes-main

Conversation

@rwgk

@rwgk rwgk commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

— codex GPT-6 on behalf of Ralf —

Description

Apply the CUDA 12 utility fixes from #3355 to the source copy already on main: bytes options, coredump buffer ownership, and registered-getter error propagation. Includes the same regression coverage and release notes.

All changes are under cuda_bindings_12/. Landing this separately lets both migration alternatives inherit the reviewed fixes.

Validation

Fresh CUDA 12.9 build; 94 focused tests and full pre-commit passed. Matching CI on #3355 passed all 58 jobs, including the GPU regression paths.

Checklist

  • I have read the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Nov 4, 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.

@github-actions github-actions Bot added the cuda.bindings Everything related to the cuda.bindings module label Nov 4, 2026
@rwgk rwgk added the bug Something isn't working label Nov 4, 2026
@rwgk rwgk self-assigned this Nov 4, 2026
@rwgk rwgk added this to the cuda.bindings next milestone Nov 4, 2026
@rwgk
rwgk marked this pull request as ready for review November 4, 2026 07:41
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Nested resource options now accept both text strings and byte strings, with text consistently encoded as UTF-8. Unsupported value types produce a clearer error.
    • Coredump settings now keep provided string data available during calls and release getter buffers appropriately.
    • Errors raised by registered native-handle getters now propagate as-is instead of being reported as an unknown type.

The pull request changes nested character-option conversion, coredump buffer ownership, and native-handle getter error handling. It adds regression coverage and release notes for these fixes.

Changes: Nested char options

Layer / File(s) Summary
Convert nested char options
cuda_bindings_12/cuda/bindings/_internal/utils.pyx, cuda_bindings_12/tests/test_nvjitlink.py, cuda_bindings_12/tests/test_nvvm.py, cuda_bindings_12/docs/source/release/12.X.Y-notes.rst
Nested char elements now encode str values as UTF-8, accept bytes unchanged, and raise TypeError for other types. NVJitLink and NVVM tests cover byte-string options. The release notes describe the change.

Coredump buffer ownership

Layer / File(s) Summary
Manage coredump buffers
cuda_bindings_12/cuda/bindings/_lib/utils.pxd, cuda_bindings_12/cuda/bindings/_lib/utils.pxi
The helper retains setter-provided file or pipe values. It frees _charstar during deallocation only for getters.

Native-handle getter errors

Layer / File(s) Summary
Preserve getter errors
cuda_bindings_12/cuda/bindings/utils/__init__.py, cuda_bindings_12/tests/test_utils.py
get_cuda_native_handle now catches KeyError during getter lookup only. A KeyError raised by a registered getter propagates, as covered by a regression test.

Possibly related PRs

  • NVIDIA/cuda-python#3182: Implements the same three utility fixes and supporting tests and release notes for the CUDA 12 source tree.
  • NVIDIA/cuda-python#3173: Integrates the CUDA 12 source tree that this PR updates with the deferred utility fixes.

Suggested reviewers: mdboom

Change: Bug fix

Merge Risk: Minimal · up to 200d3

The reviewed CUDA 12 fixes introduce no identified merge-blocking risk.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4010017 and 200d361.

Files selected for processing: 8
  • 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/docs/source/release/12.X.Y-notes.rst
  • 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; 10 remain after this review.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant