You are not logged in.

#1 2023-04-05 20:35:25

scatherinch
Member
Registered: 2023-02-24
Posts: 160

[SOLVED] CPUPOWER: Set CPU to High Performance Mode

System: Arch Linux
Kernel: 6.2.9-zen1-1-zen
CPU: AMD Ryzen 7 2700X (16) @ 3.786GHz
GPU: AMD ATI Radeon RX 550 640SP / RX 560/560X
WM: awesome

I've been reading an article here at the wiki ( https://wiki.archlinux.org/title/CPU_frequency_scaling ), trying to figure out how to set my machine up for a higher level of performance output. I chose cpupower for this task, but unfortunately, I haven't been able to get very far with it. I'm confused about what the wiki is trying to tell me about the kernel modules for my chip (AMD Ryzen 7) and after hours of tinkering with it and making little progress as to actually get this tool to work, thus, I've decided to turn here for answers.

So it tells me to find my available kernel modules for my chip by doing

$ ls /usr/lib/modules/$(uname -r)/kernel/drivers/cpufreq/

. I get these as my options but only two of the modules work, and believe me, I've tried them all:

acpi-cpufreq.ko.zst          amd-pstate-ut.ko.zst  pcc-cpufreq.ko.zst  speedstep-lib.ko.zst
amd_freq_sensitivity.ko.zst  p4-clockmod.ko.zst    powernow-k8.ko.zst

The two that work are amd-pstate and speedstep-lib (I think speedstep is for intel processors, which doesn't apply to my case, right? ).

I've tried doing modprobe amd_pstate and activating this, but whenever I invoke

$ cpupower frequency-info

in the terminal, it spits errors out at me telling me that it can't find a cpufreq driver and that's the part I'm stuck on.

There's also a GUI version of this tool as well called cpupower-gui but it comes up blank with no elements inside the GUI and it just doesn't display any information about my chip as its expected to. (It might be because I couldn't get it to find this cpufreq driver, thus it has no way of fetching the information as described to me in the artcle.)

Maybe someone could tell me where to go from here?

Last edited by scatherinch (2023-06-10 14:49:13)

Offline

#2 2023-04-06 02:38:01

Fijxu
Member
Registered: 2021-08-11
Posts: 44

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

Did you tried setting

amd_pstate=passive

in the kernel parameters? Asuming you are using GRUB, see this to set kernel parameters https://wiki.archlinux.org/title/Kernel_parameters#GRUB

Offline

#3 2023-04-06 11:03:58

scatherinch
Member
Registered: 2023-02-24
Posts: 160

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

Yeah, I did, but no luck unfortunately...

Offline

#4 2023-04-06 16:27:24

snakeroot
Member
Registered: 2012-10-06
Posts: 166

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

scatherinch wrote:

I've tried doing modprobe amd_pstate

amd_pstate is currently a boolean and thus is either compiled into the kernel or not and cannot be compiled as a module.

The kernel config file for 6.2.9.zen1-1 has amd_pstate set to yes so it's there, but modprobe-ing for it will get you nowhere.

It looks like 6.2.9.zen1-1 compiles the diagnostic module amd_pstate_ut. You might consider checking to see if it is loaded. If it is, then grep "amd_pstate_ut" in dmesg. If it is not, load it and then grep "amd_pstate_ut" in dmesg.

This will check to see if your BIOS supports amd_pstate ("acpi_cpc_valid") and if it is enabled ("check_enabled") as well as sanity checks on the performance and frequency settings ("check_perf" and "check_freq").

For more details on this module, see:

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

Offline

#5 2023-04-06 18:58:01

scatherinch
Member
Registered: 2023-02-24
Posts: 160

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

Okay, I loaded the kernel parameter

amd_pstate=passive

like Fijxu mentioned.

Then I did a command,

sudo dmesg | grep amd_pstate

which returned this:

[    0.372928] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled

What is this telling me exactly?

Last edited by scatherinch (2023-04-07 13:13:06)

Offline

#6 2023-04-07 13:52:32

snakeroot
Member
Registered: 2012-10-06
Posts: 166

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

I suspect it may be telling you that cppc is not supported in the BIOS, which is a prerequisite for using amd_pstate. As I stated above, load the diagnostic module _ut which will perform a CPC check.

Have a look at this thread:

https://forums.lenovo.com/t5/Other-Linu … 917?page=1

Also, you may want to search the Lenovo forums in which it is found to see if there's anything specific to your model.

You should also make sure your BIOS is up to date in case there's a fix in a later version than that which you're running.

Offline

#7 2023-04-07 13:58:30

scatherinch
Member
Registered: 2023-02-24
Posts: 160

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

I noticed something about that thread. Does it matter if I'm on a laptop or not, because I am not. This is a desktop PC. Also, forgive me, but how can I load that?

I am still very, very new to Linux.

Offline

#8 2023-04-07 17:03:34

snakeroot
Member
Registered: 2012-10-06
Posts: 166

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

$ sudo modprobe amd_pstate_ut
$ dmesg | grep amd_pstate_ut

If all is well, the output of dmesg should contain something like:

[ 6776.977796] amd_pstate_ut: 1    amd_pstate_ut_acpi_cpc_valid	 success!
[ 6776.977804] amd_pstate_ut: 2    amd_pstate_ut_check_enabled	 success!
[ 6776.978050] amd_pstate_ut: 3    amd_pstate_ut_check_perf	 success!
[ 6776.978052] amd_pstate_ut: 4    amd_pstate_ut_check_freq	 success!

However, I suspect that you may see a failure for amd_pstate_ut_acpi_cpc_valid.

As this is a bios/cpu issue, I'd doubt that the laptop/desktop distinction would matter.

Offline

#9 2023-04-07 18:18:52

scatherinch
Member
Registered: 2023-02-24
Posts: 160

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

Hey. I did some research and apparently, my chip in particular just isn't supported for this. I'm using a Ryzen 7 2700 and from what I'm reading, amd_pstate is only supported on chips with zen2: https://en.wikichip.org/wiki/amd/ryzen_7/2700  my chip is a zen+ ( https://en.wikichip.org/wiki/amd/microa … res/zen%2B ) , from what I've been reading ever since we last dropped off, I need a zen2 chip for pstate to even work.

I guess this is just impossible then, unless anyone knows anything that I missed?

Source: https://wiki.archlinux.org/title/CPU_fr … ng_drivers

Offline

#10 2023-04-08 10:57:46

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,831

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

scatherinch wrote:

I get these as my options but only two of the modules work, and believe me, I've tried them all:


The two that work are amd-pstate and speedstep-lib (I think speedstep is for intel processors, which doesn't apply to my case, right? ).

Your cpu should use the acpi_cpufreq kernel module which typically is automatically loaded on processors using it, check lsmod output .
If it doesn't show acpi_cpufreq , post full dmesg and journalctl -b  ouput (run both with root-rights) .

Last edited by Lone_Wolf (2023-04-08 10:59:20)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#11 2023-06-10 05:10:42

scatherinch
Member
Registered: 2023-02-24
Posts: 160

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

I have managed to figure this out. As it turns out, my CPU does support this! It is known as AMD Cool & Quiet. I had to enable this in the board's BIOs for cpupower to actually recognize it.

However, though it's enabled, now I have a different issue. I'm getting an error when trying to set the governor to 'performance'. Look at this code:

analyzing CPU 4:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 4
  CPUs which need to have their frequency coordinated by software: 4
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 2.20 GHz - 3.90 GHz
  available frequency steps:  3.90 GHz, 3.20 GHz, 2.20 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 2.20 GHz and 3.90 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency: 2.20 GHz (asserted by call to hardware)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3900MHz
    Pstate-P1:  3200MHz

sudo cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11
Setting cpu: 12
Setting cpu: 13
Setting cpu: 14
Setting cpu: 15
Following CPUs are offline:
16-31
cpupower set operation was not performed on them

Is it working as intended or do I need to figure something out further? It says that the operation was not  performed. In the BIOs, I put my CPU into PSTATE0 which is the highest performance setting possible, but I don't understand what it's telling me about these 2 offline cores.

Last edited by scatherinch (2023-06-10 07:46:02)

Offline

#12 2023-06-10 08:54:20

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 22,922

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

Those are the logical hyperthreaded cores that can't be adjusted so that is likely normal, artenatively the theoretical supported core count of the mainboard which isn't saturated by the CPU and thus also normal

Last edited by V1del (2023-06-10 09:50:30)

Offline

#13 2023-06-10 14:48:58

scatherinch
Member
Registered: 2023-02-24
Posts: 160

Re: [SOLVED] CPUPOWER: Set CPU to High Performance Mode

Alrighty, thank you so much, all of you!

Offline

Board footer

Powered by FluxBB