From cd1d1c7ce149ee4200ae3ba9078a99b524dbe069 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Tue, 17 Dec 2024 13:08:58 +0300 Subject: [PATCH] Max: Tweak fan speeds. --- host/x86_64-linux/max/Power.nix | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/host/x86_64-linux/max/Power.nix b/host/x86_64-linux/max/Power.nix index 29ee6c60..07788e0a 100644 --- a/host/x86_64-linux/max/Power.nix +++ b/host/x86_64-linux/max/Power.nix @@ -3,7 +3,6 @@ pkgs, ... }: let - tbase = 45; wm2fc = pkgs.callPackage {}; in { # hardware.cpu.amd.ryzen-smu.enable = true; @@ -31,10 +30,10 @@ in { ryzenadj ]; script = '' - ryzenadj --tctl-temp=${toString (tbase+5)} + ryzenadj --tctl-temp=50 while true; do sleep 60 - ryzenadj --tctl-temp=${toString (tbase+5)} &> /dev/null + ryzenadj --tctl-temp=50 &> /dev/null done ''; }; @@ -51,32 +50,21 @@ in { coreutils wm2fc ]; - script = let - templimit = add: if (tbase+add) > 80 then - "80000" - else - "${toString (tbase+add)}000"; - in '' + script = '' old=0 while true; do temp=$(cat /sys/devices/pci0000\:00/0000\:00\:18.3/hwmon/*/temp1_input) value=0 - if [ $temp -gt ${templimit 35} ] + if [ $temp -gt 80000 ] then value=184 - elif [ $temp -gt ${templimit 30} ] - then value=161 - elif [ $temp -gt ${templimit 25} ] - then value=138 - elif [ $temp -gt ${templimit 20} ] - then value=115 - elif [ $temp -gt ${templimit 15} ] + elif [ $temp -gt 70000 ] + then value=128 + elif [ $temp -gt 60000 ] then value=92 - elif [ $temp -gt ${templimit 10} ] - then value=69 - elif [ $temp -gt ${templimit 5} ] + elif [ $temp -gt 49000 ] then value=46 - elif [ $temp -gt ${templimit 0} ] + elif [ $temp -gt 45000 ] then value=23 fi