OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
apps-services high occasional DISPUTE

Fix VFIO GPU passthrough failing with "group is not viable"

archomarchyendeavouroscachyosmanjarokvmlibvirtnvidiadesktop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Checked on this Omarchy 4 workstation (omarchy 4.0.2-1, mkinitcpio 41.1-1, limine-mkinitcpio-hook 1.37.1-1, kernel 7.1.9, RTX 3090) and against the cited Arch wiki page fetched as raw wikitext. The generic VFIO content held: the group-listing script is byte-for-byte the wiki's, the 10de:13c2 / 10de:0fbb pair is the wiki's own example group 13, intel_iommu=on for Intel with nothing needed for AMD-Vi is still what the wiki says, vfio_pci vfio vfio_iommu_type1 with vfio_virqfd absent since 6.2 is current, and the root-port and ACS-override warnings match the wiki notes. I confirmed the exact error string in QEMU source at hw/vfio/container-legacy.c line 796, which the wiki does not carry. Three Omarchy 4 claims were wrong. First, sudo mkinitcpio -P cannot work here: /etc/mkinitcpio.d/ is empty (ls on this machine, and pacman -Ql linux ships no preset), and /usr/bin/mkinitcpio line 986 does [[ -e "${_optpreset[0]}" ]] || die 'No presets found in %s', so the command dies and writes no boot image. The rebuild is limine-mkinitcpio, which runs /usr/share/libalpm/scripts/limine-mkinitcpio-install. Second, the instruction to put intel_iommu=on on the cmdline: line of /boot/limine.conf is wrong on Omarchy: /usr/lib/limine/limine-common-functions sets LIMINE_CONFIG_PATH="${ESP_PATH}/limine.conf" and the tool regenerates it, and ENABLE_UKI=yes in /etc/limine-entry-tool.d/omarchy-uki.conf means the command line is embedded in the UKI, so a drop-in under /etc/limine-entry-tool.d/ with += is the only place it persists. This agrees with the existing corpus record limine-kernel-parameters-not-applying-omarchy rather than contradicting it. Third, "make sure modconf is in your HOOKS" points at the wrong file: /etc/mkinitcpio.conf is package-stock here and /etc/mkinitcpio.conf.d/omarchy_hooks.conf sets HOOKS= wholesale, so editing the former has no effect. I also found a new Omarchy-specific trap the record could not have known: mkinitcpio line 1121 concatenates /etc/mkinitcpio.conf.d/*.conf in sort -V order, and I verified with sort -zVu that vfio.conf sorts after nvidia.conf, so the wiki's requirement that VFIO modules precede an early-KMS driver is violated unless the drop-in is named to sort first, hence 00-vfio.conf. The danger field's "known-good Limine/GRUB fallback entry" does not exist on Omarchy: MKINITCPIO_FALLBACK is commented out in /etc/limine-entry-tool.conf and limine-list prints only linux under Omarchy plus EFI fallback, which is the Limine binary on the removable-media path, not a separate initramfs. I could NOT exercise any of the binding: ls /sys/kernel/iommu_groups/ | wc -l is 0 on this workstation, so IOMMU is off in firmware here, and I have no sudo and ran nothing that touches modules, initramfs or the bootloader. The wiki's own note that nvidia modesetting forces the ids into the initramfs is confirmed as applying here, because /etc/modprobe.d/nvidia.conf contains options nvidia_drm modeset=1 and /etc/mkinitcpio.conf.d/nvidia.conf early-loads nvidia_drm. The KVM and Libvirt wiki pages were fetched and support none of the record's claims (grep for vfio or iommu returns nothing in Libvirt and only an incidental lsmod paste in KVM), so they are removed in favour of the Limine wiki and the QEMU source.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

This is the record most likely to leave you staring at a black screen. Once vfio-pci claims a GPU it is unusable by the host, so binding the only GPU, or the one your monitor is plugged into, means the desktop does not come up after reboot. Set the motherboard to display from the *host* GPU first, and keep a way in.

On Omarchy 4 there is no fallback kernel entry to fall back to. MKINITCPIO_FALLBACK is left commented out in /etc/limine-entry-tool.conf, so limine-list shows one entry per kernel plus EFI fallback, which is the Limine binary on the removable-media path and boots the same image with the same command line. The recovery routes that do exist are the Snapshots submenu limine-snapper-sync writes into the Limine menu, and booting the Arch or Omarchy ISO to arch-chroot in, rename /etc/modprobe.d/vfio.conf and /etc/mkinitcpio.conf.d/00-vfio.conf, then rerun limine-mkinitcpio and limine-update. Have ssh from another machine as well.

Since kernel 6.0 the framebuffer freezes once VFIO loads and before GPU drivers do, which hides the LUKS passphrase prompt on encrypted systems. If your root is encrypted, add your host GPU driver to the initramfs too, or use the modprobe.d method rather than the initramfs one. The ACS override patch deliberately breaks PCIe isolation and has real security implications.

Symptom

Starting the VM with a passed-through GPU fails with:


vfio: error, group 13 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver.

Or /sys/kernel/iommu_groups/ is empty, or lspci -nnk still shows Kernel driver in use: nvidia / amdgpu for the card you meant to pass through.

Cause

An IOMMU group is the smallest unit that can be handed to a VM. Every device in the group must be bound to vfio-pci. If the GPU's HDMI audio function, a USB controller, or a PCIe root port shares the group and is still on its normal driver, the group is "not viable". An empty iommu_groups directory means IOMMU (Intel VT-d / AMD-Vi) is not enabled at all.

Fix

First confirm IOMMU is on:


sudo dmesg | grep -i -e DMAR -e IOMMU | head
ls /sys/kernel/iommu_groups/ | wc -l

kernel.dmesg_restrict = 1 on Omarchy 4, so dmesg needs sudo.

If the count is 0, enable VT-d or AMD-Vi in firmware, and for Intel add the kernel parameter intel_iommu=on. AMD needs no parameter, the kernel enables AMD-Vi automatically when the firmware advertises it. Where that parameter goes depends on the bootloader.

**Omarchy 4 (Limine plus a UKI).** Do not edit /boot/limine.conf. limine-entry-tool regenerates it on every kernel or limine transaction, and Omarchy boots a Unified Kernel Image (ENABLE_UKI=yes in /etc/limine-entry-tool.d/omarchy-uki.conf) whose command line is baked into the .efi file, so a limine.conf edit could not change it even if it survived. Add your own drop-in that sorts after Omarchy's omarchy-defaults.conf, and always append with +=:


sudo tee /etc/limine-entry-tool.d/zz-local.conf >/dev/null <<'EOF'
KERNEL_CMDLINE[default]+=" intel_iommu=on"
EOF
sudo limine-mkinitcpio
sudo limine-update

A bare = there replaces Omarchy's own defaults instead of adding to them.

**Plain Arch with systemd-boot:** the options line in /boot/loader/entries/*.conf.

**Plain Arch with GRUB:** GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub, then sudo grub-mkconfig -o /boot/grub/grub.cfg. Omarchy 4 has no /etc/default/grub.

Reboot, then list the groups:


#!/bin/bash
shopt -s nullglob
for g in $(find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V); do
    echo "IOMMU Group ${g##*/}:"
    for d in $g/devices/*; do
        echo -e "\t$(lspci -nns ${d##*/})"
    done
done

Every non-bridge device in the target group must go to vfio-pci. Take the [vendor:device] IDs from that output (the wiki's example group 13 is 10de:13c2 for the GPU and 10de:0fbb for its audio function) and bind them early:


sudo tee /etc/modprobe.d/vfio.conf >/dev/null <<'EOF'
options vfio-pci ids=10de:13c2,10de:0fbb
softdep drm pre: vfio-pci
EOF

If the proprietary NVIDIA driver is installed, use softdep nvidia pre: vfio-pci instead of softdep drm pre: vfio-pci. Do **not** bind a PCIe root port or bridge that happens to share the group, it has to stay on the host.

Then put the modules in the initramfs. On plain Arch that is the stronger of the two methods. On an Omarchy machine with the NVIDIA driver it is **required**, because Omarchy early-loads nvidia_drm with modeset=1 (MODULES+=(nvidia nvidia_modeset nvidia_uvm nvidia_drm) in /etc/mkinitcpio.conf.d/nvidia.conf, plus options nvidia_drm modeset=1 in /etc/modprobe.d/nvidia.conf), and the wiki notes that with nvidia modesetting the vfio-pci ids must be embedded in the initramfs image rather than passed on the kernel command line.

**Omarchy 4.** The drop-in filename matters. mkinitcpio concatenates /etc/mkinitcpio.conf.d/*.conf in sort -V order before sourcing them, so a file called vfio.conf is read *after* nvidia.conf and the VFIO modules would land behind nvidia_drm in MODULES. The wiki requires every VFIO module to precede an early-modesetting driver, so name the file so it sorts first:


sudo tee /etc/mkinitcpio.conf.d/00-vfio.conf >/dev/null <<'EOF'
MODULES+=(vfio_pci vfio vfio_iommu_type1)
EOF
sudo limine-mkinitcpio
sudo limine-update

sudo mkinitcpio -P does **not** work on Omarchy 4. /etc/mkinitcpio.d/ is empty, so mkinitcpio exits with No presets found in /etc/mkinitcpio.d and writes no boot image, leaving you rebooting into the old one. limine-mkinitcpio is the rebuild.

modconf is already in Omarchy's HOOKS, and modconf is what copies /etc/modprobe.d/ into the image. Check it in the drop-in that actually sets HOOKS, not in /etc/mkinitcpio.conf, whose HOOKS= line that drop-in overwrites wholesale:


grep -o 'modconf' /etc/mkinitcpio.conf.d/omarchy_hooks.conf

**Plain Arch.** Add the modules to MODULES in /etc/mkinitcpio.conf (or a drop-in sorting before any early-KMS drop-in), make sure modconf is in HOOKS, then rebuild:


sudo mkinitcpio -P

Reboot and verify the binding:


lspci -nnk -d 10de:13c2
# want: Kernel driver in use: vfio-pci

If the group still holds devices you cannot pass (a shared root port), move the card to a different PCIe slot before considering the ACS override patch (linux-zen plus pcie_acs_override=downstream,multifunction), which weakens device isolation.

Verify

cat /proc/cmdline shows intel_iommu=on (Intel only), ls /sys/kernel/iommu_groups/ | wc -l is non-zero, lspci -nnk shows Kernel driver in use: vfio-pci for every non-bridge device in the target IOMMU group, and the VM starts with the GPU attached.

Sources

vfio-gpu-passthrough-group-not-viable