Linux 5.17 is here and just around the corner for Arch users who dont build their own Kernels and have it already. Even if you do here is the short and easy of using the new P-State Driver for AMD CPUs. Ondemand seems to deliver the best performance/power savings over schedutil with p-state at the moment.
It should be noted this is only for Zen2 and newer
First check if support is already enabled with lscpu | grep cppc
if you get no output then to 2
Make sure CPPC is enabled in your BIOS/UEFI, some its on by default others its not.
Most non-Epyc systems will need to add one or both of these to your kernel command line
Enable shared mem mode (This is not Required for Ryzen 7000 series+ and most laptop 5000/6000 series)
amd_pstate.shared_mem=1
EDIT: amd-pstate=passive is now required for kernels 6.1+
Pstate driver doesnt load automatically you can do this to load it on boot
by creating a file
and thats it, you should be using the new AMD P-State driver. Im not sure if the driver is lying to me but it reports that it allows my CPU to idle down to 550mhz. My main concern with this is just any little bit of power savings it can bring as thats its purpose. Enjoy the new driver
Make sure the module is enabled when building the kernel:
CONFIG_X86_AMD_PSTATE=m
And in case you run into issue and the module cannot be loaded, you can get some more detailed information when you do sudo modprobe amd_pstate dyndbg==pmf -v and then check what is logged with sudo dmesg
This isnt necessary if using Arch defconfig as that is the default for 5.17 builds. Only if youre using a custom config that disables it/ changes it would that be a worry.
Interesting. With cpufreq I’m stuck at 1.4 GHz minimum. Unfortunately CPPC does not seem to be enabled on my laptop and there is no firmware/BIOS option to enable it hence I can’t use the new driver.
Do you see less power consumption with that in idle states?
Hard to measure exactly without hooking up to the motherboard itself. My UPS still measures around 80w system idle but its not exact and 1/2 to 2/3 of that is My Monitor+Speakers.
I’d say in a desktop system its a rather small difference at best. I’ll take even 1 watt difference, at least it lowers idle temps a couple degrees.
I decided to test but its not working for me… Not sure why, running a 5600x on a Asus motherboard.
BIOS/UEFI
Module/Kernel version/Kernel cmdline
# modprobe amd_pstate dyndbg==pmf -v
insmod /lib/modules/5.17.1-zen1-1-zen/kernel/drivers/cpufreq/amd_pstate.ko.zst shared_mem=1 enable=1 dyndbg==pmf
$ uname -a
Linux eos 5.17.1-zen1-1-zen #1 ZEN SMP PREEMPT Mon, 28 Mar 2022 21:56:46 +0000 x86_64 GNU/Linux
# dmesg | grep linux
[ 0.000000] Linux version 5.17.1-zen1-1-zen (linux-zen@archlinux) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.38) #1 ZEN SMP PREEMPT Mon, 28 Mar 2022 21:56:46 +0000
[ 0.000000] Command line: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=ba36f8b9-ac35-44c2-b5d9-0dfa868fba4a rw rootflags=subvol=@ quiet loglevel=3 nowatchdog nvme_load=YES amd_pstate.shared_mem=1 amd_pstate.enable=1
[ 0.034567] Kernel command line: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=ba36f8b9-ac35-44c2-b5d9-0dfa868fba4a rw rootflags=subvol=@ quiet loglevel=3 nowatchdog nvme_load=YES amd_pstate.shared_mem=1 amd_pstate.enable=1
[ 0.034620] Unknown kernel command line parameters "BOOT_IMAGE=/@/boot/vmlinuz-linux-zen nvme_load=YES", will be passed to user space.
[ 0.560729] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 3.571384] TERM=linux
[ 3.571384] BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
$ lscpu | grep cppc
$ cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
acpi-cpufreq
Edit: Tried a few more things such as:
Enable that second option in BIOS (CPPC Preferred Cores)
Blacklist the module acpi_cpufreq by putting in my cmdline blacklist_module=acpi_cpufreq
Boot with both options amd_pstate.shared_mem=1 and amd_pstate.enable=1 or just the 1st one
But none of these actions worked, so I’ll give up for now…
But whatever I do, it doesn’t work for me…
I guess that our amd_pstate module wasn’t enabled during the kernel build as mentioned by moson, not sure because I never compiled a kernel before, I’m pretty noob when it comes to it…
you shouldnt need to blacklist acpi, fixing the module loading and assuming you have the rest of the options enabled it should default to pstate with the fix from my previous post
lower idle speed/power and in theory the system has finer frequency control in relation to power/performance but its new and most of the work on it has been in relation to mobile/laptop use and things like the steam deck which Valve helped develop this for.
Okay i removed it. Thanks a lot. I’ll try this and see how the system works. My plasma runs so well. It instantly boots and shuts down and i have no issues.