Skip to content

Commit

Permalink
fix cpu clock stuck at minimum
Browse files Browse the repository at this point in the history
fix #33
  • Loading branch information
honjow committed Dec 14, 2023
1 parent 8bf8d60 commit 881885e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@
"FAN_RAM_RPMREAD_LENGTH":2,

"FAN_RPMWRITE_MAX":244,
"FAN_RPMVALUE_MAX":6500
"FAN_RPMVALUE_MAX":6700
}]

except Exception as e:
Expand Down
11 changes: 9 additions & 2 deletions backend/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,16 @@ def set_cpuBoost(self, value: bool):

# 关闭 amd_pstate 使用 acpi_cpufreq
if os.path.exists(amd_pstate_path):
with open(amd_pstate_path, 'w') as file:
file.write('disable')
open(amd_pstate_path, 'w').write('guided')
open(amd_pstate_path, 'w').write('disable')
os.system("modprobe acpi_cpufreq")
result = subprocess.run(["modprobe", "acpi_cpufreq"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)

if result.stderr:
logging.error(f"modprobe acpi_cpufreq error:\n{result.stderr}")
open(amd_pstate_path, 'w').write('active')
return False

# 设置 boost
if os.path.exists(boost_path):
with open(boost_path, 'w') as file:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"typescript": "^4.7.4"
},
"dependencies": {
"decky-frontend-lib": "^3.21.6",
"decky-frontend-lib": "^3.24.1",
"react-icons": "^4.4.0",
"typescript-json-serializer": "^4.2.0"
},
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 881885e

Please sign in to comment.