cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] AMD Vega 56/64 Passthrough on Threadripper X399 Motherboards

jcdutton
Level 7
Hi,

I have recently been trying to do AMD VEGA GPU passthrough with a Linux Host and KVM/Virt-Manager/QEMU.
The VM was always crashing.
I narrowed down the problem to the passthrough of the GPU. If I passed through other devices, it was fine.

I have finally managed to solve it.
I appears that QEMU does not yet support PCI BAR resizing. The amdgpu driver in the guest tries to resize the bar from 256M to 8G and then tries to use it and you get a protection fault/crash.

There is now a work around that works, that has reached qemu git master. Eventually it will be in qemu releases.
So, no crashes any more.
Tested with Linux kernel 5.1.11 on the host.

The QEMU change that fixes the problem is:
https://github.com/qemu/qemu/commit/3412d8ec9810b819f8b79e8e0c6b87217c876e32
Description: vfio/pci: Hide Resizable BAR capability

What this does is hide the resizable capability of the BAR, so amdgpu driver does not try to re-size it.
Also tested with a Windows guest.
3D Games in the guest work fine and are very fast.

The system is very stable.
4,749 Views
1 REPLY 1

zasyadko
Level 7
Hello! Please tell me which distribution do you use? I just can’t get to work, I have Asus zenith extreme and 4 vega 64. Please share your tutorial on setting up virtual machines, thanks.