Skip to content

Commit

Permalink
gh-667: Modify message when using amd-pstate-epp
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Apr 7, 2024
1 parent 215026a commit f9e716a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions auto_cpufreq/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,23 @@ 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")
scaling_driver = Path("/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver")

if p_state.exists():
inverse = True
f = p_state
elif cpufreq.exists():
f = cpufreq
inverse = False
elif amd_pstate.exists() and scaling_driver.exists():
amd_value = amd_pstate.read_text().strip()
scaling_driver_value = scaling_driver.read_text().strip()
if amd_value == "active" and scaling_driver_value == "amd-pstate-epp":
print("CPU turbo is controlled by amd-pstate-epp driver")
else:
print("Warning: CPU turbo is not available")
return False
else:
print("Warning: CPU turbo is not available")
return False
Expand Down

0 comments on commit f9e716a

Please sign in to comment.