freenode
Kernel & Low-Level

NVIDIA vGPU VFIO driver sparks Rust rewrite debate

A C-based variant driver for nova-core draws a full Rust counter-proposal and VFIO maintainer pushback on long-term review capacity.

NVIDIA engineers have posted a Linux kernel series that adds open-source vGPU management to nova-core and a matching VFIO PCI variant driver, aiming to hand virtual GPU functions to QEMU guests under host control.

The work, led by Zhi Wang, ties physical-function lifecycle in nova-core to VF open, reset, and close so firmware-backed instances can be created and torn down when a virtual function is assigned. The VFIO side is written in C: it binds only overridden NVIDIA VFs, delegates instance control to nova-core, and reuses vfio-pci-core for the rest. That path is meant to let Linux and Windows guests run NVIDIA's own guest drivers against sliced GPU resources without the proprietary vGPU stack on the host.

Danilo Krummrich, a leading Rust-for-Linux maintainer, objected to the C FFI boundary. He argued it undoes the ownership and lifetime model already used inside nova-core, replacing RAII with raw pointers and manual lifecycle rules callers must uphold. He sketched a Rust VFIO/PCI stack and a Rust NVIDIA vGPU driver, saying the same relationships could stay intact across the interface and sit naturally beside nova-core and nova-drm. He offered to help maintain the Rust VFIO pieces and floated a joint session at LPC.

VFIO maintainer Alex Williamson was unconvinced on process more than language. He asked who would review Rust variant drivers from a VFIO standpoint, who would catch interface breakages, and how much a Rust driver would impose on the shared PCI core. One early PoC detail, embedding VFIO core state in the PCI device, he called a non-starter for a common core shared by multiple drivers. He suggested Dave Airlie's experience growing a Rust driver inside a mostly C subsystem might be instructive.

Wang said he takes the maintenance concerns seriously, is interested in working through the Rust prototype, and has already been reworking SR-IOV support in that direction, while still refreshing the C series against review feedback. The exchange leaves the feature's shape open: open vGPU mediation for nova is clearly wanted, but whether the VFIO glue ships in C, Rust, or both now hinges on review bandwidth and how far Rust infrastructure in VFIO is allowed to grow.