How bryansteiner/gpu-passthrough-tutorial works
This repository supports a Linux KVM Windows gaming VM with GPU passthrough. The documented workflow prepares IOMMU support, inspects device groups, and dynamically assigns the guest GPU to VFIO before launch, restoring host drivers when the VM stops. The tree includes VM configuration, a QEMU script, and lifecycle hooks for VFIO binding, huge pages, and CPU power mode. Source contents were not provided, so connections to individual runtime scripts are omitted or marked unverified.
Main entry points: qemu.sh QEMU launch · iommu.sh IOMMU discovery · win10.xml VM configuration · kvm.conf KVM settings
Components 11
Host preparation
- IOMMU discovery
kvm/scripts/iommu.sh
Guest runtime
- VM configuration
kvm/win10.xml - KVM settings
kvm/kvm.conf - QEMU launch
kvm/scripts/qemu.sh
Lifecycle hooks
- VFIO binding
kvm/hooks/prepare/begin/bind_vfio.sh - VFIO unbinding
kvm/hooks/release/end/unbind_vfio.sh - Hugepage allocation
kvm/hooks/prepare/begin/alloc_hugepages.sh - Hugepage release
kvm/hooks/release/end/dealloc_hugepages.sh - Performance mode
kvm/hooks/prepare/begin/cpu_mode_performance.sh - On-demand mode
kvm/hooks/release/end/cpu_mode_ondemand.sh
Other components
- Host operator
Connections 10
- Host operator → IOMMU discovery: inspects groups
README.md - Host operator → QEMU launch: launches VM
- QEMU launch → VM configuration: uses configuration
- QEMU launch → KVM settings: uses settings
- QEMU launch → VFIO binding: triggers before start
- QEMU launch → VFIO unbinding: triggers after stop
- QEMU launch → Hugepage allocation: triggers before start
- QEMU launch → Hugepage release: triggers after stop
- QEMU launch → Performance mode: triggers before start
- QEMU launch → On-demand mode: triggers after stop