Pop!_OS 20.10: VFIO + 5700xt Pain

Hey guys! Before I dive into my primary question/problem, let me provide my specs, as well as some quick context into the goal for this system.

Specs:

  • Threadripper 2950X 16 Core
  • AsRock X399 Taichi
  • 64GB Vengeance DDR4
  • 1 x NVidia GTX 980Ti (to be used as host GPU)
  • 1 x AMD Radeon 5700XT (to be passed through to guest)

I would (ideally) love to run Pop!_OS or Manjaro as my host OS, in addition to either a macOS or a Windows 10 VM. macOS and Windows VM’s wouldn’t be run simultaneously; I’d turn one VM or the other on depending on whatever task that Linux couldn’t handle (Final Cut Pro editing, vs. gaming for example)

Here’s where I’m at. I have Pop!_OS 20.10 up and running with the 980ti as the boot GPU. I’m using the default systemd-boot bootloader, rather than grub. Based on my research, vfio currently can work with this configuration (and is more efficient/secure than GRUB.) I have the following options when issuing sudo kernelstub -p:

Kernel Boot Options:.quiet loglevel=0 systemd.show_status=false splash amd_iommu=on vfio.pci-ids=1002:1478,1002:1479,1002:731f,1002:ab38

These pci.ids are the following devices (all from the NAvi 5700xt):

  • 0a:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] [1002:731f] (rev c1)
    
  • 0a:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio [1002:ab38]
    
  • 08:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch [1002:1478] (rev c1)
    
  • 09:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch [1002:1479]
    

As far as I can tell, the GPU is being taken over by vfio, as I’m showing vfio-pci as the kernel driver, and plugging an HDMI into it results in no display. Here’s my problem, and where things get weird.

I’ve installed Windows 10 without any kind of passthrough, gotten past the installer and am booted into the desktop. Once I pass through my GPU, the VM will boot to the desktop, however, it’s as if the GPU isn’t being passed through “all the way”. What I mean by that is, if I go into Device Manager, I only see “Microsoft Basic Display Adapter”. If I attempt to install the AMD video drivers, I get the message that the system doesn’t meet the criteria for installation. It really seems like even though the GPU is passed through, despite me getting (very low res) picture on the physical monitor attached to the 5700xt, the AMD drivers aren’t actually detecting that it’s a 5700xt GPU.

I’ve passed this GPU though to macOS and Windows guests via Promox on this exact system, so while that’s a different scenario, I know passthrough with this hardware definitely can work.

Here’s some additional things I’ve added to my Windows VM configuration (can’t seem to format them exactly as they are in the VM’s config file):

rom bar = 'on' file='/usr/share/vgabios/XFX.RX5700XT.RawII.rom'

vendor_id state='on' value='spoofed_id

hidden state='on'

I haven’t gotten as far as trying Manjaro, or a macOS guest, but Windows should be far more simple than macOS, lol. I’m not even getting as far as an ‘Error 43’ scenario; it simply seems like my GPU isn’t truly being passed though to this guest, and I can’t seem to figure out why.

Does anyone have any additional insight to what’s going on here? Any help is greatly appreciated!

Thank you for your time!

Rob

1 Like

Fellow 5700 XT owner here, I’ve gotten my gpu passthrough to work via only ever passing through the “Vga compatible controller” group and the “Audio device”; In all the guides I’ve watched and threads I’ve read, I’ve never seen anyone passthrough the “Upstream” and “Downstream” port parts of it.

Maybe that’s causing the issue?

1 Like

Last time I did passthrough, though with a different GPU, those were the only groups I passed as well (VGA and audio).

Thanks for the feedback guys!

So I ended up resolving this one, still not quite sure what the reasoning is, but the Windows version I was installing was Enterprise LTSC. On my bare metal install, the AMD drivers install totally fine on that OS, but for some reason, when in a kvm, it simply won’t install the AMD drivers. Instead, I installed Windows 10 Pro and boom - the drivers installed straight away. Not sure why there’s a difference here, but alas, I have full graphics…

However, as you guys also suggested, I passed through ONLY the audio/video portions of the card, and not the up/downstream ID’s. In either event on LTSC, this didn’t help, but definitely verified they aren’t required to be passed through.

With that, my system is 99% complete! I have both a Windows 10 Pro and a macOS 10.15.7+OC guest, both with full graphics acceleration via the 5700xt.

The 1% I don’t have complete is my Synergy setup. I attempted to create a bridge on my secondary NIC and pass that though to the guest VM, which puts the VM on the correct subnet. I’m aware that direct guest to host communication usually doesn’t function in this scenario, but for what it is, I’m cool with the communication needing to go out/back into the host; I ideally would love linux on the left screen, and windows on the right, both with full graphics (no RDP), and sharing a single keyboard/mouse. (hopefully without needing to invest in a hardware KVM, which I know would be the ultimate, better solution). I wish I could just pass through my second NIC, but it’s in the same IOMMU group as my SATA controller (booting linux from), the primary NIC, among 1-2 other things :frowning:

However, I’m definitely pretty happy now! I got Pop!_OS working here, which I really preferred since it’s Debian/Ubuntu based. This forum rocks; Wendell and all of you guys are a real inspiration and the reason why I’ve seen the light of Linux!

1 Like

My ears perked up when you said that. Do you have any recommendations for good guides how to setup MacOS in KVM? Also congratulations on your awesome setup!

What I did was use the Foxlet method, with some of my own modifications to use Opencore rather than Clover. If you don’t know, the Foxlet method can be found here:

You can do ./jumpstart.sh --catalina to fetch the Catalina basesystem, create the virtual disk & add it to the config, then go through the installation. (detailed instructions found at the above link :wink: )

Once done, you can do ./make.sh --add to add the config to virt-manager. From there, if you wish to just use Clover, you can proceed with passing through your hardware and pretty much be on your way. However, what I did instead was mount the ESP.qcow2 EFI disk on my Pop!_OS host, and instead, drop in my Opencore configuration, complete with generated serialnumber/smbios/MLB/ROM for full iCloud/iMessage functionality.

Whichever bootloader you use, the Foxlet method is pretty great and is relatively low effort. If you wanted to, you could even pass through an NVMe controller/disk once it’s in Virt-manager, and install the OS to the physical disk for even better performance.

1 Like