Created
December 20, 2018 00:23
-
-
Save ElvishJerricco/2826ec625b359b3e67e81d2db8b97c71 to your computer and use it in GitHub Desktop.
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 characters
let | |
devices = [ | |
{ device = "10de:1c82"; slot = "42:00.0"; } # GPU | |
{ device = "10de:0fb9"; slot = "42:00.1"; } # GPU audio controller | |
# USB controllers | |
{ device = "1022:43ba"; slot = "01:00.0"; } | |
{ device = "1022:145c"; slot = "08:00.3"; } | |
{ device = "1022:145c"; slot = "43:00.3"; } | |
]; | |
in { | |
boot = { | |
kernelParams = [ "amd_iommu=on" "module_blacklist=xhci_pci" "quiet" "video=efifb:off" ]; | |
blacklistedKernelModules = [ "snd_hda_intel" "nvidia" "nouveau" ]; | |
kernelModules = [ "kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" ]; | |
extraModprobeConfig = '' | |
options vfio-pci ids=${lib.concatMapStringsSep "," (d: d.device) devices} | |
options kvm ignore_msrs=1 | |
''; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment