summaryrefslogtreecommitdiff
path: root/system/amdgpu.nix
blob: df9a52c7af714f5484dee67f4b6b6cde5734d430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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";
    };
  };
}