Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
AMD pstate problem [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 391

PostPosted: Fri Dec 30, 2022 3:04 am    Post subject: AMD pstate problem [SOLVED] Reply with quote

Hello,
can anyone help ? I followed Ryzen page regarding enabled support for AMD.
I can see Ryzen temperature via lm _ sensors.
Modprobed amd-pstate, but in cpupower I can´t see amd pstate. How to activate amd-pstate ? Should I disable other driver ?


Last edited by RIA77 on Mon Jan 30, 2023 1:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 423

PostPosted: Fri Dec 30, 2022 4:36 am    Post subject: Reply with quote

Check to see if CPPC is enabled in your BIOS/UEFI. If you have a Zen 2 or Zen 3 CPU, make sure ACPI CPPC is enabled if it is not already.
Check to make sure the pstate driver is actually in use:
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

I only have a Zen 1, so it is not and returns:
Code:
acpi-cpufreq

If for some reason you did not disable the ACPI CPUFreq in your kernel config, supposedly you can add this to your kernel boot parameters:
Code:
initcall_blacklist=acpi_cpufreq_init

This should keep it from loading and conflicting with the amd-pstate driver.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2438

PostPosted: Fri Dec 30, 2022 10:33 am    Post subject: Re: AMD pstate problem Reply with quote

RIA77 wrote:
How to activate amd-pstate ? Should I disable other driver ?


I'm using p-state since the beginning. The only way to enable it back then was t odisable all others in the kernel config. Besides there's no reason to keep the other drivers enabled.

Code:
cpupower frequency-info
analyzing CPU 0:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 131 us
  hardware limits: 400 MHz - 4.46 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 400 MHz and 4.46 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.66 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3200MHz
    Pstate-P1:  1300MHz
    Pstate-P2:  1200MHz


There's one other possibility, your CPU does not have MSR and should rely on shared memory instead, but I don't remember details. It's in the amd p-state documentation shipped with the kernel.

p.s. mine is 5800H, you didn't mention what's yours.
p.s. however I now checked the Ryzen wiki page, which I didn't know existed and some of the options there cannot be selected without also selectin ACPI CPUFREQ driver. I decided to check the description and here's what I noticed:

CONFIG_X86_ACPI_CPUFREQ: │
│ │
│ This driver adds a CPUFreq driver which utilizes the ACPI │
│ Processor Performance States. │
│ This driver also supports Intel Enhanced Speedstep and newer │
│ AMD CPUs.

So it supports newer AMD CPU's? I will investigate more and if I find something relevant I'll post it here.

Best Regards,
Georgi
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 423

PostPosted: Fri Dec 30, 2022 4:42 pm    Post subject: Reply with quote

Yes, acpi-cpufreq supports newer AMD cpus. If you have a Zen 2 or newer, you can consider switching to the amd-pstate driver for the additional features it supports. Otherwise, you can still use acpi-cpufreq; however, you cannot load and use both modules at the same time.
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 188

PostPosted: Sat Dec 31, 2022 9:13 am    Post subject: Reply with quote

Did you add amd_pstate=passive in your boot parameters ?
I need to do that since kernel 6.0 or driver won't load. (Used to be amd_pstate.shared_mem=1 on previous kernels)
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2438

PostPosted: Sat Dec 31, 2022 10:10 am    Post subject: Reply with quote

krumpf wrote:
Did you add amd_pstate=passive in your boot parameters ?
I need to do that since kernel 6.0 or driver won't load. (Used to be amd_pstate.shared_mem=1 on previous kernels)


Hello krumpf,

As I commented above, some processors don't have MSR (model specific register) and need to use the shared memory solution. When giving such advice you should be aware if it's relevant and since the OP didn't specify what processor they are using, this advise may or may nor be relevant.

Best Regards,
Georgi
Back to top
View user's profile Send private message
ebray187
Tux's lil' helper
Tux's lil' helper


Joined: 02 Mar 2005
Posts: 121
Location: Al otro lado de la pantalla

PostPosted: Thu Jan 05, 2023 4:54 am    Post subject: Reply with quote

krumpf wrote:
Did you add amd_pstate=passive in your boot parameters ?
I need to do that since kernel 6.0 or driver won't load. (Used to be amd_pstate.shared_mem=1 on previous kernels)


Thanks!
_________________
# emerge -C world >> 9/8
A flower?!
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3940
Location: Hamburg

PostPosted: Sun Jan 08, 2023 9:38 pm    Post subject: Reply with quote

krumpf wrote:
Did you add amd_pstate=passive in your boot parameters ?

Either this helped or using MSR here for AMD Ryzen 9 5950X.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6148
Location: Dallas area

PostPosted: Sun Jan 08, 2023 9:44 pm    Post subject: Reply with quote

As noted above, since kernel 6.0 the way to have amd pstate is using the passive parm.
The amd module that supplied the mem option (5.17 <-> 5.19) had the option removed.

I'm running amd pstate now, just changed over this morning.
_________________
UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 391

PostPosted: Thu Jan 12, 2023 7:29 pm    Post subject: Reply with quote

Which log I need to provide ? I still can't figure out what I have missed. I turned on amd pstate, but cpupower won't show me, it shows cpufreq driver.
Back to top
View user's profile Send private message
rab0171610
Guru
Guru


Joined: 24 Dec 2022
Posts: 423

PostPosted: Thu Jan 12, 2023 8:51 pm    Post subject: Reply with quote

With all the helpful user's posts since your initial post 2 weeks ago, which of those have you tried? Please be specific. Also, please provide exact details of what you mean by:
Quote:
I turned on amd pstate

We need more information than
Quote:
I turned it on
and
Quote:
I followed the Ryzen (wiki page)
What exact steps have you taken since your initial post?
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 391

PostPosted: Thu Jan 12, 2023 9:04 pm    Post subject: Reply with quote

During compile of kernel, I switched on amd pstate in order to compile kernel with amd pstate. But it won't show.
Actually, there is no my CPU. Not even in lm-sensors.
Cpupower is showing cpu, but with cpufreq plugin instead of amd pstate.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6148
Location: Dallas area

PostPosted: Thu Jan 12, 2023 11:41 pm    Post subject: Reply with quote

Code:
cpupower frequency-info


Is this the command you are using?

Code:
zgrep PSTATE /proc/config.gz


What does the above return?
_________________
UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 391

PostPosted: Sat Jan 28, 2023 4:15 pm    Post subject: Reply with quote

Code:
zgrep PSTATE /proc/config.gz
gzip: /proc/config.gz: No such file or directory

I have installed ryzen_smu. Sensors with 5500u is working in lm_sensors and xsensors but not in xfce4-sensors.
In xfce4-sensors there is no nvme temps and cpu temps.
Xsensors application is showing nvme and CPU temperatures.
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 188

PostPosted: Sun Jan 29, 2023 8:14 am    Post subject: Reply with quote

Moose's command, alternative
Code:
grep -i pstate /boot/config-$(uname -r)

Mostly to confirm that CONFIG_X86_AMD_PSTATE=y meaning amd pstate driver is enabled in kernel.
Depending on kernel version, there may be (or not) another amd pstate line CONFIG_X86_AMD_PSTATE_UT, ignore it.

To check the scaling driver in use :
Code:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver

It will output the scaling driver used by each cpu thread, so you should get either acpi-cpufreq or amd-pstate.

If it's set on acpi-cpufreq, it means the kernel didn't load the amd-pstate, so you have to force it by tweaking /etc/default/grub with the following - depends on your kernel version:
Code:
kernel 5.xx
GRUB_CMDLINE_LINUX="amd_pstate.shared_mem=1"
kernel 6.xx
GRUB_CMDLINE_LINUX="amd_pstate=passive"

Save modifications, then run grub-mkconfig -o /boot/grub/grub.cfg, reboot, and check CPU scaling driver, should be amd-pstate now.

About xfce4-sensors, did you add the lm-sensors USE flag ? I think it's required so the xfce plugin can access everything monitored by lm-sensors.
Back to top
View user's profile Send private message
RIA77
Guru
Guru


Joined: 24 Feb 2016
Posts: 391

PostPosted: Mon Jan 30, 2023 1:12 pm    Post subject: Reply with quote

Thank you. This is the key for Gentoo and other distros as well

Code:
GRUB_CMDLINE_LINUX="amd_pstate=passive"


Thank you very much!

Can someone add Ryzen 5500u in Wiki as supported CPU with information regarding additional settings ?
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2438

PostPosted: Mon Jan 30, 2023 1:30 pm    Post subject: Reply with quote

RIA77 wrote:
Thank you. This is the key for Gentoo and other distros as well

Code:
GRUB_CMDLINE_LINUX="amd_pstate=passive"


Thank you very much!

Can someone add Ryzen 5500u in Wiki as supported CPU with information regarding additional settings ?


This is the key for zen2, zen3 should work out of the box. Regarding the wiki, you can do it too.

Best Regards,
Georgi
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2078
Location: San Jose, CA

PostPosted: Sun Mar 12, 2023 5:00 pm    Post subject: Reply with quote

krumpf wrote:
Did you add amd_pstate=passive in your boot parameters ?
I need to do that since kernel 6.0 or driver won't load. (Used to be amd_pstate.shared_mem=1 on previous kernels)


Thanks for this. Phoronix did not mention this in his article.
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
slackin35
n00b
n00b


Joined: 20 Nov 2024
Posts: 1
Location: Virginia

PostPosted: Wed Nov 20, 2024 7:05 am    Post subject: You rock! Reply with quote

krumpf wrote:
Did you add amd_pstate=passive in your boot parameters ?
I need to do that since kernel 6.0 or driver won't load. (Used to be amd_pstate.shared_mem=1 on previous kernels)


I created a whole account on the forums, for the first time after using gentoo for over a decade, just to say THANK YOU. Jesus, I've been fighting this for a bit now and this was the answer. I was using the old line and it wasn't doing anything.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2438

PostPosted: Wed Nov 20, 2024 7:23 am    Post subject: Reply with quote

They changed this a couple of times. Now I think it uses some internal scheduler of you leave it in active mode i.e. without the line. I have to check the documentation once again to be sure.

If in active mode it won't show in cpupower.

Best Regards,
Georgi
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 188

PostPosted: Wed Nov 20, 2024 8:18 am    Post subject: Reply with quote

Since kernel 6.6 I think, there's a new option :
Power management and ACPI options > CPU Frequency scaling > AMD Processor P-State default mode
Code:
CONFIG_X86_AMD_PSTATE_DEFAULT_MODE
  │ The value set has the following meanings:
  │       1 -> Disabled
  │       2 -> Passive
  │       3 -> Active (EPP)
  │       4 -> Guided

My cpu is a zen3, I've set the default mode to guided, with schedutil as cpu governor. In /etc/default/grub I've changed the parameter to amd_pstate=guided but I'm not sure it's useful since it's already the default in kernel settings.
_________________
Dragon Princess Music Games Heroes and villains
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum