fix(gaming): hide virtio-gpu render node so RADV binds the passthrough GPU#46
Merged
Merged
Conversation
…h GPU
Passthrough gaming VMs attach a virtio-gpu-pci device alongside the VFIO
GPU to give SPICE/KMS a scanout surface. Since Mesa 26, radv enumerates
every DRM render node during winsys init and, when a virtio-gpu render
node is present, routes the amdgpu device through the virtio vdrm winsys.
On the VFIO-passed GPU that path fails:
MESA: info: could not get caps: Function not implemented
MESA: error: vdrm_device_connect failed
radv/amdgpu: failed to initialize device
radv then aborts the whole ICD and Vulkan falls back to llvmpipe, so
Proton/DXVK games render on the CPU. MESA_VK_DEVICE_SELECT does not help
because the abort happens before device selection.
Install a udev rule from vee-firstboot that makes the virtio-gpu *render*
node unreadable (MODE=0000). radv skips it and binds the amdgpu node,
while the virtio *card* (scanout) node stays intact so SPICE/KMS and
Sunshine KMS capture keep working. The rule matches by parent driver plus
render kernel name, so it is robust to non-deterministic renderD*/card*
numbering, needs no Mesa rebuild, and survives pacman -Syu.
Docs: replace the earlier "rebuild Mesa with -D amdgpu-virtio=false"
(~30 min) guidance and the non-working MESA_VK_DEVICE_SELECT workaround
with the udev rule, in both docs/ and the Hugo site copy.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
Proton games on the passthrough gaming VM regressed to CPU (software) rendering —
vulkaninforeports onlyllvmpipe, never the AMD GPU. This is not a passthrough regression: the GPU passes through fine (Navi31 bound to amdgpu, all rings healthy). The trigger is a Mesa 26 RADV change.Passthrough gaming VMs attach a
virtio-gpu-pcidevice alongside the VFIO GPU so SPICE/KMS always has a scanout surface (the passthrough GPU usually has no monitor → no native scanout). This creates a second DRM render node in the guest.Since Mesa 26,
radvenumerates every DRM render node during winsys init and, when a virtio-gpu render node is present, routes the amdgpu device through the virtiovdrmwinsys. On the VFIO-passed GPU that path fails:radvaborts the whole ICD → Vulkan falls back tollvmpipe→ Proton/DXVK games run on the CPU.MESA_VK_DEVICE_SELECTdoes not help — the abort happens before device selection.Fix
Install a udev rule from
vee-firstbootthat makes the virtio-gpu render node unreadable (MODE="0000"):radvskips the hidden node and binds the amdgpu node. The virtio card (scanout) node stays intact, so SPICE/KMS display and Sunshine KMS capture keep working. Matching by parent driver + render kernel name is robust to non-deterministicrenderD*/card*numbering, needs no Mesa rebuild, and survivespacman -Syu.Verified live (
lotmonster-gaming, RX 7900 XTX)vulkaninfo --summary→AMD Radeon RX 7900 GRE (RADV NAVI31)✓ (wasllvmpipe)vkcube→Selected GPU 0: ... type: DiscreteGpu✓cardnodes + Sunshine capture intact ✓Docs
docs/gpu-passthrough-gaming.md: replaced the earlier "rebuild Mesa with-D amdgpu-virtio=false" (~30 min) guidance with the udev rule.site/content/gpu-passthrough/gaming-setup.md: replaced the non-workingMESA_VK_DEVICE_SELECTworkaround with the udev rule.Notes
passthrough.gotemplate has no guest provisioning (bring-your-own-OS), so the rule is documented for manual install there.🤖 Generated with Claude Code