[BUG]: cuda.bindings GL interop tests open EGL device 0 on headless multi-GPU hosts and fail with cudaErrorInvalidDevice
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Đọc cuda_bindings_13/tests/test_graphics_apis.py, đặc biệt là _configure_pyglet_headless và test_cuda_gl_register_image_smoketest; so sánh với bản sửa lỗi kiểm thử cuda.core trong issue #2865. Kiểm tra cách select_headless_egl_device_for_cuda(0) được import và gọi, sau đó chạy các bài kiểm thử graphics API trên máy chủ headless có nhiều GPU, trong đó một GPU không phải GPU đầu tiên được hiển thị. Hoàn tất khi cả hai tham số kiểm thử đều chạy qua mà không cần đặt PYGLET_HEADLESS_DEVICE thủ công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Cython
- Star
- 3.4k
- Fork
- 341
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 148
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/cuda-python
-
CI/CD P1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/cuda-python#3273 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: multi-GPU cuda.core samples take the CUDA device count from NVML and break under CUDA_VISIBLE_DEVICESCó thể đã có người làm @Andy-Jost đã nhận 1 ngày trước. Đang mởbug cuda.core P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA/cuda-python#3215 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
lychee should specify which links are failingCó thể đã có người làm @kkonnerharris đã nhận 1 ngày trước. Đang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
NVIDIA/cuda-python#3204 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRsCó thể đã có người làm @rwgk đã nhận 21 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
NVIDIA/cuda-python#2952 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[DOC]: cuda.core 1.1.1 note misstates program cache permissionsCó thể đã có người làm @leofang đã nhận 36 ngày trước. Đang mởdocumentation P1
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
NVIDIA/cuda-python#2717 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của NVIDIA/cuda-python
Issue tương tự
-
ai-driven-fuzzing bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
linagora/cozy-client#1767 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
coder/chat#151 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
test/obs(external-boot): own-instance control for orphan routing test; reasoned foreign-row refusalĐang mởarea:providers priority:P3 status:needs-triage type:test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
randomparity/kdive#3442 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
pact-foundation/pact-go#667 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug doc-audit
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày