Repository navigation
test(cuda.core): skip CUDA-GL interop tests on TCC devices - #3054
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Priority: ➖ Normal Change: Bug fix Merge Risk: ⚪ Minimal · up to TCC devices should skip the GL-dependent tests, while other devices continue through GL setup. No concrete merge-blocking behavior is established; confirmation on TCC hardware remains useful.
Comment |
TCC is a compute-only driver model with no OpenGL, so GL context setup raises a GLException that is not classified as "context unavailable". All 23 test_graphics.py tests then fail instead of skipping on Windows/TCC. Skip up front when Device().properties.tcc_driver is set. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
f95994f to
f833a8c
Compare
|
Add Carrot credits or activate Agent usage billing to use Autopilot |
|
There was a problem hiding this comment.
Hm, the test_graphics_apis.py tests do not need the same skip?
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
ast-grep outline cuda_bindings/tests/test_graphics_apis.py --items all
rg -n -C3 'tcc|TCC|open_gl_window|is_gl_context_unavailable|cuGL|cuGraphics|skip|fixture' cuda_bindings/tests/test_graphics_apis.py
fd -i '^graphics\.py$'Length of output: 2328
🏁 Script executed:
#!/bin/bash
sed -n '55,150p' cuda_bindings/tests/test_graphics_apis.py
ast-grep outline cuda_python_test_helpers/cuda_python_test_helpers/graphics.py --items all
rg -n -A45 -B3 '^def (is_gl_context_unavailable|open_gl_window)\(' cuda_python_test_helpers/cuda_python_test_helpers/graphics.py
rg -n -C3 'cudaDevAttrTccDriver|CU_DEVICE_ATTRIBUTE_TCC_DRIVER|cudaDeviceGetAttribute\(|cudaGetDevice\(' cuda_bindings/tests --glob '*.py'Length of output: 9291
@juenglin suggestion: Yes—the GL smoke tests need the same early TCC skip.
In cuda_bindings/tests/test_graphics_apis.py, _gl_context() calls open_gl_window() without checking TCC mode. The reported GLException would propagate before the test reaches its cudaErrorOperatingSystem handling. Both parameterizations of test_cuda_gl_register_image_smoketest use this path.
Add the check before _configure_pyglet_headless(). Use cudart.cudaGetDevice() and cudart.cudaDeviceGetAttribute(cudart.cudaDeviceAttr.cudaDevAttrTccDriver, device) to avoid a dependency on cuda.core. Check both return statuses; query failures should fail, not skip.
Keep test_cuda_register_image_invalid enabled. It does not create a GL context and only checks that registration with an invalid handle returns an error.
This conclusion comes from code inspection. I did not test it on TCC hardware.
You are interacting with an AI system.
There was a problem hiding this comment.
Would it be better to work the skip into is_gl_context_unavailable then?
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
ast-grep outline cuda_python_test_helpers/cuda_python_test_helpers/graphics.py --items all
ast-grep outline cuda_bindings/tests/test_graphics_apis.py --items all
rg -n -A65 -B3 '^def (is_gl_context_unavailable|open_gl_window)\(' cuda_python_test_helpers/cuda_python_test_helpers/graphics.py
rg -n -A55 -B3 '^def (_gl_context|_configure_pyglet_headless)\(' cuda_bindings/tests/test_graphics_apis.pyLength of output: 9434
@juenglin suggestion: Share the TCC check, but keep it separate from is_gl_context_unavailable().
That function classifies an exception after GL setup fails. TCC is a property of the selected CUDA device, so check it before GL setup. A GL context could also open on another GPU even when the selected CUDA device uses TCC.
Do not add generic GLException handling. The helper deliberately rejects it because it can indicate a real GL error.
A separate helper in cuda_python_test_helpers.graphics could return a skip reason for TCC. Both test suites could call it before configuring pyglet or opening a window. Use cuda.bindings for the device query, rather than introducing a cuda.core dependency. Let query failures propagate.
You are interacting with an AI system.
There was a problem hiding this comment.
@coderabbitai Please make the change you suggested.
There was a problem hiding this comment.
📌 Tracking this review finding. CodeRabbit will verify future changes against the original feedback and will only mark it fixed when the code satisfies it.
|
❌ Cannot commit CI fixes directly to a fork pull request. Request a fix PR instead. |
Add tcc_skip_reason() to cuda_python_test_helpers.graphics so both cuda_core/tests/test_graphics.py and cuda_bindings/tests/test_graphics_apis.py skip CUDA-GL interop tests on a TCC device using one shared predicate. The helper queries the current device via cuda.bindings.runtime (not cuda.core) so the cuda_bindings suite does not take a cuda.core dependency. Runtime query failures propagate rather than being masked as a skip. test_cuda_register_image_invalid stays enabled: it does not open a GL context and only checks the error path for an invalid handle. Signed-off-by: Ralf Juengling <[email protected]>
|
/ok to test b1ea1b4 |
Skip
test_graphics.pyGL interop tests on TCC devices.TCC is compute-only and has no OpenGL. Context setup raises a
GLExceptionthat is not treated as "context unavailable", so 23 tests fail instead of skipping on Windows/TCC.The fix adds
_skip_if_tcc(), which checksDevice().properties.tcc_driver. Both GL context helpers call it first.Tested:
test_graphics.pyon Linux, 30 passed (same as before). The TCC skip path is not tested on real TCC hardware. It should be rerun on Windows with a TCC device to confirm that device reportstcc_driver.🤖 Generated with Claude Code