[BUG]: cuda.bindings GL interop tests open EGL device 0 on headless multi-GPU hosts and fail with cudaErrorInvalidDevice
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
cuda_bindings_13/tests/test_graphics_apis.py、特に _configure_pyglet_headless と test_cuda_gl_register_image_smoketest を読み、issue #2865 の cuda.core テストの修正と比較してください。select_headless_egl_device_for_cuda(0) のインポート方法と呼び出し方を確認し、先頭以外の GPU が 1 つ見えている、複数 GPU 搭載の headless ホストで graphics API テストを実行してください。PYGLET_HEADLESS_DEVICE を手動で設定せずに、両方のテストパラメーターが成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Cython
- スター
- 3.4k
- フォーク
- 341
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 138
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/cuda-python のほかの issue
-
CI/CD P1
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/cuda-python#3273 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: multi-GPU cuda.core samples take the CUDA device count from NVML and break under CUDA_VISIBLE_DEVICES対応中かも @Andy-Jost が 3 日前に担当しました。 オープンbug cuda.core P2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NVIDIA/cuda-python#3215 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
lychee should specify which links are failing対応中かも @kkonnerharris が 3 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
NVIDIA/cuda-python#3204 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: cleanup-pr-previews never removes previews of deleted PRs対応中かも @rwgk が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
NVIDIA/cuda-python#2952 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: LocatedHeaderDir is mutable, so callers can poison the cached header-directory lookup対応中かも @rwgk が 37 日前に担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NVIDIA/cuda-python#2646 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
NVIDIA/cuda-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mw00/project-maya#743 ·
メンテナーはふだん 1 日以内に返信
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
envoyproxy/envoy#48897 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 70/100
garrytan/gbrain-evals#222 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
code-yeongyu/senpi#5262 ·
メンテナーはふだん 1 日以内に返信