Hello everyone,
I'm trying to set up a Windows 10 Virtual Machine with AMD-V/AMD-Vi/IOMMU passthrough of one of my graphics cards to enable gaming on my Linux machine. But for some reason I am getting incredibly poor graphics performance.
Hardware:
* Processor: AMD Ryzen 7 1700 @ 3.6GHz
* Motherboard: Gigabyte Aorus X370 Gaming 5 (with the latest F5 BIOS/UEFI)
* Graphics card: Nvidia K620 (for the host)
* Graphics card: AMD RX 480 (for the guest)
* Solid State Drive: Samsung 830 128GB
Software:
* Arch Linux (running the latest linux-vfio kernel)
* QEMU
* Libvirt
* OVMF
* Virt-manager
BIOS/UEFI settings:
* IOMMU Enabled
* SVM Enabled
I've set up a VM, installed Windows 10, and I am passing through the RX 480. Windows automatically detects the card and install the appropriate drivers. Running Cinebench R15 results in almost 1500 points (essentially the same as native) in multi-threaded performance, and just under 100 points in single-threaded performance (out of around 150 points native). Disk IO is also satisfactory. But running Unigine Superposition at 1080p Medium only results in around 1700 points, with a max and average FPS under 20 FPS. The same test run natively results in almost 8000 points, with a max and average FPS well above 60.
Looking at the GPU-Z and AMD's WattMan it becomes very clear that the GPU is not fully utilised; it does have some short peaks at 70-100% activity, but mostly runs at idle, even though the memory and GPU frequencies are increased to 2000MHz and 1200MHz respectively. The CPU only peaks at around 20-30%.
The only thing I'm yet to test is the RAM speed. Doing that as soon as I get home.
Accidentally just created this thread. What I meant to change/add before posting was that apparently this is a common issue which appears to be related to AMD's implementation (?) of Nested Page Tables, or NPT.
By disabling NPT in KVM I get much better GPU performance, with scores around 7500 in the aforementioned benchmark. Unfortunately this also causes a significant drop in CPU performance. Even though I've set up the CPU as host-passthrough, with 8 virtual processors as 1 socket, 4 cores/socket and 2 threads/core, when NPT is disabled the Windows Task manager only reports 1 virtual processor, though the Device Manager lists all 8. Cinebench scores only 100 points, and doesn't even run the multi-threaded test.
There are several threads on the matter on Reddit. Has anyone managed to find a workaround?
Seems to be driver related at the moment, I haven't heard of any true fixes, most people are just putting it down to microcode from the CPU, and thus waiting for an update direct from AMD, obviously a large amount of issues are waiting to be fixed due to Ryzen's recent release, so the update will be 'soon'.
Might sound crazy, but I've had lots of issues with AMD Crimson from driver version to driver version (Win X running in a VM with pass through), some are good some are really bad (I just can't help not to upgrade hoping for a little nudge in performance), some games run just fine like Metro 2033, but games like JC3 go from running ok to running like crap (update or roll back driver and it's ok again), just started playing deus ex mankind divided and everything was fine until I updated the driver, now at times I have weird artifacts that come and go....time for another rollback.
My only point in telling you this is that you might want to check which driver Windows installed and that the Crimson version you are using is semi-up-to-date.