changes to togglecpu_pstates.sh

main
Luka Prinčič 2022-09-11 00:04:19 +02:00
parent e1a40627b3
commit 2d87ad2841
1 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#
# script to change the power and cpu throttle governor
# with new intel_pstates. use at your own risk
# this also uses the 'old' cpufreq-set to ensure that
# also the 'old' system is set the same way.
if [[ -z $1 ]]; then if [[ -z $1 ]]; then
echo "error. no argument." echo "error. no argument."
@ -13,8 +18,10 @@ else
CPU=`echo "${i: -1}"` CPU=`echo "${i: -1}"`
sudo cpufreq-set -c $CPU -g performance sudo cpufreq-set -c $CPU -g performance
done done
sudo x86_energy_perf_policy --turbo-enable 1 sudo x86_energy_perf_policy --turbo-enable 1
sudo x86_energy_perf_policy -a performance sudo x86_energy_perf_policy -a performance
watch cat /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_cur_freq watch cat /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_cur_freq
elif [[ $1 == "default" ]] elif [[ $1 == "default" ]]
@ -25,8 +32,10 @@ else
CPU=`echo "${i: -1}"` CPU=`echo "${i: -1}"`
sudo cpufreq-set -c $CPU -g powersave sudo cpufreq-set -c $CPU -g powersave
done done
sudo x86_energy_perf_policy --turbo-enable 0 sudo x86_energy_perf_policy --turbo-enable 0
sudo x86_energy_perf_policy -a default sudo x86_energy_perf_policy -a default
watch cat /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_cur_freq watch cat /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_cur_freq
elif [[ $1 == "power" ]] elif [[ $1 == "power" ]]
@ -40,6 +49,7 @@ else
sudo x86_energy_perf_policy --turbo-enable 0 sudo x86_energy_perf_policy --turbo-enable 0
sudo x86_energy_perf_policy -a power sudo x86_energy_perf_policy -a power
watch cat /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_cur_freq watch cat /sys/devices/system/cpu/cpu[0-9]*/cpufreq/scaling_cur_freq
else else