Skip to content
Angelo Azevedo edited this page Jun 11, 2026 · 1 revision

External GPU & VFIO Passthrough

This configuration contains an advanced virtualization stack optimized for on-the-fly Dynamic GPU Passthrough (VFIO).

Dynamic Passthrough via libvirt

A custom libvirt hook script (gpu-passthrough.nix) allows dynamic binding and unbinding of devices. This means:

  1. When the host system is running normally, the eGPU is bound to the native Linux drivers (e.g., amdgpu or nvidia) and can be used for rendering on Linux.
  2. When a Windows VM is started via virt-manager, the hook script safely unbinds the Thunderbolt-connected eGPU from the native Linux drivers and binds it to the vfio-pci driver.
  3. The VM boots with direct hardware access to the eGPU, achieving near-native graphics performance inside the VM.
  4. Upon shutting down the VM, the script reverses the process, unbinding from vfio-pci and re-binding to the native Linux driver so it can be used on the host again.

Usage

Simply connect the Thunderbolt eGPU, launch virt-manager, and start the VM. The libvirt hooks handle the driver unloading and rebinding seamlessly behind the scenes.

Clone this wiki locally