Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

AMD pstate problem [SOLVED]

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
27 posts
  • 1
  • 2
  • Next
Author
Message
RIA77
Guru
Guru
Posts: 425
Joined: Wed Feb 24, 2016 4:52 am

AMD pstate problem [SOLVED]

  • Quote

Post by RIA77 » Fri Dec 30, 2022 3:04 am

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.
Top
rab0171610
l33t
l33t
Posts: 721
Joined: Sat Dec 24, 2022 1:41 am

  • Quote

Post by rab0171610 » Fri Dec 30, 2022 4:36 am

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: Select all

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
I only have a Zen 1, so it is not and returns:

Code: Select all

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: Select all

initcall_blacklist=acpi_cpufreq_init
This should keep it from loading and conflicting with the amd-pstate driver.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3534
Joined: Thu Feb 22, 2018 2:29 pm

Re: AMD pstate problem

  • Quote

Post by logrusx » Fri Dec 30, 2022 10:33 am

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: Select all

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
Top
rab0171610
l33t
l33t
Posts: 721
Joined: Sat Dec 24, 2022 1:41 am

  • Quote

Post by rab0171610 » Fri Dec 30, 2022 4:42 pm

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.
Top
krumpf
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Sun Jul 15, 2018 11:21 pm

  • Quote

Post by krumpf » Sat Dec 31, 2022 9:13 am

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)
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3534
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Sat Dec 31, 2022 10:10 am

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
Top
ebray187
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 123
Joined: Wed Mar 02, 2005 9:55 pm
Location: Al otro lado de la pantalla

  • Quote

Post by ebray187 » Thu Jan 05, 2023 4:54 am

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?!
Top
toralf
Developer
Developer
User avatar
Posts: 3944
Joined: Sun Feb 01, 2004 2:58 pm
Location: Hamburg
Contact:
Contact toralf
Website

  • Quote

Post by toralf » Sun Jan 08, 2023 9:38 pm

krumpf wrote:Did you add amd_pstate=passive in your boot parameters ?
Either this helped or using MSR here for AMD Ryzen 9 5950X.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Sun Jan 08, 2023 9:44 pm

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 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
RIA77
Guru
Guru
Posts: 425
Joined: Wed Feb 24, 2016 4:52 am

  • Quote

Post by RIA77 » Thu Jan 12, 2023 7:29 pm

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.
Top
rab0171610
l33t
l33t
Posts: 721
Joined: Sat Dec 24, 2022 1:41 am

  • Quote

Post by rab0171610 » Thu Jan 12, 2023 8:51 pm

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:
I turned on amd pstate
We need more information than
I turned it on
and
I followed the Ryzen (wiki page)
What exact steps have you taken since your initial post?
Top
RIA77
Guru
Guru
Posts: 425
Joined: Wed Feb 24, 2016 4:52 am

  • Quote

Post by RIA77 » Thu Jan 12, 2023 9:04 pm

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.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Thu Jan 12, 2023 11:41 pm

Code: Select all

cpupower frequency-info
Is this the command you are using?

Code: Select all

zgrep PSTATE /proc/config.gz
What does the above return?
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
RIA77
Guru
Guru
Posts: 425
Joined: Wed Feb 24, 2016 4:52 am

  • Quote

Post by RIA77 » Sat Jan 28, 2023 4:15 pm

Code: Select all

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.
Top
krumpf
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Sun Jul 15, 2018 11:21 pm

  • Quote

Post by krumpf » Sun Jan 29, 2023 8:14 am

Moose's command, alternative

Code: Select all

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: Select all

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: Select all

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.
Top
RIA77
Guru
Guru
Posts: 425
Joined: Wed Feb 24, 2016 4:52 am

  • Quote

Post by RIA77 » Mon Jan 30, 2023 1:12 pm

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

Code: Select all

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 ?
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3534
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Mon Jan 30, 2023 1:30 pm

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

Code: Select all

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
Top
RayDude
Advocate
Advocate
User avatar
Posts: 2195
Joined: Sat May 29, 2004 6:11 am
Location: San Jose, CA

  • Quote

Post by RayDude » Sun Mar 12, 2023 5:00 pm

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.
Top
slackin35
n00b
n00b
Posts: 1
Joined: Wed Nov 20, 2024 7:02 am
Location: Virginia
Contact:
Contact slackin35
Website

You rock!

  • Quote

Post by slackin35 » Wed Nov 20, 2024 7:05 am

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.
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3534
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Wed Nov 20, 2024 7:23 am

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.

Best Regards,
Georgi
Last edited by logrusx on Wed Nov 20, 2024 11:11 am, edited 1 time in total.
Top
krumpf
Apprentice
Apprentice
User avatar
Posts: 268
Joined: Sun Jul 15, 2018 11:21 pm

  • Quote

Post by krumpf » Wed Nov 20, 2024 8:18 am

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: Select all

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
Top
logrusx
Advocate
Advocate
User avatar
Posts: 3534
Joined: Thu Feb 22, 2018 2:29 pm

  • Quote

Post by logrusx » Wed Nov 20, 2024 11:14 am

I now remember playing with it. In active mode it will only use powersave and performance governors and will internally scale frequencies. In passive it'll only use performance governors and in guided it'll take hints from them.

However it turned out S3 Sleep is broken on 6.6 so I dropped back to 6.1 where I need it in passive mode. Before that passive mode was only for the CPU's that didn't have MSR registers.

Best Regards,
Georgi
Top
Ridrok
Tux's lil' helper
Tux's lil' helper
Posts: 127
Joined: Sun Jan 26, 2014 3:17 pm
Location: France

  • Quote

Post by Ridrok » Thu Nov 21, 2024 8:07 am

Many thanks for this subject.
I was coming here to open the same question. I discovered that my Ryzen 5900X on ASUS ROG CROSSHAIR VII HERO was not going bellow 2.6Ghz while in Windows it could go down to 550 Mhz.
I did solve the problem by deselecting ACPI CUPFreq in menuconfig and let amd_pstate then added amd_pstate=passive to GRUB_CMDLINE_LINUX_DEFAULT and now it go down to 550Mhz et up to 4950Mhz

Code: Select all

LANG="C" cpupower frequency-info
analyzing CPU 7:
  driver: amd-pstate
  CPUs which run at the same hardware frequency: 7
  CPUs which need to have their frequency coordinated by software: 7
  maximum transition latency: 20.0 us
  hardware limits: 550 MHz - 4.95 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 550 MHz and 4.95 GHz.
                  The governor "conservative" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.04 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.95 GHz.
    AMD PSTATE Nominal Performance: 124. Nominal Frequency: 3.70 GHz.
    AMD PSTATE Lowest Non-linear Performance: 58. Lowest Non-linear Frequency: 1.73 GHz.
    AMD PSTATE Lowest Performance: 19. Lowest Frequency: 550 MHz
So thank you again for this.
Top
finoderi
Tux's lil' helper
Tux's lil' helper
Posts: 89
Joined: Fri Oct 29, 2021 4:26 am

  • Quote

Post by finoderi » Fri Nov 22, 2024 7:57 pm

krumpf wrote: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: Select all

CONFIG_X86_AMD_PSTATE_DEFAULT_MODE
  │ The value set has the following meanings:
  │       1 -> Disabled
  │       2 -> Passive
  │       3 -> Active (EPP)
  │       4 -> Guided
As far as I can tell, those kernel settings have never worked. So the only way to actually change amd_pstate mode is using the kernel command line.
Top
_Rick_
n00b
n00b
Posts: 1
Joined: Fri Aug 15, 2025 5:40 pm

  • Quote

Post by _Rick_ » Fri Aug 15, 2025 5:45 pm

logrusx wrote:I now remember playing with it. In active mode it will only use powersave and performance governors and will internally scale frequencies. In passive it'll only use performance governors and in guided it'll take hints from them.
This confused me to no end - I actually didn't even have a powersave governor compiled into the kernel, and yet it was one of the available ones.
Also, my default scheduler was "conservative" which would fail spectacularly during boot.

Really annoying bug in the kernel config, which I have no idea where to raise - setting default mode to active (even if it does nothing else, without the kernel param) should at least disable all other governors.

Alternatively, the amd-pstates-epp governors should be renamed, as not to cause confusion with the actual governors.
Top
Post Reply

27 posts
  • 1
  • 2
  • Next

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic