limit to 4Ghz
This commit is contained in:
parent
f5d1b35345
commit
284a4e9c81
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
# looks like the Intel i9-13900 draws too much power and crashes the system
|
# looks like the Intel i9-13900 draws too much power and crashes the system
|
||||||
systemd.services.limit-cpu-freq = {
|
systemd.services.limit-cpu-freq = {
|
||||||
description = "Limit CPU frequency to 4.2GHz";
|
description = "Limit CPU frequency to 4GHz";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "systemd-modules-load.service" ];
|
after = [ "systemd-modules-load.service" ];
|
||||||
# Some cores do have a scaling max freq less than 5GHz, so we need to
|
# Some cores do have a scaling max freq less than 5GHz, so we need to
|
||||||
|
@ -20,8 +20,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq; do
|
for f in /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq; do
|
||||||
old_val="$(<"$f")"
|
old_val="$(<"$f")"
|
||||||
if [[ "$old_val" -gt 4200000 ]]; then
|
if [[ "$old_val" -gt 4000000 ]]; then
|
||||||
echo 4200000 > "$f"
|
echo 4000000 > "$f"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user