Repository navigation
Commit 79e016e
cuda.core: match headless EGL device to the current CUDA device in test_graphics.py (NVIDIA#2865)
CUDA_VISIBLE_DEVICES reorders CUDA's device enumeration but has no effect
on EGL's, so on headless multi-GPU Linux systems EGL device 0 does not
necessarily correspond to CUDA device 0. cuGraphicsGLRegisterBuffer/Image
then fail with CUDA_ERROR_INVALID_DEVICE because interop resources must be
registered on the CUDA device backing the GL context.
Add select_headless_egl_device_for_cuda(), which uses the EGL_NV_device_cuda
extension (eglQueryDeviceAttribEXT + EGL_CUDA_DEVICE_NV) to find the EGL
device that actually maps to the current CUDA device, and wire it into
_configure_pyglet_headless(). Falls back to pyglet's default device when the
extension is unavailable or no match is found, so single-GPU and
non-NVIDIA-EGL environments are unaffected.
Fixes NVIDIA#2864
Co-authored-by: Claude Sonnet 5 <[email protected]>1 parent 8d91249 commit 79e016e
2 files changed
Lines changed: 65 additions & 2 deletions
File tree
- cuda_core/tests
- cuda_python_test_helpers/cuda_python_test_helpers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | | - | |
| 59 | + | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
60 | 73 | | |
61 | 74 | | |
62 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
19 | 69 | | |
20 | 70 | | |
21 | 71 | | |
| |||
0 commit comments