Return to Level1Techs.com

GPU not using the VFIO driver

#1

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.

0 Likes

#2

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

#3

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

0 Likes

#4

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

1 Like

#5

[email protected]:~> 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
[email protected]:~>

0 Likes

#6

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

0 Likes

#7

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

0 Likes

#8

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

0 Likes

#9

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.

0 Likes

#10

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

0 Likes

#11

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.

0 Likes

#12

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

0 Likes

#13

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

0 Likes