GPU Passthrough on KVM with VFIO: Advanced Setup Guide
GPU passthrough on KVM gives a virtual machine direct ownership of a physical PCIe graphics device instead of presenting an emulated adapter. The guest loads the native vendor driver, controls the GPU memory, and submits work with near-native device access. This model suits CUDA or ROCm workloads, rendering, workstation virtualization, and applications that require a real display controller. The hard part is not adding a PCI address to a VM definition. A reliable deployment depends on firmware configuration, interrupt remapping, correct IOMMU grouping, early driver binding, guest firmware, PCIe topology, and predictable device reset behavior. A GPU may also expose separate audio, USB, or serial functions that belong to the same physical card. Passing only the display function can produce a VM that starts once, fails after shutdown, or leaves part of the device attached to the host. This guide assumes a Linux host running KVM, QEMU, libvirt, VFIO, and an OVMF-based guest. Commands use D...