powerprofiles tries to create something like the energy settings on windows, where you can configure some system presets to switch manually or depending on the power supply method - it does not change anything related to EPP - might be that one can configure it somehow to do that but I am not familiar with it myself.
that’s just the 3 profiles that one can configure - apparently, they are configured to do the same on all 3 profiles.
check with the method that works:
leave it commented as epp only knows performance and powersave governor, and powersave is the default and the one you want to use.
well … I gave the task of writing the script to ChatGPT free model (chatGPT 3):
User
Write a Shell script that applies a configurable value, for example 'balance_power' to all threads of a system. The path is /sys/devices/system/cpu/cpufreq/policy6/energy_performance_preference
ChatGPT
Certainly! Here's a Shell script that applies a configurable value, such as 'balance_power', to all threads of a system by modifying the energy_performance_preference file for each CPU thread:
bash
#!/bin/bash
# Configurable value
CONFIG_VALUE="balance_power"
# Get the number of CPU threads
NUM_THREADS=$(grep -c ^processor /proc/cpuinfo)
# Loop through each CPU thread and apply the configurable value
for ((i=0; i<NUM_THREADS; i++))
do
THREAD_PATH="/sys/devices/system/cpu/cpufreq/policy$i/energy_performance_preference"
# Check if the energy_performance_preference file exists
if [ -f "$THREAD_PATH" ]; then
echo "$CONFIG_VALUE" > "$THREAD_PATH"
echo "Applied $CONFIG_VALUE to $THREAD_PATH"
else
echo "Error: $THREAD_PATH does not exist"
fi
done
Here's how the script works:
The configurable value is set to "balance_power" in the CONFIG_VALUE variable.
The script retrieves the number of CPU threads by counting the lines containing "processor" in the /proc/cpuinfo file.
It then loops through each CPU thread from 0 to NUM_THREADS-1.
For each thread, it constructs the path to the energy_performance_preference file using the thread number.
The script checks if the energy_performance_preference file exists for the current thread.
If the file exists, it writes the configurable value to the file using the echo command.
Finally, it prints a success message if the value was applied, or an error message if the file doesn't exist.
Make sure to run this script with appropriate permissions (e.g., sudo) since modifying system files typically requires elevated privileges.
User
rewrite the script to be silent
ChatGPT
Certainly! Here's a modified version of the script that runs silently, without printing any messages:
bash
#!/bin/bash
# Configurable value
CONFIG_VALUE="balance_power"
# Get the number of CPU threads
NUM_THREADS=$(grep -c ^processor /proc/cpuinfo)
# Loop through each CPU thread and apply the configurable value
for ((i=0; i<NUM_THREADS; i++))
do
THREAD_PATH="/sys/devices/system/cpu/cpufreq/policy$i/energy_performance_preference"
# Check if the energy_performance_preference file exists
if [ -f "$THREAD_PATH" ]; then
echo "$CONFIG_VALUE" > "$THREAD_PATH" 2>/dev/null
fi
done
In this version of the script, the echo command that writes the CONFIG_VALUE to the file is appended with 2>/dev/null. This redirects the standard error stream to /dev/null, discarding any error messages that may occur during the execution of the script.
With this modification, the script will run silently, without any output or error messages.
I am now executing that script with the systemd process that I set up above and it works
Edit:
Here is the silent script without having to scroll through the chat-log and minor modifications for race condition fixes.
#!/bin/bash
# Configurable value
CONFIG_VALUE='balance_power'
sleep 3
# Get the number of CPU threads
NUM_THREADS=$(grep -c ^processor /proc/cpuinfo)
# Loop through each CPU thread and apply the configurable value
for ((i=0; i<NUM_THREADS; i++))
do
THREAD_PATH="/sys/devices/system/cpu/cpufreq/policy$i/energy_performance_preference"
# Check if the energy_performance_preference file exists
if [ -f "$THREAD_PATH" ]; then
echo "$CONFIG_VALUE" > "$THREAD_PATH" 2>/dev/null
fi
done
Hey everyone, I dont generally hang around here anymore so ill make a repo for this on my gitlab so people can submit issues there for updates to the guide and i can see them. Ill post the repo soon
So, one thing I’ve wondered, does that mean w/ 6.5 we can remove the amd-pstate=whichever from teh kernel line in grub and when it detects a (compatible) AMD processor it’ll just USE amd-pstate active by default?
that’s exactly what 6.5 will do - the only thing coming in between would be a kernel maintainer or Linus Torvalds in the last instance decides to not merge the pull request - but at this stage, that is rather unlikely.
sudo cpupower frequency-info
analyzing CPU 6:
driver: amd-pstate
CPUs which run at the same hardware frequency: 6
CPUs which need to have their frequency coordinated by software: 6
maximum transition latency: 20.0 us
hardware limits: 400 MHz - 5.57 GHz
available cpufreq governors: conservative ondemand userspace powersave performance schedutil
current policy: frequency should be within 400 MHz and 5.57 GHz.
The governor “schedutil” may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 5.29 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
AMD PSTATE Highest Performance: 166. Maximum Frequency: 5.57 GHz.
AMD PSTATE Nominal Performance: 134. Nominal Frequency: 4.50 GHz.
AMD PSTATE Lowest Non-linear Performance: 89. Lowest Non-linear Frequency: 2.99 GHz.
AMD PSTATE Lowest Performance: 12. Lowest Frequency: 400 MHz.
Clocks are scaling from 29XXMHz to 53XXMhz during normal usage using “schedutil” as the scaling governor.
Active mode also worked fine on kernel 6.3 with clocks scaling from 400MHz to 47XXMhz during normal usage using “powersave” as the scaling governor and “balance_performance” as the energy performance preference. Changing the energy performance preference to “performance” made it scale from 400MHz to 53XXMhz.
So far i prefer the guided mode over active in terms of performance / responsiveness on desktop.