How to use AMD P-State in Linux

Same here, all the 5000 & 6000 series are using amd-pstate through the amd-pstate=passive boot parameter, the only 4000 series I have left (for now, I may give up selling my other one) still doesn’t have support for it in bios even though the cpu does support it.

It’s not a big issue whether it’s using pstate or not. My 4700U works great. I have no issues with it.

Agreed, not a major issue, but would be nice to get that slightly better efficiency offered by the lower frequencies available with amd-pstate vs. acpi-cpufreq.

1 Like

I think for more powerful dekstop processors it is an advantage but on the laptops I don’t see a huge difference between the 4700U and the 5500U for instance.

I do see a pretty large advantage on my 5700U and 5650U vs. my 4650U. The 5650U is the better comparison overall since they’re also both the same company (Lenovo), although different lines (L14 G1 AMD 4650U vs. K14 Gen1 AMD 5650U). The good thing for comparing them is they have identical LCD’s, same amount of ram, so they’re about as similar as you can get for 2 mostly different laptops. :smiley:
I actually don’t use ANY low power states on my desktop. I think I tested and it DOES support amd-pstate, but I don’t bother using it as my desktop is obviously never on battery and was built as a “powerful enough but high efficiency” desktop, with all parts chosen for their relative decent power usage (3700x vs. 3800x for 65-watt vs. 105-watt TDP, 5600XT for fairly low for a pretty good GPU 150-watt TDP, etc.).

I am hoping to upgrade to a 7900 (non x) this year for the 65-watt TDP on that and 12 cores. Probably not upgrade the GPU at this time, though.

So found a somewhat humorous side effect to using AMD pstate.

On my 7415 2-in-1, I’d been noticing that the multi-finger tap and gestures were no longer working for the last several months (yeah, I can be a bit slow to getting around to troubleshooting minor issues). So started looking into it, and it seems that it requires the i2c_hid_acpi kernel module for those to work. But because I had switched to amd-pstate from acpi-cpufreq, it was no longer being auto-loaded (I don’t know why the touchpad doesn’t trigger loading it). So now I had to tell it to load that module on boot so that my touchpad works correctly.

2 Likes

is this already in?

amd_pstate=guided

only in patches
https://lore.kernel.org/linux-pm/20221207154648.233759-1-wyes.karny@amd.com/

not inside kernel 6.1 ( or 6.2 )

1 Like

the EPP will come with 6.3, but not the autonomous/guided mode:

1 Like

I dont’t think so. Dissapointed

https://www.phoronix.com/forums/forum/phoronix/latest-phoronix-articles/1376620-linux-6-3-features-amd-auto-ibrs-to-steam-deck-controller-interface-ipv4-big-tcp-more

I still think so:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/Documentation/admin-guide/pm/amd-pstate.rst?id=v6.3-rc1&id2=v6.2

EPP is added in 6.3, autonomous mode is something else

the new state “active” enables EPP when running 6.3. autonomous/guided state EPP is yet another expansion that is still to come.

1 Like

oh thanks

Has anyone encounter the issue of using Pstate in 6.1 resulting in worse battery life compared to acpi-cpufreq

mode guided State EPP v3 for linux 6.4

1 Like

with Kernel 6.3, we can now set amd-pstate=active via Kernel boot parameter, passive still works.

the default EPP mode is performance:

cat /sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference
performance

and the available ones can be checked with

cat /sys/devices/system/cpu/cpufreq/policy0/energy_performance_available_preferences 
default performance balance_performance balance_power power

those sysfs parameters can then be changed like every other sysfs interface (be aware that you need to change it per thread!).

but CPU has to stay in powersave governor for EPP to work:

cpupower frequency-info                                                             
analyzing CPU 2:
  driver: amd_pstate_epp
  CPUs which run at the same hardware frequency: 2
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 5.57 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 5.57 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 4.46 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: no

Here are some benchmarks, each and everyone can set the value more towards performance or powersaving that they think fits best for their system:

Edit: I will try balance_power first and see if it has issues. So far CPU - frequencies are between 400MHz and 5.5GHz like expected.

2 Likes

I set amd-pstate=active to test. Using zen3 CPU here.
I’m using all the defaults and it seems to be ok.

cpupower.service shows amd_pstate_epp driver with powersave governor.
/sys/devices/system/cpu/cpufreq/policy0/energy_performance_preference shows balance_performance.

cpu frequency
cpu MHz         : 550.000
cpu MHz         : 3966.583
cpu MHz         : 3709.286
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 3578.267
cpu MHz         : 550.000
cpu MHz         : 550.000
cpu MHz         : 550.000
2 Likes

yes, for some reason, they changed the default to the more sane balance_performance - I still use balance_power though

1 Like

I just set mine to amd-pstate=active but cpu power service won’t start. Not sure why as i had this working before.

Edit:

[ricklinux@eos-plasma ~]$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
amd_pstate_epp
[ricklinux@eos-plasma ~]$ cpupower frequency-info   
analyzing CPU 3:
  driver: amd_pstate_epp
  CPUs which run at the same hardware frequency: 3
  CPUs which need to have their frequency coordinated by software: 3
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 550 MHz - 4.56 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 550 MHz and 4.56 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 550 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: no
[ricklinux@eos-plasma ~]$ 
[ricklinux@eos-plasma ~]$ systemctl status cpupower.service
× cpupower.service - Apply cpupower configuration
     Loaded: loaded (/usr/lib/systemd/system/cpupower.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Sat 2023-05-06 11:19:36 EDT; 8min ago
    Process: 3564 ExecStart=/usr/lib/systemd/scripts/cpupower (code=exited, status=1/FAILURE)
   Main PID: 3564 (code=exited, status=1/FAILURE)
        CPU: 3ms

May 06 11:19:36 eos-plasma systemd[1]: Starting Apply cpupower configuration...
May 06 11:19:36 eos-plasma systemd[1]: cpupower.service: Main process exited, code=exited, status=1/FAILURE
May 06 11:19:36 eos-plasma systemd[1]: cpupower.service: Failed with result 'exit-code'.
May 06 11:19:36 eos-plasma systemd[1]: Failed to start Apply cpupower configuration.
[ricklinux@eos-plasma ~]$ 

what do you want to set with cpu-power?

That tool lost its value when using epp for me as we shouldn’t change governor anyway and frequencies are mostly non-relevant numbers anyway (the power level that the CPU uses doesn’t depend on frequencies for some generations now)

So we shouldn’t be using cpu power anymore?