How to use AMD P-State in Linux

What do you mean?

I can’t test it yet, I’m still running 6.3.9, but thanks for insight.

Can you share where you saw that the command is no longer amd_pstate ?

According to kernel docs, nothing has changed:

image

Works for me with guided.

[ricklinux@eos-plasma ~]$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
amd-pstate

Edit:

[ricklinux@eos-plasma ~]$ uname -a
Linux eos-plasma 6.4.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 01 Jul 2023 16:17:21 +0000 x86_64 GNU/Linux

Edit: I am also running KDE on Wayland.

hm, let me try it here.. Updating the kernel, brb

hm… I’m not sure if its working here…

Sorry, output below is in Portuguese, but as you can see, with amd_pstate=active, I’m getting amd-pstate-epp and powersave.

amd_pstate=active
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
amd-pstate-epp

$ cpu_freq_check2
analisando o CPU 5:
  driver: amd-pstate-epp
  CPUs que rodam na mesma frequência de hardware: 5
  CPUs que precisam ter suas frequências coordenadas por software: 5
  maior latência de transição:  Cannot determine or is not supported.
  limites do hardware: 550 MHz - 4.55 GHz
  reguladores do cpufreq disponíveis: performance powersave
  política de frequência atual deve estar entre 550 MHz e 4.55 GHz.
                  O regulador "powersave" deve decidir qual velocidade usar
                  dentro desse limite.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.50 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: no

Now, with amd_pstated=guided, I’m back to amd-pstate and schedutil ? Not sure if this should be happening…

amd_pstate=guided
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
amd-pstate

$ LANG=C cpu_freq_check2
analyzing CPU 11:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 11
  CPUs which need to have their frequency coordinated by software: 11
  maximum transition latency: 20.0 us
  hardware limits: 550 MHz - 4.55 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 550 MHz and 4.55 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.64 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.55 GHz.
    AMD PSTATE Nominal Performance: 124. Nominal Frequency: 3.40 GHz.
    AMD PSTATE Lowest Non-linear Performance: 64. Lowest Non-linear Frequency: 1.75 GHz.
    AMD PSTATE Lowest Performance: 21. Lowest Frequency: 550 MHz.

Edit: cpu_freq_check2 is an alias for cpupower frequency-info

It’s working for me…

[ricklinux@eos-plasma ~]$ cpupower frequency-info 
analyzing CPU 2:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 2
  CPUs which need to have their frequency coordinated by software: 2
  maximum transition latency: 20.0 us
  hardware limits: 550 MHz - 4.56 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 550 MHz and 4.56 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.74 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.56 GHz.
    AMD PSTATE Nominal Performance: 142. Nominal Frequency: 3.90 GHz.
    AMD PSTATE Lowest Non-linear Performance: 64. Lowest Non-linear Frequency: 1.76 GHz.
    AMD PSTATE Lowest Performance: 21. Lowest Frequency: 550 MHz.
[ricklinux@eos-plasma ~]$ 

Edit:

[ricklinux@eos-plasma ~]$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
amd-pstate

Edit: I take it this is correct?

Sounds to me that guided mode runs with amd-pstate and not with amd-pstate-epp..

I believe so, let me google it to confirm

Edit:

https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=7a9dec665f6875f61fe0c2e71b25842daade5110

Edit:

Not sure i totally understand it or which is better?

Based on what I’ve been reading:

amd_pstate=active → amd_pstate_epp driver
amd_pstate=passive → amd_pstate driver
amd_pstate=guided → amd_pstate driver

Note: Statement above may not be accurate.

amd_pstate_epp has different governors than amd_pstate.

Based on the cpupower, with amd_pstate_epp I have powersave or performance governors modes.
With amd_pstate, I have conservative, ondemand, userspace, powersave, performance and schedutil governor modes.

That is a good question, I like the idea of autonomous mode based on the workload (guided), but which is better, we will have to test.

Well for me I’m using a desktop which is more apt to be power hungry. I already have it set to use 65W verses 105W in UEFI Bios settings since my processor is the 3800X which is 105W.

Edit: I’m sure it’s quite different if one is on a laptop. :man_shrugging:

Indeed.. If you are on battery, power saving is definitely always a good idea.
I set -30mV for all cores in my desktop CPU (PBO2 curve optimizer), but I didn’t limit the wattage. I did this more for temperatures problems and try to increase the lifespan of it.. 105W (5800x3D).

Oh … you have the big brother with 3D. I also have the 5800X but is not assembled yet with B550 MSI motherboard with 1 GB and 2.5 GB Ethernet. It’s waiting for the 6750 XT I also have for it.

Edit: Stuff’s almost getting dated already! :wink:

That is a great setup… Go and assemble that machine, I wouldn’t be able to hold myself :slight_smile:

I had a 5600x and a 6600XT, but my nephew needed a computer so much that I gave him my GPU and CPU, bought him a simple mobo, old case and PSU… He was jumping of joy ehhe…

But I only gave him these parts once my new parts arrived (5800x3D and a 6750 XT) :rofl:

I still need m.2 drives and ram and power supply. I have everything else. Huge dual fan and heat sink and really sharp corsair case with tinted glass window one side, fan slots for top and other side and front also.

Edit: case is designed to have air run across the bottom of the motherboard as well.

Edit: Definitely will be running pstates on this one.

Airflow in that case is very good, I like this mesh front..
I would put three 120mm fans, intake, front.
I’m not sure if that case supports it, but at least one 120mm, exhaust, top.
In the back, is that a 80mm exhaust? If so, just plug it to your motherboard..

By doing like this, you would have plenty air flow, positive pressure to avoid dust.. Clean the dust filters once a month or two and GG…

RAM is getting cheaper, PSU is also getting cheaper because that new standard for PCI cables, so you can get one with the old standard for cheaper now..
M.2 is in the same line, this PCI 5.0 are making PCI 4.0 and PCI 3.0 more attractive in prices..

I’ll downgrade my kernel to 6.3.9 because I’m getting problems with Firefox, so I’ll be using active mode, but definitely be using amd-pstate anyway..

Everything seems to works good here on Firefox but i use it mostly for browsing. Maybe you have other video streaming?

Exactly.. It crashes after a while and playing videos with a few tabs opened..
Happened scrolling down phonorix.com twice..
But if no videos are playing, everything runs smoothly..

Could it be an Internet issue? I have pretty fast service. I don’t tend to have videos playing so I’m not sure if i would have an issue.

Internet issue wouldn’t make my firefox crash and open a crash report to Mozilla..
I would bet that there is something happening with memory management in this kernel, but I don’t have any of the required skills to troubleshoot it further..

I only know that it is kernel related because it happened for the first time after updating it, and it keep happening until I downgraded it..

Once I started to google it, found some reports that are likely related to this problem..

Hi all, my cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver outputs acpi-cpufreq, to use amd pstate, should I just add amd_pstate=active (guided) kernel param and thats it? or I need to create the /etc/modules-load.d/amd-pstate.conf file?

(I have AMD Ryzen 9 6900HS so I guess amd_pstate.shared_mem=1 is not needed?)