Fix the EPP error for older CPUs (#48)

This commit is contained in:
Mert Can Demir 2020-03-24 22:53:10 +03:00 committed by GitHub
parent 9a6b9cf387
commit 95489e28d0
1 changed files with 9 additions and 4 deletions

View File

@ -186,9 +186,11 @@ def countdown(s):
# set powersave and enable turbo
def set_powersave():
print("Setting to use: powersave")
print("Setting to use: \"powersave\" governor")
s.run("cpufreqctl --governor --set=powersave", shell=True)
s.run("cpufreqctl --epp --set=balance_power", shell=True)
if (os.path.exists("/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference")):
s.run("cpufreqctl --epp --set=balance_power", shell=True)
print("Setting to use: \"balance_power\" EPP")
# get system/CPU load
load1m, _, _ = os.getloadavg()
@ -250,7 +252,10 @@ def mon_powersave():
def set_performance():
print("Setting to use \"performance\" governor")
s.run("cpufreqctl --governor --set=performance", shell=True)
s.run("cpufreqctl --epp --set=balance_performance", shell=True)
if (os.path.exists("/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference")):
s.run("cpufreqctl --epp --set=balance_performance", shell=True)
print("Setting to use: \"balance_performance\" EPP")
# get system/CPU load
load1m, _, _ = os.getloadavg()
@ -465,4 +470,4 @@ def running_daemon():
exit(1)
elif os.getenv("PKG_MARKER") == "SNAP" and dcheck == "enabled":
deploy_complete_msg()
exit(1)
exit(1)