From 0861077bba497273fa1a9c70c5b2a5b72f7c12e0 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Sun, 1 Sep 2024 23:31:57 +0200 Subject: [PATCH] update amd config --- hosts/common/optional/cpu/amd.nix | 21 ++++++++++++--------- hosts/common/optional/gpu/amd.nix | 10 +++++++--- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/hosts/common/optional/cpu/amd.nix b/hosts/common/optional/cpu/amd.nix index fd8f2a1..1df4cbc 100644 --- a/hosts/common/optional/cpu/amd.nix +++ b/hosts/common/optional/cpu/amd.nix @@ -1,13 +1,16 @@ -_: { +{ + config, + ... +}: { hardware.cpu.amd.updateMicrocode = true; - boot.initrd.kernelModules = [ "amdgpu" ]; + boot = { + # https://github.com/NixOS/nixos-hardware/blob/master/common/cpu/amd/pstate.nix + kernelParams = [ "amd_pstate=active" ]; - # services.auto-epp = { - # enable = true; - # settings.Settings = { - # epp_state_for_AC = "performance"; - # epp_state_for_BAT = "balance_power"; - # }; - # }; + # https://github.com/NixOS/nixos-hardware/blob/master/common/cpu/amd/zenpower.nix + blacklistedKernelModules = [ "k10temp" ]; + extraModulePackages = [ config.boot.kernelPackages.zenpower ]; + kernelModules = [ "zenpower" ]; + }; } diff --git a/hosts/common/optional/gpu/amd.nix b/hosts/common/optional/gpu/amd.nix index 865e2d5..3b57bea 100644 --- a/hosts/common/optional/gpu/amd.nix +++ b/hosts/common/optional/gpu/amd.nix @@ -5,25 +5,29 @@ }: let inherit (lib.attrsets) attrValues; in { + # https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix + services.xserver.videoDrivers = [ "modesetting" ]; + hardware = { + amdgpu = { + initrd.enable = true; + opencl.enable = true; + }; graphics = { enable = true; enable32Bit = true; extraPackages = attrValues { inherit (pkgs) mesa - amdvlk libdrm libva vaapiVdpau libvdpau-va-gl ; - inherit (pkgs.rocmPackages.clr) icd; }; extraPackages32 = attrValues { inherit (pkgs.driversi686Linux) mesa - amdvlk libvdpau-va-gl ; };