Skip to content

Commit

Permalink
fix set_cpuTDP
Browse files Browse the repository at this point in the history
  • Loading branch information
honjow committed Dec 10, 2023
1 parent 0e4955c commit cf4b74c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions backend/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,15 @@ def set_cpuTDP(self, value: int):
slow_limit = tdp
tctl_temp = 90

command = f"sudo {sys_ryzenadj_path} -a {stapm_limit} -b {fast_minit} -c {slow_limit} -f {tctl_temp}"
command = f"{sys_ryzenadj_path} -a {stapm_limit} -b {fast_minit} -c {slow_limit} -f {tctl_temp}"
command_args = command.split()
logging.info(f"set_cpuTDP command: {command}")
logging.info(f"set_cpuTDP {value}")
# os.system(command)
result = subprocess.getoutput(command)
logging.info(f"set_cpuTDP result: {result}")
process = subprocess.run(command_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.stdout.decode('utf-8'), process.stderr.decode('utf-8')
logging.info(f"set_cpuTDP result:\n{stdout}")
if stderr:
logging.error(f"set_cpuTDP error:\n{stderr}")

return True
else:
Expand Down

0 comments on commit cf4b74c

Please sign in to comment.