Tips for PCI Passthrough

Published 2019-11-17 on Anjan's Homepage

I recently fired up my windows virtual machine to play The Outer Worlds. However, I ran into a number of issues that I would like to document in case I run into them again or someone else does.

1 AMD GPU Guest Driver Install Black Screen at 40%

This was the most frustrating issue I ran into. When I tried to install the latest AMD driver for my RX 580, the screen of my windows guest would go black and I would never see the windows desktop again.

A common fix for this issue is changing to the Q35 chipset in your setup of your virtual machine 1. However, this did not completely fix my issue. Another thing I had to do to get the driver install working was setting up UEFI firmware on the virtual machine. Unfortunately, there was a bug that was introduced in the newer versions of libvirtd on arch that caused libvirtd to not recognize my installed OVMF 2. So after I made sure I had installed OVMF using this guide, I downgraded libvirtd to version 5.6.0.

Finally, I was able to create a new virtual machine in virt-manager (using UEFI and Q35 chipset), install windows in the virtual machine, and update my guest AMD GPU driver. Note: you can upgrade to the latest libvirtd after you have installed windows.

2 The Outer Worlds, the character takes forever to talk

This is a bug in the game but it's exasperated by me not using CPU pinning as described here: Archwiki - PCI passthrough via OVMF: Performance Tuning - CPU pinning

I have a AMD Ryzen 7 1700 and used 4c/2t AMD CPU example (Before ComboPi AGESA) from the CPU pinning guide. Setting up CPU pinning fixed this issue.

3 BIOS Version

3.1 AGESA 1.0.0.4 Fix

<2020-07-06 Mon>

AGESA 1.0.0.4 patch fixes the issues with AGESA 0.0.7.2. After enabling SVM and IOMMU in the bios with AGESA 1.0.0.4., make sure you change AER and ACS options in the bios from auto/disabled to enabled 3. You can find these options under peripherals -> AMD CBS in the AX370 gaming 5 bios.

3.2 Old Issue with AGESA 0.0.7.2

THIS IS THE OLD WAY TO FIX THIS ISSUE. DO NOT USE THIS METHOD

The AMD AGESA update 0.0.7.2 breaks VFIO 4. You can apply a patch to use the latest version of the Linux kernel and latest AGESA or you can downgrade AGESA.

I was patching and upgrading everything previously but I ran into an issue where the VFIO still didn't work after the patch. This might have been something only on my machine as I haven't seen other people complain. The recommended approach to fixing this issue is downgrading your BIOS 4. As such, I finally gave in and downgraded my host BIOS.

My host motherboard is a gigabyte GA-AX370-Gaming 5 (rev 1.0). The downgrade was as simple as downloading the zip (mb_bios_ga-ax370-gaming5_f31.zip) from the gigabyte website and flashing it via the host bios.

4 Speeding up the troubleshooting process

To troubleshoot these issues, I had to reinstall Windows approximately 10 times. To speed up the process, I made a copy of windows' qcow2 file on my host. Anytime windows would break, I would copy over the working copy before I tried something. Of course, this method only works if you have your chipset and UEFI firmware set correctly when you first created and installed windows on your virtual machine qcow2.

This is a very handy method to babysit windows. I am paranoid about when I have a solidworks project I'm working on and a Windows update breaks my system. This is the original reason I setup Windows in a VM.

Have a comment on one of my posts? Start a discussion in my public inbox by sending an email to ~anjan/public-inbox@lists.sr.ht [mailing list etiquette]

Articles from blogs I follow around the net

These articles/blogs do not represent my own opinions or views.

Linux development is distributed - profoundly so

The standard introduction to git starts with an explanation of what it means to use a “distributed” version control system. It’s pointed out that every developer has a complete local copy of the repository and can work independently and offline, often contra…

via Blogs on Drew DeVault's blog September 2, 2020

Eshell versus M-x shell

I’ve used and defended Eshell for years. Sadly, Eshell has some long standing issues that I grew tired of in the long run. So I’ve decided to switch to M-x shell and see how much of my Eshell workflow I could port. Language and the underlying shell pr…

via Pierre Neidhardt's homepage June 26, 2020

Thermoelectric Stoves: Ditch the Solar Panels?

Wood stoves equipped with thermoelectric generators can produce electricity that is more sustainable, more reliable, and less costly than power from solar PV panels.

via LOW←TECH MAGAZINE May 26, 2020

Generated by openring