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
fix(samples): waive CUDA-GL interop on non-NVIDIA GL contexts - #3077
Follow-up to the sample migration in #2959; related OpenGL availability handling is tracked in #2767 (this PR does not close that issue).
The migration replaced the old example wrapper's unconditional GL-sample skip with actual sample execution. A window can now open successfully on a non-NVIDIA GL context, such as Microsoft/D3D12, but these samples still attempt CUDA resource registration. The existing graphics tests already reject such contexts.
Reuse gl_context_not_on_nvidia_gpu_reason() in glInteropFluid, glInteropMipmapLod, and glInteropPlasma after creating the GL window and before registering CUDA resources. Ineligible contexts report the reason, close the window, and exit with the negotiated sample-waiver code. NVIDIA GL contexts continue normally, and genuine CUDA errors remain failures.
Only these three samples change. No new tests are added: the existing GL-helper tests cover vendor eligibility, and the sample harness already runs all three examples for three frames.
Validation
Ruff checks and formatting checks pass for the three changed samples.
python -m compileall -q passes for the three changed samples.
git diff --check passes.
Targeted existing sample tests could not collect locally because the environment has no importable CUDA package. WSL and native NVIDIA GL runtime validation remain outstanding; no hardware-backed success is claimed.
Checklist
New or existing tests cover these changes.
The documentation is up to date with these changes (no documentation changes are required).
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
Bug Fixes
The fluid, mipmap LOD, and plasma graphics interop samples now check whether the active OpenGL context is running on an NVIDIA GPU. On other GPUs, they display an explanation and exit as waived instead of attempting to run with an unsupported context.
Walkthrough
The Fluid, MipmapLod, and Plasma samples now check whether their OpenGL context is on an NVIDIA GPU. When it is not, they print the helper’s reason, close the window, and exit with EXIT_WAIVED.
Changes
OpenGL context waivers
Layer / File(s)
Summary
Load the helper and check the GL context samples/cuda_core/glInteropFluid/glInteropFluid.py, samples/cuda_core/glInteropMipmapLod/glInteropMipmapLod.py, samples/cuda_core/glInteropPlasma/glInteropPlasma.py
Each sample imports the shared context-check helper. After window creation, each sample checks the context and exits with EXIT_WAIVED when the helper returns a reason.
Suggested reviewers:danielfrg
Priority: ⬇️ Low
Change: Bug fix
Merge Risk:⚪ Minimal · up to 28b18
The samples retain the waiver path for non-NVIDIA GL contexts in documented checkout use. Hardware-specific runtime validation remains outstanding, but no concrete merge-blocking risk is established.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
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
cuda.coreEverything related to the cuda.core module
1 participant
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.
Description
Follow-up to the sample migration in #2959; related OpenGL availability handling is tracked in #2767 (this PR does not close that issue).
The migration replaced the old example wrapper's unconditional GL-sample skip with actual sample execution. A window can now open successfully on a non-NVIDIA GL context, such as Microsoft/D3D12, but these samples still attempt CUDA resource registration. The existing graphics tests already reject such contexts.
Reuse
gl_context_not_on_nvidia_gpu_reason()inglInteropFluid,glInteropMipmapLod, andglInteropPlasmaafter creating the GL window and before registering CUDA resources. Ineligible contexts report the reason, close the window, and exit with the negotiated sample-waiver code. NVIDIA GL contexts continue normally, and genuine CUDA errors remain failures.Only these three samples change. No new tests are added: the existing GL-helper tests cover vendor eligibility, and the sample harness already runs all three examples for three frames.
Validation
python -m compileall -qpasses for the three changed samples.git diff --checkpasses.Checklist