VFIO Profile Update

This commit is contained in:
kat witch 2021-08-05 16:31:01 +01:00
parent 11f1c043dc
commit 2c36feec6f
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
4 changed files with 28 additions and 24 deletions

View file

@ -66,11 +66,25 @@ in {
# Hardware
deploy.profile.hardware.acs-override = true;
hardware.openrazer = {
enable = true;
};
environment.systemPackages = [ pkgs.razergenie ];
boot.modprobe.modules = {
vfio-pci = let
vfio-pci-ids = [
"1002:67df" "1002:aaf0" # RX 580
"1921:0014" # Renesas USB 3
"1022:149c" # CPU USB 3
];
in mkIf (vfio-pci-ids != [ ]) {
options.ids = concatStringsSep "," vfio-pci-ids;
};
};
# Networking
networking = {

View file

@ -10,6 +10,7 @@ with lib;
vfio = mkEnableOption "VFIO";
trusted = mkEnableOption "Trusted Submodule";
hardware = {
acs-override = mkEnableOption "ACS IOMMU Override";
amdgpu = mkEnableOption "AMD GPU";
hcloud-imperative = mkEnableOption "Imperative Hetzner Cloud Setup";
intel = mkEnableOption "Intel CPU";
@ -29,6 +30,7 @@ with lib;
vfio = mkEnableOption "VFIO";
trusted = mkEnableOption "Trusted Submodule";
hardware = {
acs-override = mkEnableOption "ACS IOMMU Override";
amdgpu = mkEnableOption "AMD GPU";
hcloud-imperative = mkEnableOption "Imperative Hetzner Cloud Setup";
intel = mkEnableOption "Intel CPU";

View file

@ -11,26 +11,22 @@ with lib;
ddcutil
];
boot.extraModulePackages = [
(pkgs.linuxPackagesFor config.boot.kernelPackages.kernel).vendor-reset
];
users.users.kat.extraGroups = [ "vfio" "input" "uinput" ];
users.groups = { uinput = { }; vfio = { }; };
boot = {
modprobe.modules = mkIf (config.deploy.profile.hardware.ms-7b86) {
vfio-pci = let
vfio-pci-ids = [
"1002:67df" "1002:aaf0" # RX 580
"1921:0014" # Renesas USB 3
"1022:149c" # CPU USB 3
];
in mkIf (vfio-pci-ids != [ ]) {
options.ids = concatStringsSep "," vfio-pci-ids;
};
};
kernelPatches = mkIf (config.deploy.profile.hardware.ms-7b86) [
initrd.kernelModules = ["vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd"];
kernelModules = [ "i2c-dev" ]; # i2c-dev is required for DDC/CI for screenstub
} // mkIf (config.deploy.profile.hardware.amdgpu) {
kernelParams = [
"video=efifb:off"
];
extraModulePackages = [
(pkgs.linuxPackagesFor config.boot.kernelPackages.kernel).vendor-reset
];
} // mkIf (config.deploy.profile.hardware.acs-override) {
kernelPatches = [
{
name = "acs-patch.patch";
patch = (pkgs.fetchpatch {
@ -40,12 +36,8 @@ with lib;
});
}
];
initrd.kernelModules = ["vfio" "vfio_iommu_type1" "vfio_pci" "vfio_virqfd"];
kernelModules = [ "i2c-dev" ]; # i2c-dev is required for DDC/CI for screenstub
kernelParams = [
"amd_iommu=on"
"pci=noats"
"video=efifb:off"
"pcie_acs_override=downstream,multifunction"
];
};
@ -77,8 +69,4 @@ with lib;
}];
systemd.extraConfig = "DefaultLimitMEMLOCK=infinity";
services.xserver.deviceSection = lib.mkDefault ''
Option "TearFree" "true"
BusID "PCI:37:0:0"
'';
}

@ -1 +1 @@
Subproject commit bf8af6c682b0e0813e6faf6fe9412fc1a1f80b80
Subproject commit 70c8d6bfd3e825db5edfd039d9ef75cee18ab462