VHOST-DEVICE-GPU(1)
π NAME π
okay bestie, meet vhost-device-gpu β it's a vhost-user backend for a VirtIO GPU device β¨
πΈ SYNOPSIS πΈ
vhost-device-gpu --socket-path <path> --gpu-mode <GPU_MODE>
π¦ DESCRIPTION π¦
It's a virtio-gpu device, and it talks to everybody through the vhost-user protocol. That's the whole vibe π
β¨ OPTIONS β¨
-s,--socket-path <SOCKET>β the vhost-user Unix domain socket, aka where the magic little connection lives π-g,--gpu-mode <GPU_MODE>β this one picks which backend implementation you're running with, so choose wisely bestie:virglrenderer: the OpenGL implementation β note that it's been superseded by Virgl2 πgfxstream: the Vulkan implementation (partial support only, so likeβ¦ it's trying its best π«Ά)
-c,--capset <CAPSET>β a comma-separated list of the enabled capsets. The lineup:virgl: OpenGL implementation, superseded by Virgl2 πvirgl2: OpenGL implementation πgfxstream-vulkan: Vulkan implementation (partial support only).
NOTE: Can only be used for 2D display output for now, no hardware acceleration yet.
gfxstream-gles: OpenGL ES implementation (partial support only).
NOTE: Can only be used for 2D display output for now, no hardware acceleration yet.
--use-egl <USE_EGL>β enables the backend to use EGL. Default:true. Possible values:true,false--use-glx <USE_GLX>β enables the backend to use GLX. Default:false. Possible values:true,false--use-gles <USE_GLES>β enables the backend to use GLES. Default:true. Possible values:true,false--use-surfaceless <USE_SURFACELESS>β turns on the surfaceless backend option. Default:true. Possible values:true,false-h,--helpβ prints help and usage info, for when you're lost (no shame, we've all been there) π§-V,--versionβ prints version info, slay β
π LIMITATIONS π
bestie, sit down, we need to talk:
- This device links native libraries (because of the usage of Rutabaga) that are compiled with GNU libc. The CI is set up to not build this device for musl targets, periodt.
- It might be possible to build those libraries using musl and then build the GPU device, but honestly? That's untested. Nobody knows. Mystery behavior π
- Currently, the only supported thing is sharing the display output to QEMU through a socket using the
transfer_readoperation (VIRTIO_GPU_CMD_TRANSFER_FROM_HOST_3D). - Directly sharing display output resources using dmabuf is not yet supported. Not yet, babe.
- These features are not yet supported:
VIRTIO_GPU_CMD_RESOURCE_CREATE_BLOBVIRTIO_GPU_CMD_SET_SCANOUT_BLOBVIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUIDβ these requirerust-vmm/vhost#251, which in turn requires QEMU API stabilization. So we wait π«
- And because blob resources are not yet supported, some capsets are limited:
- Venus (the Vulkan implementation in virglrenderer) support is unavailable π
gfxstream-vulkanandgfxstream-glesare exposed but can only be used for display output (no hardware acceleration yet).
π₯ FEATURES π₯
The device leverages the rutabaga_gfx crate to provide rendering with virglrenderer and gfxstream. Iconic collaboration tbh π€
- Gfxstream support is compiled by default, but you can disable it by building without the gfxstream feature flag:
cargo build --no-default-features
- With Virglrenderer, Rutabaga translates OpenGL and Vulkan calls to an intermediate representation, which allows OpenGL acceleration on the host β¨
- With the gfxstream rendering mode, GLES and Vulkan calls are forwarded to the host with minimal modification π«
π EXAMPLES π
Start the daemon on the host machine using either GPU mode:
1. Virglrenderer
2. Gfxstream (if the crate has been compiled with the gfxstream feature)
host# vhost-device-gpu --socket-path /tmp/gpu.socket --gpu-mode virglrenderer
With QEMU, two device frontends can be used:
1. vhost-user-gpu-pci
2. vhost-user-vga (also implements VGA, allowing visibility of boot
messages before GPU initialization)
By default, QEMU adds another VGA output. Disable it using -vga none.
π Using vhost-user-gpu-pci
qemu-system-x86_64 \
-chardev socket,id=vgpu,path=/tmp/gpu.socket \
-device vhost-user-gpu-pci,chardev=vgpu,id=vgpu \
-object memory-backend-memfd,share=on,id=mem0,size=4G \
-machine q35,memory-backend=mem0,accel=kvm \
-display gtk,gl=on,show-cursor=on \
-vga none
π Using vhost-user-vga
qemu-system-x86_64 \
-chardev socket,id=vgpu,path=/tmp/gpu.socket \
-device vhost-user-vga,chardev=vgpu,id=vgpu \
-object memory-backend-memfd,share=on,id=mem0,size=4G \
-machine q35,memory-backend=mem0,accel=kvm \
-display gtk,gl=on,show-cursor=on \
-vga none
π ENVIRONMENT π
RUST_LOGβ the logging level, bestie. Set it todebugfor maximum output, aka the full tea β
π BUGS π
See GitHub Issues: https://github.com/rust-vmm/vhost-device/issues
π AUTHORS π
- Dorinda Bassey
dbassey@redhat.com - Matej Hrica
mhrica@redhat.com
π«Ά SEE ALSO π«Ά
okay that's the whole page, you're fully caught up π this was Version 0.1.0 of vhost-device-gpu, straight out of rust-vmm/vhost-device β go forth and GPU, bestie, no cap β¨ππ¦
π¦ where this page comes from
- fedora 43: vhost-device-gpu 0.1.0-4.fc43 Β· (Apache-2.0 OR BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND Apache-2.0 AND BSD-3-Clause AND MIT AND (Unlicense OR MIT)
- fedora 43: vhost-device-gpu 0.2.0-1.fc43 Β· (Apache-2.0 OR BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND Apache-2.0 AND BSD-3-Clause AND MIT AND (Unlicense OR MIT)
- fedora 44: vhost-device-gpu 0.2.0-2.fc44 Β· (Apache-2.0 OR BSD-3-Clause) AND ((MIT OR Apache-2.0) AND Unicode-DFS-2016) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND Apache-2.0 AND BSD-3-Clause AND MIT AND (Unlicense OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms