Skip to content

Commit

Permalink
gh-667: Modify message when using amd-pstate-epp (#674)
Browse files Browse the repository at this point in the history
* gh-667: Modify message when using amd-pstate-epp

* Address code review

* Address code review

* nit

* Update

* fix typo

---------

Co-authored-by: shadeyg56 <shadeyg56@gmail.com>
  • Loading branch information
corona10 and shadeyg56 committed Apr 9, 2024
1 parent 215026a commit 2df634b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,20 @@ def turbo(value: bool = None):
"""
p_state = Path("/sys/devices/system/cpu/intel_pstate/no_turbo")
cpufreq = Path("/sys/devices/system/cpu/cpufreq/boost")
amd_pstate = Path("/sys/devices/system/cpu/amd_pstate/status")

if p_state.exists():
inverse = True
f = p_state
elif cpufreq.exists():
f = cpufreq
inverse = False
elif amd_pstate.exists():
amd_value = amd_pstate.read_text().strip()
if amd_value == "active":
print("CPU turbo is controlled by amd-pstate-epp driver")
# Basically, no other value should exist.
return False
else:
print("Warning: CPU turbo is not available")
return False
Expand Down

0 comments on commit 2df634b

Please sign in to comment.