Don't get AMD p-state active

The thread How to use AMD P-State in Linux 5.17 is so full of anything that I decided to open a new one for my problem

My system has

CPU: 6-core AMD Ryzen 5 4600H with Radeon Graphics (-MT MCP-)
speed/min/max: 1399/1400/3000 MHz Kernel: 6.3.2-zen1-1-zen x86_64 Up: 20m
Mem: 7464.9/31509.7 MiB (23.7%) Storage: 2.73 TiB (74.9% used) Procs: 409
Shell: fish inxi: 3.3.27

lscpu | grep cppc shows cppc among many, many other flags.

I am using dracut and added amd_pstate.shared_mem=1 amd_pstate=active in /efi/loader/entries/e3453a9d96ee492bb8be0b1b52780f08-6.3.2-zen1-1-zen.conf

I have /etc/modules-load.d/amd-pstate.conf containing a line

amd_pstate

Rebooted and issuing cpupower frequency-info I get still acpi-cpufreq as driver.

analyzing CPU 5:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 5
  CPUs which need to have their frequency coordinated by software: 5
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 1.40 GHz - 3.00 GHz
  available frequency steps:  3.00 GHz, 1.70 GHz, 1.40 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.40 GHz and 3.00 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.77 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: no

What am I doing wrong?

Have you enabled cppc in your UEFI/Bios settings?

I have a machine with the following cpu but there is no support for cppc in the firmware settings so I haven’t been able to use this driver.


CPU:
  Info: 8-core model: AMD Ryzen 7 4800U with Radeon Graphics bits: 64

Also as a side note, if you are using EnOS’ implementation of systemd-boot plus dracut, you would need to add the kernel boot options in /etc/kernel/cmdline and then run sudo reinstall-kernels which will regenerate the loader entries and the initrds.

Which kernel are you using? I assume you are not using kernel 5.17.

With newer kernels the command line parameter should be: amd_pstate=passive

https://docs.kernel.org/admin-guide/pm/amd-pstate.html

In my post above you can see it in the output of inxi

I didn’t find anything in the UEFI/Bios settings to enable it and (perhaps naively) thought that when cppc is shown in the lscpu output it means that it is enabled.

If I am not mistaken, enabling cppc in the firmware settings is a requirement for amd_pstate to work.

It is also one of the steps in the OP of the thread you have linked to.

I have been hoping that a bios update for my machine would bring this capability but unfortunately this hasn’t been the case so far.

Not sure if you are using grub or systemd-boot. Not sure your cpu works with pstate. I couldn’t get my Ryzen 7 4700U to work. I’m using amd_pstate=active just in the command line and then update grub. Or if on systemd-boot in the kernel command line and then run the command to reinstall kernels.

There is no cppc setting on my HP but i think it’s enabled anyway but still this cpu doesn’t seem to enable pstates. You’ll have to try the various methods. My HP is using acpi_cpufreq

Edit:
amd_pstate=active works on all my other amd systems with newer ryzen cpu’s

I misinterpeted this

thinking that seeing cppc means nothing need to be done in UEFI/Bios settings.

2 Likes

I use systemd-boot and it seems to me that indeed here pstate is not supported.

It may be the case. I tried every way shown on my HP 4700u and it doesn’t seem to work on this one. My other Ryzen 5 5500u and 5700u work amd also my desktop cpu Ryzen 3800X works.

its amd-pstate=active
- vs _

I would guess that its the same for the shared memory command, but I have no system that needs that.

thats obsolete from 6.1 on

No, the underscore “_” is indeed correct. Look here (scroll down to the headline “Active Mode” :
https://www.kernel.org/doc/html/latest/admin-guide/pm/amd-pstate.html

at the time of writing, you can use the passive mode and the active mode. The guided mode will come with kernel 6.4

I’m not sure if amd_pstate.shared_mem=1 is still needed (in some cases maybe?) or also obsolete now.
I just add amd_pstate=active / amd_pstate=passive to my kernel parameters (Ryzen 7 5700U). For systemd-boot: add it to /etc/kernel/cmdline. Then run sudo reinstall-kernels as already mentioned.
Nothing more required.

cat /etc/kernel/cmdline
loglevel=3 quiet nowatchdog amd-pstate=active amdgpu.ppfeaturemask=0xffffffff
cpupower frequency-info
analyzing CPU 1:
  driver: amd_pstate_epp

If you look in the other topic, I also write guides there - It is working like that since 6.1

Edit: you simply looked at the wrong part of the documentation that you linked. The correct part reads this:

Global Attributes

amd-pstate exposes several global attributes (files) in sysfs to control its functionality at the system level. They are located in the /sys/devices/system/cpu/amd-pstate/ directory and affect all CPUs.

status

    Operation mode of the driver: "active", "passive" or "disable".

    "active"

        The driver is functional and in the active mode
    "passive"

        The driver is functional and in the passive mode
    "guided"

        The driver is functional and in the guided mode
    "disable"

        The driver is unregistered and not functional now.

guided will only be available with 6.4 though
active is available since 6.3

2023-05-21_18-23

2023-05-21_18-23_1

using systmd-boot …
in my:

 /etc/kernel/cmdline
---
amd_pstate=passive amd_pstate.shared_mem=1
1 Like

If using Kernel 6.1 LTS, check $ modinfo amd-pstate and $ modinfo amd_pstate, both are the same, but I am wondering if their parameters e.g. shared_mem were removed.

modinfo amd-pstate does not exist in Kernel 6.3 unlike 6.1