VFIO PCI Passthrough Stable
This is not a guide, but rather an update that my original eGPU passthrough over Thunderbolt 3 configuration seems to be stable now, most likely due to improvements in the Linux Kernel, QEMU, and VFIO.
Awhile back, I attempted to passthrough external PCIe graphics cards to virtual machines over Thunderbolt, for the use of gaming and game cheat reversing. I used the same libvirt configuration that I would on a desktop GPU passthrough. Initially this seemed to work, but after awhile graphical artifacts and tears would take over the desktop, which eventually left the guest OS in an unresponsive state. I tried many different hardware combinations including different computers, eGPU enclosures, Thunderbolt 2 and 3 controllers, both NVIDIA and AMD graphics cards to no avail. I also attempted to modify some esoteric software configurations, including CPU pinning, huge pages, message signaled-based interrupts (MSIs), but nothing resolved the issue.
I left the project alone for awhile, until I saw a Reddit post that Alex Williamson, kernel dev at Red Hat, responded to. He helped OP work through their issue and wrote a kernel patch for it. I decided to wait until whatever patch Alex Williamson wrote got merged with the stable kernel, and then tested on a fresh set up. I made a new Windows 10 VM with the same configuration that I used in my original guide, but this time it worked and continued to work without glitches. However, unlike OP I did not passthrough the Thunderbolt controller, and I haven’t ran into any freezing issues.
This setup was tested on the following hardware:
- 2016 Razer Blade Stealth
- 2018 XPS 13 9360
- Razer Core V1
- NVIDIA GTX 1070
- Arch Linux 4.19.4-arch1-1-ARCH
- Libvirt 4.9.0-1
- OVMF 1:r24601.6861765935-1
- QEMU 3.0.0-4
The configuration files: