AMDGPU VirtIO Native Context Merged: Native AMD Driver Support Within Guest VMs

Written by Michael Larabel in Radeon on 16 January 2025 at 08:43 AM EST. 35 Comments
RADEON
An exciting change was just merged into Mesa 25.0 that has been about two years in the making... AMDGPU native context support for VirtIO to allow for using native OpenGL and Vulkan graphics drivers within guest virtual machines for better performance.

VirtIO native context support was talked about back in March 2023 for better VM performance with AMD graphics by allowing the native hardware drivers to be used within supported VirtIO environments, which for now predominantly means QEMU and KVM-based VMs. Using the native hardware drivers can mean much better GPU performance within VMs rather than resorting to the likes of Virgl/Venus as the conventional open-source path for enabling 3D acceleration within guest VMs.

AMDGPU VirtIO native context merge


AMD engineer Pierre-Eric Pelloux-Prayer explains in the now-merged MR for this feature:
"This MR implements native context support for amdgpu: this enables to use native drivers (radeonsi, radeonsi_drv_video and radv) in a guest VM (QEMU+kvm is the only supported setup currently).

Besides performance which seems better than virgl/venus (but I only tested 1 Vulkan game and a couple of GL ones so...) the main advantage I see is maintenance: the guest uses the same drivers, except that they don't speak directly to libdrm(_amdgpu) but instead go through a virtio/qemu transport layer. This can be see for in the enablement patches (last 2 of the series) which are quite small."
One of the most exciting takeaways from this work:
"With the current protocol Unigine Heaven and Superposition are more or less running at 99% the host speed."


More details for those interested within this merge enabling the functionality for both the AMD Radeon drivers RadeonSI Gallium3D and RADV Vulkan.

Update: More background information on the native context effort via VirtGPU DRM Native Contexts Show Potential For Good VM Gaming Performance.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week