You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[no-ci] fix(driver): correct cuLogs* introduced version to 12.9 in cuda_bindings_12 (backport #2978) - #3395
…da_bindings_12
Apply the changes from NVIDIA#2978 to cuda_bindings_12/ on main: pin the
cuGetProcAddress_v2 version for cuLogs* to 12090 (was 12080) and add a
regression test. This fixes the cuLogs* FunctionNotFoundError.
Matches the 12.9.x backport in NVIDIA#3377.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Reviewing files that changed from the base of the PR and between 252f5c2 and 6ad46aa.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Summary
Summary by CodeRabbit
New Features
Added support for CUDA 12.9 driver logging APIs, including registering and removing callbacks, retrieving current logs, and writing logs to files or memory buffers.
Compatibility
The logging APIs now require CUDA 12.9 or later. Earlier CUDA versions can no longer resolve these APIs through the bindings.
The Linux and Windows CUDA 12 bindings now resolve the five cuLogs* APIs at version 12090. A test checks callback registration, log retrieval, and log dumps on CUDA 12.9 or later.
Changes: CUDA 12.9 cuLogs APIs
Layer / File(s)
Summary
cuLogs symbol resolution cuda_bindings_12/cuda/bindings/_internal/driver_linux.pyx, cuda_bindings_12/cuda/bindings/_internal/driver_windows.pyx
Both platform bindings update the version used to resolve the five cuLogs* symbols from 12080 to 12090.
cuLogs API test coverage cuda_bindings_12/tests/test_cuda.py
A test for CUDA 12.9 or later checks callback registration, current log retrieval, and dumps to a temporary file and memory buffer.
Suggested reviewers:rwgk
Change: Bug fix
Merge Risk: Low · previous review 252f5
This change makes the CUDA 12.9 cuLogs APIs resolve at the correct version, with a regression test. The test registers a null callback and does not clean it up on failure, so it could crash the test process if the driver emits a log. Fix the test before merging; the production binding change itself looks sound.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Tip
🎯 Customize your risk assessments
Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.
✅ Automatic approvals, with your rules
Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.
cuLogsRegisterCallback(0, None) stores a NULL user callback. The binding always registers cuLogsCallbackWrapper with the driver, and that wrapper calls the stored callback without a NULL check (cuda_bindings_12/cuda/bindings/driver.pyx:50976). If the driver delivers a log message while this callback is registered, the wrapper calls a NULL function pointer and can crash the test process.
Register a no-op callback instead:
Suggested fix
--- "a/cuda_bindings_12/tests/test_cuda.py"+++ "b/cuda_bindings_12/tests/test_cuda.py"@@ -1156,13 +1156,16 @@
assert state is None
+def _noop_culogs_callback(user_data, log_level, message, length):+ pass+
@pytest.mark.skipif(
driver_version_less_than(12090),
reason="cuLogs* functions were introduced in CUDA 12.9",
)
def test_culogs_functions():
try:
- err, callback_handle = cuda.cuLogsRegisterCallback(0, None)+ err, callback_handle = cuda.cuLogsRegisterCallback(_noop_culogs_callback, None)
assert err == cuda.CUresult.CUDA_SUCCESS
err, _ = cuda.cuLogsCurrent(0)
The reason will be displayed to describe this comment to others. Learn more.
@lijinf2 important: Understood. I won’t press for the no-op callback. The reported crash risk depends on the driver delivering a log message, so CI can pass without exercising that path.
The reason will be displayed to describe this comment to others. Learn more.
Major · Stability & Availability · Quick win
important: Unregister the callback on failure.
If a later cuLogs call raises FunctionNotFoundError or an assertion fails, this line is skipped and the callback remains registered for subsequent tests. A subsequent log can then crash the process through the null callback. Unregister the callback in a finally block after successful registration. (raw.githubusercontent.com)
The reason will be displayed to describe this comment to others. Learn more.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingcuda.bindingsEverything related to the cuda.bindings module
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #2978 to
cuda_bindings_12/on main, matching the 12.9.x backport in #3377.[no-ci]because there is no CUDA 12 CI on main yet.🤖 Generated with Claude Code