[BUG]: cuda.bindings GL interop tests open EGL device 0 on headless multi-GPU hosts and fail with cudaErrorInvalidDevice
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
Rechercherichtung
Lies cuda_bindings_13/tests/test_graphics_apis.py, insbesondere _configure_pyglet_headless und test_cuda_gl_register_image_smoketest; vergleiche die Korrektur des cuda.core-Tests in Issue #2865. Prüfe, wie select_headless_egl_device_for_cuda(0) importiert und aufgerufen wird, und führe die Grafik-API-Tests auf einem Headless-System mit mehreren GPUs aus, auf dem eine GPU sichtbar ist, die nicht die erste ist. Fertig ist die Arbeit, wenn beide Testparameter bestehen, ohne dass PYGLET_HEADLESS_DEVICE manuell gesetzt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this bug and that I agree to the Code of Conduct
Type of Bug
Something else (test-only failure)
Component
cuda.bindings
Describe the bug
cuda_bindings_13/tests/test_graphics_apis.py::test_cuda_gl_register_image_smoketest (both parameters) fails on a headless 8-GPU B300 host when the tests see one GPU through CUDA_VISIBLE_DEVICES:
AssertionError: cudaGraphicsGLRegisterImage returned cudaErrorInvalidDevice
assert 'cudaErrorInvalidDevice' in {'cudaErrorOperatingSystem', 'cudaSuccess'}
CUDA_VISIBLE_DEVICES does not reorder EGL's device enumeration, so the headless context lands on EGL device 0, which is not the GPU behind CUDA device 0. #2865 fixed exactly this for cuda.core's tests/test_graphics.py with select_headless_egl_device_for_cuda. The cuda.bindings test has its own _configure_pyglet_headless, and that function still sets only pyglet.options["headless"]. The nightly GH200 / GB300 rows have one GPU, so they never see this.
On the B300 host the EGL devices report these CUDA ordinals (eglQueryDeviceAttribEXT(EGL_CUDA_DEVICE_NV), with only the 6th GPU visible):
- EGL device 5 → CUDA ordinal 0.
- Every other EGL device → none.
How to Reproduce
On a headless multi-GPU Linux host, with EGL available and no DISPLAY:
CUDA_VISIBLE_DEVICES=<uuid of a GPU other than the first> pytest cuda_bindings_13/tests/test_graphics_apis.py
Expected behavior
The test registers against the GL context on the GPU it uses for CUDA, as the cuda.core test does.
Proposed fix
Call select_headless_egl_device_for_cuda(0) in the bindings test's _configure_pyglet_headless, the same way cuda.core does. These tests register against CUDA device 0. With that change, tests/test_graphics_apis.py passes 3/3 on the host above without any extra environment variable. Without the change, it passes only when PYGLET_HEADLESS_DEVICE=5 is set by hand. I have the change ready as a PR if this sounds right.
The fix was written with Claude Opus 5.5 and reviewed by the contributor.
Environment
GPU: B300 (cc 10.3, x86_64, 8 GPUs, one visible) | driver 610.57.04 | CUDA 13.4.2 (local CTK) | Python 3.12 | cuda-python 2da9c65a
- Vorherrschende Sprache
- Cython
- Sterne
- 3.4k
- Forks
- 341
- Ø Merge
- 1 T. 18 Std.
- Gemergte PRs (30 T.)
- 147
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus NVIDIA/cuda-python
-
CI/CD P1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NVIDIA/cuda-python#3273 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: multi-GPU cuda.core samples take the CUDA device count from NVML and break under CUDA_VISIBLE_DEVICESEvtl. vergeben @Andy-Jost hat das vor 2 Tagen übernommen. Offenbug cuda.core P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NVIDIA/cuda-python#3215 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
lychee should specify which links are failingEvtl. vergeben @kkonnerharris hat das vor 2 Tagen übernommen. Offentriage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
NVIDIA/cuda-python#3204 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRsEvtl. vergeben @rwgk hat das vor 22 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
NVIDIA/cuda-python#2952 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookupEvtl. vergeben @rwgk hat das vor 37 Tagen übernommen. Offentriage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NVIDIA/cuda-python#2646 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in NVIDIA/cuda-python
Ähnliche Issues
-
level2 nsoc26
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
GauravKarakoti/SecureFlow#1488 ·
Maintainer antworten meist innerhalb von 1 Tag
-
severity: low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
luainkernel/lunatik#2221 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent-butler-finding chore
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 94/100
jordansmall/spindrift#6234 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent/quality stage/040-covered-by-pr testing
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
cncf/endusers#2031 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
patrick-hudson/put.gd-desktop#979 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag