diff options
Diffstat (limited to 'system/amdgpu.nix')
| -rw-r--r-- | system/amdgpu.nix | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/system/amdgpu.nix b/system/amdgpu.nix new file mode 100644 index 0000000..de58a62 --- /dev/null +++ b/system/amdgpu.nix @@ -0,0 +1,28 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkIf; + cfg = config.amdgpu; +in { + config = mkIf cfg.enable { + # kernel modules + boot = { + initrd.kernelModules = ["amdgpu"]; + kernelModules = ["kvm-amd"]; + }; + + # AMD Anti-Lag + environment.systemPackages = [ pkgs.low-latency-layer ]; + environment.etc."vulkan/implicit_layer.d/low_latency_layer.json".source = "${pkgs.low-latency-layer}/share/vulkan/implicit_layer.d/low_latency_layer.json"; + + # Configuration + environment.variables = { + AMD_VULKAN_ICD = "RADV"; + RADV_ANTILAG = "1"; + LOW_LATENCY_LAYER = "1"; + }; + }; +} |