Score:1

Ubuntu 20.04 Unable to Login after PCI Passthrough

jp flag

Fresh install of Ubuntu 20.04 with Ryzen 5 5600x on a x570 + 2080 Super (passthrough) + HD 5670 (guest). My intent is to run 2 monitors for Ubuntu (native) through the Radeon HD 5670, and 1 monitor on Windows (vm) with the 2080 Super. IOMMU and virtualization IS set up (I've been runing emulators in Windows for a while). The problem I'm running into is, after I set the grub command line to "quiet amd_iommu=on iommu=pt kvm.ignore_msrs=1 vfio-pci.ids=<2080:graphics>,<2080:audio>" some text data still appears on the 2080 monitors, and the login on the 5670 freezes for roughly 5 seconds before flashing black, and returning to the login screen. Sometimes, CTRL+ALT+F3 causes it to freeze entirely, requiring hard reset. When I HAVE gotten into the terminal, I get spammed a message from the nvidia driver stating "Tried to insert a GPIO with zero lines". Uninstalling the nvidia drivers solved that, but still had issues logging in.

My best guess, is that Ubuntu is still trying to use the NVIDIA gpu, but gets an error, and crashes back to login.

  • Enable IOMMU in BIOS
  • Ensure at least 1 monitor is connected to each GPU
  • run "update && upgrade"
  • run "apt install qemu-kvm qemu-utils libvirt-daemon-system libvirt-clients bridge-utils virt-manager ovmf"
  • Edit Grub and add "amd_iommu=on iommu=pt" *iommu=1 is also recommended by a few guides
  • run "update-grub" and reboot
  • confirm IOMMU by running "dmesg |grep AMD-Vi"
  • confirm devices by running "lspci -nn" and target specific GPU and associated hardware
  • also note USB bus in the event of a GPU that supports USB-C
  • Edit Grub and add "vfio-pci.ids=0000:0000,0000:0001" where 0000:0000 is your graphics pci id, and 0000:00001 is your audio pci id
  • run "update-grub" and reboot
  • Confirm only GUEST gpu is rendering at the login screen
  • Attempt to log in (fails)

I've also tried software solutions found on mathiashueber.com which yielded the same results, but also prevented me from using the debugger mode to undo the results. I was forced to eject the GPU, or reformat. The Radeon HD5670 DOES work if it's the only GPU in the system. The problem ONLY arises when the NVIDIA is plugged in, and passed through. I'm vaguely curious is the problem could also be related to the fact that I want to run a display port between the 2080 Super and the 144hz monitor. It shouldn't, but it might could.

jp flag
Interesting to note, passing through the Radeon HD 5670 has no login issues at all, though it locks up the VM when attempting to launch after passing the PCI devices through.
Score:0
jp flag

Adding your PCI ID to the Grub list will force vfio-pci drivers for each and every device. Apparently, with the RTX 20 series cards, or most cards that come with USB-C, the GPU also supports HDMI over USB-C (for VR purposes) which lists as an additional device, and interferes with the login process. Adding ALL related PCI ID's to the GRUB will prevent them from loading, and allow a smooth transition into the OS. While you are not required to pass these through to the virtual machine, they MUST have the VFIO module loaded for them.

Additional note, most Radeon GPU's I've been able to test have failed to install cleanly with AMDGPU-PRO, which prevents the login screen from showing after other GPU's are passed through in GRUB. There appears to be some issues related to firmware(s), which I will have to look into. Using the Ubuntu drivers seems to work fine.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.