Repository navigation
Description
Describe the bug
Two GPUs (Intel iGPU, RTX 4090), headset on the 4090, KWin Wayland. Started from Steam with no launch options, vrcompositor exits with VRInitError_Compositor_CannotDRMLeaseDisplay: it logs the Intel device as the HMD's device and vkGetDrmDisplay fails (same on 2.18.4, 2.19.2 and 2.19.3). The usual advice, an environment variable in SteamVR's launch options, doesn't help: none of the three variables I tried that way reached vrcompositor. vrserver starts it outside the container ("Runtime escape requested ... using steam-runtime-launch-client --alongside-steam") and it gets the Steam client's environment instead.
Why the Intel device: Mesa's device-select layer puts it first, and the compositor seems to take the first device in the list. With MESA_VK_DEVICE_SELECT_DEBUG=1 in the Steam client's environment the layer prints this from inside vrcompositor (vrcompositor-linux.txt):
selectable devices:
GPU 0: 10de:2684 "NVIDIA GeForce RTX 4090" discrete GPU 0000:01:00.0
GPU 1: 8086:a780 "Intel(R) Graphics (RPL-S)" integrated GPU 0000:00:02.0
device-select: device_select_find_boot_vga selected 1
Index 1 is the Intel device, and the layer moves the selected device to the front of the list. It asks the display server which GPU it runs on only when the instance enables VK_KHR_wayland_surface or VK_KHR_xcb_surface (device_select_layer.c, get_default()). vrcompositor.txt shows the instance being created with VK_KHR_xlib_surface and neither of those two, so the layer falls back to the boot VGA device, which is the iGPU here.
To Reproduce
- A machine with an Intel iGPU that is the boot VGA device and an NVIDIA card, both Vulkan drivers and Mesa's device-select layer installed (on Arch that is
vulkan-mesa-implicit-layers), headset on the NVIDIA card, Wayland session - Start SteamVR from Steam, no launch options
- vrcompositor.txt: lease devices for both cards,
HMD deviceUUIDis the Intel device's, thenvkGetDrmDisplay failedandFailed to start compositor: VRInitError_Compositor_CannotDRMLeaseDisplay
What changes it ("works" = vrcompositor starts on the 4090 and logs Acquired drm display!):
as a launch option (VAR=... %command%) |
on the Steam client itself (VAR=... steam) |
|
|---|---|---|
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json |
still fails | works |
MESA_VK_DEVICE_SELECT=10de:2684 (the 4090's PCI ID) |
still fails | works |
NODEVICE_SELECT=1 (the device-select layer off) |
still fails | works |
/proc/<pid>/environ while the processes ran: vrserver, inside the container, had the launch-option variable; vrcompositor, outside it, had the variable only when the Steam client itself was started with it.
Expected behavior
The compositor uses the Vulkan device that owns the leased connector, or at least doesn't end up on an integrated GPU when a discrete one is present (the intent described in #869). And launch-option variables reach vrcompositor, or the documentation says they don't.
System Information (please complete the following information):
- Steam client version (build number or date): 1794536281
- SteamVR version: 2.19.3 beta (build 26655409)
- Distribution (e.g. Ubuntu): Arch Linux, Linux 7.3.4, KWin 6.8.2 (Wayland), Mesa 26.2.7, NVIDIA 620.70.06 (open kernel modules)
- Steam runtime diagnostics: not attached; tell me if you need it
- Steam and SteamVR logs: the parts of vrcompositor.txt, vrserver.txt and vrcompositor-linux.txt from these launches are in the zip; more on request.
- Minidumps: none; vrcompositor exits with an initialization error, it doesn't crash
Hardware: i9-14900KS with its iGPU enabled (boot_vga is 1 on it), RTX 4090, Bigscreen Beyond 2e.
Screenshots
None.
Additional context
- Possibly related: [BUG] Failed to create surface on both wayland and x11 #925 (closed, the same log lines), Error 307 - Wrong GPU selected by SteamVR with 'IGD multimonitor' enabled #238, and the November 13 comment on [BUG][Wayland][Hybrid GPU] SteamVR cannot acquire direct display when rendering on RX 6800M and HMD is connected to Vega 8 #1030 (Intel + NVIDIA, the same error).
- SteamVR link does not work on SteamRT3 client on steam machine #936 describes the runtime escape. [BUG] VR Compositor displays SteamVR on Laptop Screen #496 suggests
MESA_VK_DEVICE_SELECTin SteamVR's launch options (the second row of the table). - The 2.18 release notes list "Fixed GPU selection on systems with both discrete and integrated GPUs". 2.18.4 still ends up on the integrated one here.
- In the zip: the log excerpts, the environments captured for each launch, and a small program (
vk_device_order.c) that shows the same ordering outside SteamVR: Intel first with the compositor's ten instance extensions, the 4090 first as soon asVK_KHR_xcb_surfaceorVK_KHR_wayland_surfaceis added to them.
Activity