Fix Vulkan device selection on Intel+NVIDIA PRIME systems#315
Merged
Conversation
6b673c7 to
00289ad
Compare
Detect multi-GPU topology via sysfs and the display server via environment variables, then hard-reject adapters that are known to fail presentation: - X11: reject Intel iGPU (Mesa bug #4688) - Wayland: reject NVIDIA dGPU (surface owned by compositor's GPU) Replaces the Ubuntu-specific /etc/prime-discrete heuristic. https://claude.ai/code/session_01W9jSvpnbXEXmoHFuUVFdUN
00289ad to
31c55b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/etc/prime-discreteheuristic with proper multi-GPU detection/sys/bus/pci/devices/) — zero Vulkan overheadWAYLAND_DISPLAY/DISPLAYenvironment variablesBackground
On Linux systems with both Intel iGPU and NVIDIA dGPU (PRIME topology), Vulkan presentation
is broken for one of the two GPUs depending on the display server:
This is an architectural limitation in the Linux Vulkan ecosystem — there is no automatic
cross-GPU presentation mechanism. The issue spans NVIDIA drivers 460.x–570.x and Mesa 23.x–25.x,
confirming it is systemic rather than a single driver bug.
The previous workaround read
/etc/prime-discrete, which is Ubuntu-specific and did notdistinguish between X11 and Wayland (where the opposite GPU is broken).
Test plan
detect_gpu_vendors()returns one entrydevice_idoverride still works to force a specific adapterdetect_gpu_vendors()returns empty, no rejectionsCloses #205