Help with Pop_OS boot arguments for VFIO

I’m following this guide: https://heiko-sieger.info/running-windows-10-on-linux-using-kvm-with-vga-passthrough/#AMD_Ryzen_3000_Considerations

And I did everything but accidentally skipped the boot arguments part. So naturally I went to edit /etc/defaults/grub and theres nothing in there. I assume that I have to edit something in systemd-efi-boot whatever but IDK how or where the hell I’m supposed to look. Is it a file in the ESP?

I have EEEEEEEEEEEEEEEEEEEEVERYTHING ready and set to go. I literally just need amd_iommu=on

Never mind I went digging. The file I was looking for is in /boot/efi/loader/entries

1 Like

Actually no nener mind. The damn thing isn’t binding to vfio still.b i hane svm and iommu enabled, and I krow all of nhe parts I have are literallf plug and play for this shit. Did I do the boot flag wrong? Help! I’m so close!

Did you set vfio to have a softdep on the normal driver?

I just followed that guide.

Wat?

If you’re meaning the nvidia driver, its not installed.

Something like
softdep amdgpu pre: vfio vfio_pci or softdep nouveau pre: vfio vfio_pci

in

/etc/initramfs-tools/modules

then update initramfs and reboot

Its a better option then blacklisting the driver module.

1 Like

When I do lsmod | grep vfio

I get nothing back. What do I do?

Were you able to set the boot argument(s) in your entries file?
The archwiki entry on systemd-boot#adding_loaders is a great resource.

To bind the graphics card + audio you can do it in a boot argument or by a modprobe like in the guide you linked. (Part 4.)

To do it by a boot argument follow the guide at Archwiki - PCI_passthrough#Binding-vfio-pci_via_device_ID

2 Likes

You have put vfio_pci and whatnot in /etc/initramfs-tools/modules and then done update-initramfs -u -k all and rebooted?

-u yes not -k all

-k all just updates all kernels, not just your booted kernel. Shouldn’t make a difference.

Ok, I’m stumped.

1 Like

I did it exactly as in the guide, editing what files it dictated as important. I also added the iommu flag to my entries file, yes. Would it hurt to add the vfio entries to the loader as well? Would having the flag pop up twice for vfio screw anything up?

It looks like the iommu settings dids’t stay in the efi file. Is there something I’m supposed to run similar to update-grub or should I ebpect it to stay? D hase 800mb of space in my efi file, 299mb taken up.

Edit 1: Yeah I just rebooted again and it reverted. Whats up with that?

Edit 2: Ok apparently doing sudo reboot 1 wipes those settings for some reason even though I saved and exited nano and closed the window. Ok linux.

Bug report?

But the grep vfio thing still doesn’t pop anything up. But, as I look in lspci -v, nothing for my 970 pops up either, though a pci bridge does in its place. So its getting grabbed by the vfio system but the vfio system isn’t posting? Or something? All my settings are correctly saved now… Any ideas?

Have you ran “bootctl update” after you edit the entries-file? I think it’s similar to update-grub.

bootctl must be used to update systemd-boot .

Archwiki Systemd-boot#Updating_the_EFI_boot_manager

Aaaaaaaaaayyyyyyyyy thats what I needed. I bet’ll work now. Not at home tho.

Still nothing fr the VFIO grep. Did the update command.

Ouch - I wonder… Does

dmesg | grep iommu

return anything of value?

Could you be so kind and pastebin us these files:

/etc/initramfs-tools/modules
/boot/efi/loader/entries

Also make sure that AMD-V and IOMMU are enabled in your bios. (Consult your mobo’s manual for these)

Oh, yeah that comes back fine. Its just everything vfio seems to be… Do I have to start something in systemd?

https://pastebin.com/2sgY3msB

Been turned on since I built the machine.

You need to specify the device(s) you wish to bind to vfio-pci in modules file via device ID as described in: Archwiki PCI_passthrough#Binding_vfio-pci_via_device_ID

I’m not entirely sure if device ID’s need to be added to boot arguments aswell but I have them in both files so to be sure I’d modify both

/etc/initramfs-tools/modules
/boot/efi/loader/entries

in modules “vfio_pci ids=10de:1004,10de:0e1a”
in entries “vfio-pci.ids=10de:1004,10de:0e1a”
using your own id’s

“rd.driver.pre=vfio-pci” added to your boot arguments will make the kernel use vfio-pci when booting before any other drivers are tried (nvidia, nouveau) in your case you have blacklisted both but I’d add it just to be sure.

1 Like

I found a typo. I bet that was it lol.

I will put the ids in anyways.

That didn’t do anythitg from what I can tell. I noticed the gpu doesn’t even pop up in lspci or by id anymore tho…

1 Like