fix second iommu
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
# 1) Make sure vfio and vfio_pci are in the initrd
|
||||
boot.initrd.kernelModules = [ "vfio" "vfio_pci" ];
|
||||
# 1) Make sure modules are available early so the probe can succeed
|
||||
boot.initrd.kernelModules = [ "vfio" "vfio_pci" "vfio_iommu_type1" "ahci" ];
|
||||
|
||||
# 2) Also load them again in the running system
|
||||
boot.kernelModules = [ "vfio" "vfio_pci" ];
|
||||
boot.kernelModules = [ "vfio" "vfio_pci" "vfio_iommu_typoe1" "ahci" ];
|
||||
|
||||
# 3) Kernel params to turn on IOMMU and bind your card to vfio-pci
|
||||
boot.kernelParams = lib.mkForce [
|
||||
@@ -22,13 +22,23 @@
|
||||
|
||||
# helps isolate PCIe ports if your card shares groups
|
||||
"pci_acs_override=downstream,multifunction"
|
||||
|
||||
# <<< the important bit: early vfio binding for 1b4b:9215 >>>
|
||||
"vfio-pci.ids=1b4b:9215"
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||
|
||||
# Bind per-device via udev using driver_override and drivers_probe
|
||||
services.udev.extraRules = ''
|
||||
# Bind 0000:09:00.0 to vfio-pci
|
||||
ACTION=="add", SUBSYSTEM=="pci", KERNEL=="0000:09:00.0", \
|
||||
ATTR{driver_override}="vfio-pci", \
|
||||
RUN+="/bin/sh -c 'modprobe vfio-pci; echo 0000:09:00.0 > /sys/bus/pci/drivers_probe'"
|
||||
|
||||
# Bind 0000:08:00.0 to ahci (host)
|
||||
ACTION=="add", SUBSYSTEM=="pci", KERNEL=="0000:08:00.0", \
|
||||
ATTR{driver_override}="ahci", \
|
||||
RUN+="/bin/sh -c 'modprobe ahci; echo 0000:08:00.0 > /sys/bus/pci/drivers_probe'"
|
||||
'';
|
||||
|
||||
boot.kernel.sysctl."net.ipv4.conf.all.forwarding" = true;
|
||||
|
||||
swapDevices =
|
||||
|
||||
Reference in New Issue
Block a user