Conversation
select_headless_egl_device_for_cuda caught `except Exception: return None`, which violates the "Capability probes must not swallow real bugs" rule in cuda_core/tests/AGENTS.md. A real failure (ctypes drift, a pyglet internal rename, a transient EGL error) was swallowed and turned into None, which makes the caller fall back to EGL device 0 -- the broken path on the multi-GPU systems NVIDIA#2865 fixes -- so the test re-failed with the original CUDA_ERROR_INVALID_DEVICE and no sign the fix ran. The only genuine "extension not available" signal is pyglet.gl.lib.MissingFunctionException: link_EGL returns a stub for an unresolvable entry point, and the stub raises it when called. Narrow the catch to that type and let everything else propagate. EGL_FALSE returns are already handled as "no match", and the caller already skips when libEGL is absent, so no ImportError handling is needed. Follow-up to NVIDIA#2865. Refs NVIDIA#2864.
Contributor
4 tasks done
Contributor
Author
|
/ok to test f4fe917 |
juenglin
enabled auto-merge (squash)
October 5, 2026 18:02
Contributor
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
closes #2864
Follow-up to #2865.
select_headless_egl_device_for_cudaincuda_python_test_helpers/cuda_python_test_helpers/graphics.pyis a capability probe, but it caughtexcept Exception: return None, which violates the "Capability probes must not swallow real bugs" rule incuda_core/tests/AGENTS.md. A real failure (ctypes drift, a pyglet internal rename, a transient EGL error) was swallowed and turned intoNone, which makes_configure_pyglet_headless()leavepyglet.options["headless_device"]unset and fall back to EGL device 0 -- the broken path on the multi-GPU systems #2865 fixes -- so the test would re-fail with the originalCUDA_ERROR_INVALID_DEVICEand no sign the fix ran.The only genuine "extension not available" signal here is
pyglet.gl.lib.MissingFunctionException:link_EGLreturns a stub for an unresolvable entry point (e.g. an EGL stack that haseglQueryDevicesEXTbut noteglQueryDeviceAttribEXT), and the stub raisesMissingFunctionExceptionwhen called. Narrow the catch to that type and let everything else propagate.EGL_FALSEreturns are already handled as "no match", and the caller already skips when libEGL is absent, so noImportErrorhandling is needed.Checklist