I would like to passtrough a GPU but I sometimes still need it on the host. How can I add a grub entry with the vfio-pci kernel parameter? So the goal is to have in the grub menu : Advanced options for Manjaro > Linux54, Linux54-fallback and Linux54-GPU-passtrough.
/etc/default/grub
GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR='Manjaro'
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 lsm=yama,apparmor resume=UUID=7f0696c8-a732-4471-935d-6d154ab355cf noacpi mitigations=off intel_iommu=on"
GRUB_CMDLINE_LINUX=""
# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
#Disable submenu
#GRUB_DISABLE_SUBMENU=y
For those wondering I fixed it by adding export GRUB_CMDLINE_LINUX_DEFAULT_1="quiet apparmor=1 i915.enable_gvt=1 kvm.ignore_msrs=1 intel_iommu=on vfio-pci.ids=8086:1901,10de:1c8d,10de:0fb9"
or whetever kernel parameters you need, in /etc/default/grub.
Then in /etc/grub.d/linux.10
linux_entry β${OS} (vfio)β β${version}β simple\
β${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT_1}β
Under another linux_entry.
Youβll have to that on nearly every system updates.
Cheers