From 8fdc42ee97372480621093b7e7b282b152660186 Mon Sep 17 00:00:00 2001 From: sajenim Date: Mon, 1 Apr 2024 10:04:20 +0800 Subject: [PATCH] apply our clock settings --- nixos/fuchsia/services/amdgpu-clocks.nix | 31 ++++++++++++++++++++++++ nixos/fuchsia/services/default.nix | 7 ++++++ 2 files changed, 38 insertions(+) create mode 100644 nixos/fuchsia/services/amdgpu-clocks.nix create mode 100644 nixos/fuchsia/services/default.nix diff --git a/nixos/fuchsia/services/amdgpu-clocks.nix b/nixos/fuchsia/services/amdgpu-clocks.nix new file mode 100644 index 0000000..f0a89e4 --- /dev/null +++ b/nixos/fuchsia/services/amdgpu-clocks.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: + +{ + # Our custom power state + environment.etc = { + "default/amdgpu-custom-states.card0" = { + text = '' + # For Navi (and Radeon7) we can only set highest SCLK & MCLK, "state 1": + OD_SCLK: + 1: 1800MHz + OD_MCLK: + 1: 875MHz + # More fine-grain control of clocks and voltages are done with VDDC curve: + OD_VDDC_CURVE: + 0: 800MHz @ 699mV + 1: 1450MHz @ 795mV + 2: 1800MHz @ 950mV + # Force power limit (in micro watts): + FORCE_POWER_CAP: 200000000 + FORCE_PERF_LEVEL: manual + ''; + + # The UNIX file mode bits + mode = "0440"; + }; + }; + + # Install our overclocking script. + environment.systemPackages = with pkgs; [ amdgpu-clocks ]; +} + diff --git a/nixos/fuchsia/services/default.nix b/nixos/fuchsia/services/default.nix new file mode 100644 index 0000000..19481a1 --- /dev/null +++ b/nixos/fuchsia/services/default.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + imports = [ + ./amdgpu-clocks.nix + ]; +}