I think this more true that you meant. Later you must have update grub.cfg either manually or unintentionally.
Notes:
Use any of these if you want.
Checking if you have booted with correct options:
cat /proc/cmdline
My output:
BOOT_IMAGE=(hd0,gpt2)/vmlinuz-5.9.11-200.fc33.x86_64 root=UUID=aa16dfce-be02-4f48-a32d-ee26ae99a48d ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau resume=UUID=ee7a7237-a530-4c37-8c62-79b33ddef287 rhgb intel_iommu=on vfio-pci.ids=8086:a2af,10de:1b80,10de:10f0
Making sure your config is correct before you reboot
sudo grubby --info=DEFAULT | egrep --color '^|intel_iommu=on|amd_iommu=on|rd.driver.pre=vfio-pc'
My output:
index=0
kernel="/boot/vmlinuz-5.9.11-200.fc33.x86_64"
args=“ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau resume=UUID=ee7a7237-a530-4c37-8c62-79b33ddef287 rhgb intel_iommu=on vfio-pci.ids=8086:a2af,10de:1b80,10de:10f0 isolcpus=1,2,3,5,6,7”
root=“UUID=aa16dfce-be02-4f48-a32d-ee26ae99a48d”
initrd="/boot/initramfs-5.9.11-200.fc33.x86_64.img"
title=“Fedora (5.9.11-200.fc33.x86_64) 33 (Workstation Edition)”
id=“ece237a53a024f1da19a8444d8979947-5.9.11-200.fc33.x86_64”
As you can see:
- I have intel_iommu=on because I am on Intel
- I am missing forcing the preload of VFIO driver rd.driver.pre=vfio-pc
Adding arguments the old fashion way
Adjust the line in /etc/default/grub
and save it.
This will not update the config, it needs to be applied.
sudo [ -e "/boot/grub2/grub.cfg" ] && sudo grub2-mkconfig -o /boot/grub2/grub.cfg;
sudo [ -e "/boot/efi/EFI/fedora/grub.cfg" ] && sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
This will generate config manually, you can already guess this is clumsy. You could use find
instead.
My suggestion - use grubby
Grubby allows to check and update individual kernel options as well as update default ones.
Setting up IOMMU kernel parameters
Because I am on AMD, run the following:
sudo grubby --update-kernel=ALL --args="amd_iommu=on rd.driver.pre=vfio-pc"
In order to confirm we are on the right track:
sudo grubby --info=DEFAULT | egrep --color '^|intel_iommu=on|amd_iommu=on|rd.driver.pre=vfio-pc'
You will see a line with all kernel parameters and your modules should be highlighted:
…
args=" … rhgb amd_iommu=on rd.driver.pre=vfio-pc"
…
Your /etc/default/grub
has been updated automatically.
If you have made a mistake then you can run the following: (In this example adding only pre=vfio-pc
instead of the full rd.driver.pre=vfio-pc
)
sudo grubby --update-kernel=ALL --remove-args="pre=vfio-pc"