[SOLVED] IOMMU passthrough vfio-pci

running:

grub2-mkconfig -o /etc/grub2-efi.cfg

returns message:

/etc/default/grub: line 6: rd.driver.pre=vfio-pci: command not found

but running:

modinfo vfio-pci

shows:

filename:       /lib/modules/4.18.8-200.fc28.x86_64/kernel/drivers/vfio/pci/vfio-pci.ko.xz
description:    VFIO PCI - User Level meta-driver
author:         Alex Williamson <[email protected]>
license:        GPL v2
version:        0.2
srcversion:     E46B6F702716FC27AA782E7
depends:        vfio,irqbypass,vfio_virqfd
retpoline:      Y
intree:         Y
name:           vfio_pci
vermagic:       4.18.8-200.fc28.x86_64 SMP mod_unload 
sig_id:         PKCS#7
signer:         
sig_key:        
sig_hashalgo:   md4
signature:      30:82:02:CF:06:09:2A:86:48:86:F7:0D:01:07:02:A0:82:02:C0:30:
		82:02:BC:02:01:01:31:0D:30:0B:06:09:60:86:48:01:65:03:04:02:
		01:30:0B:06:09:2A:86:48:86:F7:0D:01:07:01:31:82:02:99:30:82:
		02:95:02:01:01:30:70:30:63:31:0F:30:0D:06:03:55:04:0A:0C:06:
		46:65:64:6F:72:61:31:22:30:20:06:03:55:04:03:0C:19:46:65:64:
		6F:72:61:20:6B:65:72:6E:65:6C:20:73:69:67:6E:69:6E:67:20:6B:
		65:79:31:2C:30:2A:06:09:2A:86:48:86:F7:0D:01:09:01:16:1D:6B:
		65:72:6E:65:6C:2D:74:65:61:6D:40:66:65:64:6F:72:61:70:72:6F:
		6A:65:63:74:2E:6F:72:67:02:09:00:C3:F4:C6:54:5E:B4:F8:0E:30:
		0B:06:09:60:86:48:01:65:03:04:02:01:30:0D:06:09:2A:86:48:86:
		F7:0D:01:01:01:05:00:04:82:02:00:5F:B4:85:8B:D8:52:DD:3C:0C:
		8C:1F:D8:A0:CD:32:2E:5E:B4:63:0D:D5:55:52:6E:62:FB:51:72:2F:
		E5:4E:8A:65:07:F3:C0:93:08:03:88:6E:43:A6:10:C1:B8:90:99:5D:
		17:53:B6:E6:23:53:5B:EF:66:D2:25:57:F3:15:AC:6C:C1:36:8D:B5:
		D8:24:0E:F4:3E:08:04:8B:FC:0C:FF:78:E5:C4:BC:A8:B8:03:37:1E:
		BD:A3:A9:4A:62:08:D7:D1:EC:87:7D:5B:96:8A:43:B9:61:89:89:D0:
		35:F3:95:8B:8E:47:22:64:9F:C9:C3:3F:87:B5:D2:1A:47:00:38:C7:
		03:29:56:CB:6B:82:B9:B8:CD:00:B3:4F:81:36:91:2F:9C:30:17:0E:
		C4:A6:9C:6B:69:8A:D9:09:92:46:2C:06:30:74:1A:B7:AF:AE:2E:C4:
		5C:B0:24:DD:2C:74:7B:4C:6F:A8:30:14:C0:A2:61:2A:4E:26:CE:97:
		3B:D2:C5:7A:EF:1D:AD:E1:B6:FE:A1:8F:56:95:26:02:24:5A:EB:65:
		24:DE:B9:D4:85:2C:80:3F:C6:9F:7F:0A:48:F6:B8:62:B0:FC:94:78:
		09:45:3C:DD:9D:15:54:D5:43:3B:2F:84:88:92:1E:C9:79:06:C4:1C:
		FA:87:F7:F1:43:B2:54:D8:CF:3A:35:D1:4F:F9:3A:1B:ED:07:DA:92:
		AD:81:91:F0:B8:BB:52:75:05:39:EE:D0:86:01:EC:D4:31:B5:0D:C3:
		2C:38:D5:4E:E0:D3:93:5A:09:16:41:25:A0:B5:49:FE:0A:39:BD:2D:
		EA:55:AC:18:CE:2A:09:4C:1D:79:8F:25:3E:08:3D:20:52:5E:B2:FD:
		CC:B1:51:73:B4:82:60:9B:2F:2C:D8:3A:A1:C1:EC:86:10:39:A7:44:
		3C:7F:72:0D:FA:F4:98:DE:1F:98:0D:8E:D9:BF:50:AD:86:BE:6C:C1:
		E9:50:40:62:51:7D:C4:84:E5:8A:E2:01:5B:B4:6E:DD:EF:E6:71:38:
		13:87:28:A4:10:27:BC:C7:47:B5:AB:48:7E:AF:80:57:97:0E:20:DB:
		5E:E0:93:46:02:52:B6:86:C9:DF:91:D0:CB:E2:8C:30:00:E4:51:DA:
		29:48:A0:77:F3:52:E4:13:04:56:3A:88:0E:18:1F:17:96:D5:78:F3:
		FE:D9:1E:5C:44:57:AA:C7:E1:F1:34:84:12:E6:B9:D2:CA:A7:96:6A:
		B5:E4:72:61:BB:B6:CC:DD:DB:93:34:CF:B8:87:60:0D:5E:8F:16:8B:
		23:1A:55:3B:D6:08:08:B6:26:4A:74:2E:ED:45:58:B3:C8:58:2C:D2:
		7B:B8:69
parm:           ids:Initial PCI IDs to add to the vfio driver, format is "vendor:device[:subvendor[:subdevice[:class[:class_mask]]]]" and multiple comma separated entries can be specified (string)
parm:           nointxmask:Disable support for PCI 2.3 style INTx masking.  If this resolves problems for specific devices, report lspci -vvvxxx to [email protected] so the device can be fixed automatically via the broken_intx_masking flag. (bool)
parm:           disable_vga:Disable VGA resource access through vfio-pci (bool)
parm:           disable_idle_d3:Disable using the PCI D3 low power state for idle, unused devices (bool)

any suggestions?

What distro you are running and the contents of /etc/default/grub would be useful.

If you are trying to load the vfio-pci module, it should be put in modules(file name/location depends on distro), then update your initramfs.

If you are trying to isolate a gpu with vfio-pci then use vfio-pci.ids=id in grub.

1 Like

I’m using fedora 28, and basically went wendels fedora 26 recipe how to set it up, thats why I’m a little bit unsure whats going on, cause it seem pretty straight forward, searching on google didn’t give me any usefull results in the first 20 hits

cat /etc/default/grub

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved amd_iommu=on
GRUB_DISABLE_SUBMENU=false
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="resume=UUID=012d9466-2d6a-452b-910d-e86cfc5ec564 rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet rd.driver.blacklist=nouveau iommu=1 amd_iommu=on " rd.driver.pre=vfio-pci
GRUB_DISABLE_RECOVERY="true"

actually code highlighting shows it here wrong placement of ending "

:smiley: I better go into hiding right now. thanks for making me copy it, otherwise it would have taken me days to figure it out.

1 Like

Glad to help, minor syntax errors are sometimes the worst to troubleshoot but the easiest to fix.

Also, don’t forget to mark as solved.

1 Like