Created
December 27, 2019 23:44
-
-
Save julian-klode/44df0ec6ac92c21a1fa75751f62e94b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
write() { | |
file="$1" | |
shift | |
echo "$@" | sudo tee "$file" | |
} | |
case "$1" in | |
raise) | |
write /sys/bus/pci/drivers/proc_thermal/0000:00:04.0/tcc_offset_degree_celsius 5 | |
write /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw 44000000 | |
write /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_power_limit_uw 44000000 | |
;; | |
reset) | |
write /sys/bus/pci/drivers/proc_thermal/0000:00:04.0/tcc_offset_degree_celsius 20 | |
write /sys/devices/virtual/powercap/intel-rapl/intel-rapl:0/constraint_0_power_limit_uw 15000000 | |
write /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_power_limit_uw 15000000 | |
;; | |
*) | |
echo "E: Missing/unknown argument: $1, expected 'raise' or 'reset'" >&2 | |
exit 1 | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment