hn.today

Virtio-nvgpu: Near-native Nvidia GPU access inside a KVM guest

github.com148 points64 comments
Screenshot of Virtio-nvgpu: Near-native Nvidia GPU access inside a KVM guest

virtio-nvgpu gives a KVM guest near-native access to an NVIDIA GPU by forwarding NVIDIA kernel-driver ioctls between guest and host at the driver ABI level so the guest runs unmodified NVIDIA user-mode libraries. It targets headless streaming: the guest composes and encodes frames entirely on the GPU and only sends compressed bitstreams out. By translating at the kernel-driver level rather than the graphics API, command buffers are built locally in the guest, avoiding per-draw-call serialization and the CPU/latency costs of API-level proxies like Venus. The implementation splits a GPL guest kernel module (for /dev/nvidia), a permissively licensed, VMM-agnostic Rust device crate, and shared ABI/protocol definitions; a sandboxed per-guest isolate is designed but not yet implemented.

Measured on an RTX 3060 (driver 595.99.02), a guest’s frame times are within 2% of bare metal for frames above ~2 ms and CPU usage matches the host (example unpaced run: host 0.40 s vs guest 0.37 s). Over 813,691 frames the backend needed only 13,792 crossings (~1 crossing per 59 frames). Four simultaneous guests on one card rendered and encoded correctly at ~25.6 FPS each (≈103.7 FPS total) with no NVENC session limit hit. Known limits include testing up to four guests, constrained driver/version coverage, unverified CUDA beyond enumeration, and unfinished per-guest isolation; detailed benchmarks and ABI profiles are provided.

Read on github.com64 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Hardware

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.