VFIO in 2019 -- Pop!_OS How-To (General Guide though) [DRAFT]

yes iommu and svm are enabled
If I put only one card in either in the first slot or in the second one everything works but as soon as I plug in the secoond one if I try to black list the first slot no more image

do you think a clean install of a linux host would do the trick?

here the result of the initramfs update

One more dumb question but I can’t find a way to update my pcie addresses

I know I’m going through some of the more rudimentary steps but:

What’s the output of lstopo

When you updated the kernel did you patch it for ACS override?

You shouldn’t if you follow this guide, but some guides I’ve read include it for the sake of having it which can falsely expose isolation capiabilities of various components.

your kernel boot options need to include:
amd_iommu=on iommu=pt

ensure that vfio-pci has loaded correctly:
dmesg | grep -i vfio

check what is happening with the particular card:
lspci -nnk -d <device id>

If you want to get rid of the missing firmware errors, consider cloning git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git and copying the missing files to /lib/firmware/amdgpu.

Have you tried Q35-4.0 instead of 3.1? I don’t suspect it will change anything, but it will rule out some kind of weird interplay between things.

And yeah, a fresh install should fix the new graphics card weirdness, but I have a feeling there’s a setting you haven’t changed that’s causing the problem. I don’t suspect it will fix your VM performance issue, but may be re-doing it will trigger us to configure something that wasn’t done the first time around and thus fix your problem?

One more dumb question but I can’t find a way to update my pcie addresses

To fix that, you need to follow the details in the guide in “The Initial Ramdisk and You

the grub file is ok
here is the output of dmesg | grep -i iommu

I’m currently using the machine with only one card in the second slot here the output of lspci -vnn

the second slot adress is 0a:00.0 and 0a:00.0 and the first slot address is 42:00.0 42:00.1lspci.txt (20.1 KB)

here is lstopo

I’m going to try a fresh install of pop 19.04 and follow the guide once more with a clean slate
I’ll keep you posted on the outcome

If you have set up your system to boot as UEFI, disable CSM in BIOS.
This usually reverse the order in which boot GPU is chosen.
Should help resolve your problem with no output.

Little update

So after fresh Pop_OS 19.04 install and following the guide to a T everything seems to be working properly in the VM now.
The funny thing though is that the pcie addresses are still the same and I still could not passthrough any card on the first slot.
Any way thanks to everyone who took the time to look into the matter!

2 Likes

Glad it’s working! Kind of frustrated we didn’t find out the issue, but I’m happy that it worked.

1 Like

What would be the best way to mirror this thread and start a Fedora version for 2019? It is so nicely segmented and we could keep a Fedora specific mirror.

Copy paste? Start a thread link me and I’ll copy paste the source for you ?

1 Like

you could get inspired by “my” EOS / Ubuntu 18.04 guide, which is originally wendells tutorial, but updated and more segmented into one post per section.

its easier to navigate and you can link to certain post and have it in tabs in browser, for example. But i still had to write it all manually on a side on second PC as i was going through it and testing it at the same time

i actually got this USB pci-e card (if the link loads in Czech, top right is language switch)

https://www.alza.cz/EN/axagon-pceu-43v-d5263398.htm

it works just fine, when VM is off, USB devices are usable in host, when i turn it VM on, it switches to VM and when VM goes back offline, it switched back to host OS just fine :slight_smile:

apparently Via chipset

Okay, VIA chipset is a HUGE gamble, because some of the latest firmwares have no issues, but most VIA controllers use older firmware which means when you add the kernel argument for IOMMU, the whole controller fails, regardless of being passed through or not.

You got EXTREMELY lucky you have a newer firmware on that VIA controller.

1 Like

There is a firmware update utility floating around for Via usb controllers, I think you have to email Via for it tho, I did not find an official download.

Which means you have to trust a random Dropbox link that could be infected with something.

NO THANKS.

@wendell and for anyone on Pop!_OS 19.04 and beyond adding IOMMU to the grub is done by using this command:

sudo kernelstub -a "intel_iommu=on"

And to see what boot options are used use:

sudo bootctl status

If you want to remove the boot option use:

sudo kernelstub -d "intel_iommu=on"

I found it on some forum and used it myself when i was messing around with Pop!_OS.

1 Like