[PR #22] [CLOSED] feat: get cuda_device_id from render node #25

Closed
opened 2026-10-15 12:47:37 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/gst-wayland-display/pull/22
Author: @zexi
Created: 11/7/2025
Status: ❌ Closed

Base: stable ← Head: get-cuda-id-by-render


📝 Commits (1)

  • 413cef0 feat: get cuda_device_id from render node

📊 Changes

2 files changed (+111 additions, -1 deletions)

View changed files

📝 wayland-display-core/src/utils/allocator/mod.rs (+9 -1)
📝 wayland-display-core/src/utils/device/gpu.rs (+102 -0)

📄 Description

This PR adds support for selecting the correct cuda_device_id based on the render_node in environments with multiple NVIDIA GPUs.

This resolves the https://github.com/games-on-whales/wolf/issues/233 issue where wolf cannot use the zero_copy feature on systems with multiple NVIDIA graphics cards.

The following is the pci path info about the GPUs:

$ ls -alh /dev/dri/by-path/
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:01:00.0-card -> ../card4
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:01:00.0-render -> ../renderD131
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:23:00.0-card -> ../card3
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:23:00.0-render -> ../renderD130
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:41:00.0-card -> ../card2
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:41:00.0-render -> ../renderD129
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:61:00.0-card -> ../card1
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:61:00.0-render -> ../renderD128
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:63:00.0-card -> ../card0
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:81:00.0-card -> ../card8
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:81:00.0-render -> ../renderD135
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:a1:00.0-card -> ../card7
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:a1:00.0-render -> ../renderD134
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:c1:00.0-card -> ../card6
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:c1:00.0-render -> ../renderD133
lrwxrwxrwx 1 root root   8 Aug  1 07:23 pci-0000:e1:00.0-card -> ../card5
lrwxrwxrwx 1 root root  13 Aug  1 07:23 pci-0000:e1:00.0-render -> ../renderD132

$ nvidia-smi --query-gpu=index,pci.bus_id --format=csv,noheader
0, 00000000:01:00.0
1, 00000000:23:00.0
2, 00000000:41:00.0
3, 00000000:61:00.0
4, 00000000:81:00.0
5, 00000000:A1:00.0
6, 00000000:C1:00.0
7, 00000000:E1:00.0

$ ls -alh /proc/driver/nvidia/gpus/ 
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:01:00.0
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:23:00.0
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:41:00.0
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:61:00.0
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:81:00.0
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:a1:00.0
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:c1:00.0
dr-xr-xr-x  5 root root   0 Aug  1 07:25 0000:e1:00.0

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/gst-wayland-display/pull/22 **Author:** [@zexi](https://github.com/zexi) **Created:** 11/7/2025 **Status:** ❌ Closed **Base:** `stable` ← **Head:** `get-cuda-id-by-render` --- ### 📝 Commits (1) - [`413cef0`](https://github.com/games-on-whales/gst-wayland-display/commit/413cef0534ef79eec68d5aedfdd5c514d32b5fdf) feat: get cuda_device_id from render node ### 📊 Changes **2 files changed** (+111 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `wayland-display-core/src/utils/allocator/mod.rs` (+9 -1) 📝 `wayland-display-core/src/utils/device/gpu.rs` (+102 -0) </details> ### 📄 Description This PR adds support for selecting the correct `cuda_device_id` based on the `render_node` in environments with multiple NVIDIA GPUs. This resolves the https://github.com/games-on-whales/wolf/issues/233 issue where wolf cannot use the zero_copy feature on systems with multiple NVIDIA graphics cards. The following is the pci path info about the GPUs: ```bash $ ls -alh /dev/dri/by-path/ lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:01:00.0-card -> ../card4 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:01:00.0-render -> ../renderD131 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:23:00.0-card -> ../card3 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:23:00.0-render -> ../renderD130 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:41:00.0-card -> ../card2 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:41:00.0-render -> ../renderD129 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:61:00.0-card -> ../card1 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:61:00.0-render -> ../renderD128 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:63:00.0-card -> ../card0 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:81:00.0-card -> ../card8 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:81:00.0-render -> ../renderD135 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:a1:00.0-card -> ../card7 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:a1:00.0-render -> ../renderD134 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:c1:00.0-card -> ../card6 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:c1:00.0-render -> ../renderD133 lrwxrwxrwx 1 root root 8 Aug 1 07:23 pci-0000:e1:00.0-card -> ../card5 lrwxrwxrwx 1 root root 13 Aug 1 07:23 pci-0000:e1:00.0-render -> ../renderD132 $ nvidia-smi --query-gpu=index,pci.bus_id --format=csv,noheader 0, 00000000:01:00.0 1, 00000000:23:00.0 2, 00000000:41:00.0 3, 00000000:61:00.0 4, 00000000:81:00.0 5, 00000000:A1:00.0 6, 00000000:C1:00.0 7, 00000000:E1:00.0 $ ls -alh /proc/driver/nvidia/gpus/ dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:01:00.0 dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:23:00.0 dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:41:00.0 dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:61:00.0 dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:81:00.0 dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:a1:00.0 dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:c1:00.0 dr-xr-xr-x 5 root root 0 Aug 1 07:25 0000:e1:00.0 ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:47:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/gst-wayland-display#25
No description provided.