monolith: extract undervolt config
This commit is contained in:
parent
89b758f163
commit
0150248650
2 changed files with 17 additions and 8 deletions
16
hosts/monolith/undervolt.nix
Normal file
16
hosts/monolith/undervolt.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
undervoltGpu = pkgs.writeShellScript "undervolt-gpu" ''
|
||||
set -xe
|
||||
cd $1
|
||||
test -e pp_od_clk_voltage
|
||||
echo "vo -100" > pp_od_clk_voltage
|
||||
echo "c" > pp_od_clk_voltage
|
||||
'';
|
||||
in
|
||||
{
|
||||
boot.kernelParams = [ "amdgpu.ppfeaturemask=0xfffd7fff" ];
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="hwmon", ATTR{name}=="amdgpu", ATTR{power1_cap}="186000000", RUN+="${undervoltGpu} %S%p/device"
|
||||
'';
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue