GPU not using the VFIO driver

Since new modules have been added to the initramfs configuration, you must regenerate the initramfs. Should you change the IDs of the devices in /etc/modprobe.d/vfio.conf , you will also have to regenerate it, as those parameters must be specified in the initramfs to be known during the early boot stages.

That’s directly pasted form the following Arch Wiki page:
https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF#With_vfio-pci_loaded_as_a_module

So how do I do that?

This, and the other topic I made about UEFI not being available in virt-manager when I create a VM with QEMU is preventing me from using my Nvidia card with the VFIO driver to passthrough my Nvidia GPU to the VM.

It depends on distro. I presume that you are using opensuse as per your other post. On opensuse dracut is used to manage the initramfs. Run sudo dracut -f to regenerate it and then overwrite the current one. Run man dracut to see more options.

1 Like

If your on Arch it’s mkinitcpio. I’ve never dealt with VMs so I can’t help you on your other question.

O.K. that worked but I’ll need to test it. Hopefully I’ve configured the other parts correctly.

1 Like

tim@linux-lgui:~> sudo lspci -nnk -d 10de:2182
[sudo] password for root:
05:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:XXXX] (rev a1)
Subsystem: eVga.com. Corp. Device [3842:XXXX]
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia
tim@linux-lgui:~>

Did you reboot? It will not take effect till after a reboot.

sudo mkinitcpio -P && sudo grub-mkconfig -o /boot/grub/grub.cfg

I don’t have the mkinitcpio command on opensuse but the VFIO driver is also not listed in the kernel modules for the lspci command.

So I need to get VFIO into the kennel. Thank you for the assistance so far.

Edit: Here’s my grub default config file:

GRUB_TIMEOUT=12
GRUB_CMDLINE_LINUX_DEFAULT=“splash=silent
resume=/dev/disk/by-id/ata-Hitachi_HDT721032SLA380_STA207MC26MATB-part6 quiet
intel_iommu=on vfio-pci.ids=10de:2182,10de:1aeb mitigations=auto”
GRUB_CMDLINE_LINUX=""

I’m not sure if you all can tell by the way it was copied but there were THREE spaces before the intel_iommuadditions, so I’ve since deleted two spaces and I’ll update.

Edit2: Deleted (I thought) the Nvidia AND parts of nouveau driver, but the command for lspci -nnk still shows the “nvidia” driver being used, without VFIO in the list of available modules:

05:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:2182] (rev a1)
Subsystem: eVga.com. Corp. Device [3842:1261]
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia

O.K. I’m slightly closer–now the Nvidia GPU driver is blacklisted in the grub configuration:

indent preformatted text 05:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [10de:2182] (rev a1)
    Subsystem: eVga.com. Corp. Device [3842:1261]
    Kernel modules: nouveau, nvidia_drm, nvidia

So how do I get it to use the VFIO driver still? Yeah I’m stuck on this.

Looks like for opensuse it’s
sudo mkinitrd

For vfio, I know on arch what usually works is just creating a modprobe.d file in /etc/modprobe.d/ . Example: /etc/modprobe.d/vfio.conf , then in the file put " options vfio-pci ids=10de:17c8,10de:0fb0 " where your “10de…” is your pci ids for your card found by sudo lspci -nn

I did that too but it’s not effective–I think I have VFIO built into the kernel and I have no idea what to do.

if it’s built into the kernel then you’ll definitely be able to load it as a mod. Looks like modprobing is a bit different on opensuse: https://software.opensuse.org/package/module-init-tools

I’ll ask on the OpenSUSE forums for this specific of a setup, thanks, it lets me know what to ask there.