Skip to content

fix(gaming): hide virtio-gpu render node so RADV binds the passthrough GPU#46

Merged
Benehiko merged 1 commit into
mainfrom
fix/radv-virtio-gpu-render-node
Jul 19, 2026
Merged

fix(gaming): hide virtio-gpu render node so RADV binds the passthrough GPU#46
Benehiko merged 1 commit into
mainfrom
fix/radv-virtio-gpu-render-node

Conversation

@Benehiko

Copy link
Copy Markdown
Owner

Problem

Proton games on the passthrough gaming VM regressed to CPU (software) rendering — vulkaninfo reports only llvmpipe, 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-pci device 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, 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 aborts the whole ICD → Vulkan falls back to llvmpipe → Proton/DXVK games run on the CPU. MESA_VK_DEVICE_SELECT does not help — the abort happens before device selection.

Fix

Install a udev rule from vee-firstboot that makes the virtio-gpu render node unreadable (MODE="0000"):

SUBSYSTEM=="drm", KERNEL=="renderD*", DRIVERS=="virtio-pci", MODE="0000"

radv skips 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-deterministic renderD*/card* numbering, needs no Mesa rebuild, and survives pacman -Syu.

Verified live (lotmonster-gaming, RX 7900 XTX)

  • vulkaninfo --summaryAMD Radeon RX 7900 GRE (RADV NAVI31) ✓ (was llvmpipe)
  • vkcubeSelected GPU 0: ... type: DiscreteGpu
  • Scanout card nodes + 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-working MESA_VK_DEVICE_SELECT workaround with the udev rule.

Notes

  • The non-gaming passthrough.go template has no guest provisioning (bring-your-own-OS), so the rule is documented for manual install there.

🤖 Generated with Claude Code

…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>
@Benehiko
Benehiko merged commit 7c5d6ea into main Jul 19, 2026
4 checks passed
@Benehiko
Benehiko deleted the fix/radv-virtio-gpu-render-node branch July 19, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant