Last active
May 28, 2025 18:26
-
-
Save jchv/b0e4b39679e450536a17cc6a5d69169a to your computer and use it in GitHub Desktop.
Revisions
-
jchv revised this gist
Feb 11, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ { config, pkgs, lib, ... }: { # IOMMU configuration -
jchv revised this gist
Feb 11, 2019 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ { ... } { # IOMMU configuration boot.kernelParams = [ "amd_iommu=on" "pcie_aspm=off" ]; boot.kernelModules = [ "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; @@ -28,4 +31,5 @@ group = "kvm" ''; }; }; } -
jchv created this gist
Feb 11, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ # IOMMU configuration boot.kernelParams = [ "amd_iommu=on" "pcie_aspm=off" ]; boot.kernelModules = [ "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; boot.extraModprobeConfig = '' options vfio-pci ids=10de:13c2,10de:0fbb options kvm ignore_msrs=1 ''; boot.postBootCommands = '' # Enable VFIO on secondary GPU for DEV in "0000:0b:00.0" "0000:0b:00.1"; do echo "vfio-pci" > /sys/bus/pci/devices/$DEV/driver_override done modprobe -i vfio-pci # Setup Looking Glass shared memory object touch /dev/shm/looking-glass chown john:kvm /dev/shm/looking-glass chmod 660 /dev/shm/looking-glass ''; virtualisation = { libvirtd = { qemuOvmf = true; qemuVerbatimConfig = '' namespaces = [] nographics_allow_host_audio = 1 user = "john" group = "kvm" ''; }; };