You are not logged in.

#26 2022-08-04 09:58:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,644
Website

Re: using the amd-pstate driver in kernel 5.17

The TODO comment is still present in the driver code.  Even though it scales, it is likely giving you inferior performance.

https://github.com/torvalds/linux/blob/ … tate.c#L53


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#27 2022-08-04 11:00:31

regulator
Member
Registered: 2020-01-15
Posts: 22

Re: using the amd-pstate driver in kernel 5.17

graysky wrote:

The TODO comment is still present in the driver code.  Even though it scales, it is likely giving you inferior performance.

https://github.com/torvalds/linux/blob/ … tate.c#L53

good callout, it's definitely still in the early stages.. I'll run some power usage benchmarks when I get time to see if its actually performing better or not.

Offline

#28 2022-08-04 11:15:22

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

Message deleted to avoid confusion. See this: https://bbs.archlinux.org/viewtopic.php … 8#p2062998

Last edited by agapito (2023-02-01 12:18:45)


Excuse my poor English.

Offline

#29 2022-08-12 22:21:58

I_Use_Arch_BTW45
Member
Registered: 2021-12-05
Posts: 42

Re: using the amd-pstate driver in kernel 5.17

when I type lscpu, it shows that cppc is supported, but when I run sudo modprobe amd_pstate dyndbg==pmf -v
I get
amd_pstate:amd_pstate_init: amd_pstate: the _CPC object is not present in SBIOS

I am using a ideapad flex 5 with a ryzen 7 4700u
there is no option in my bios to enable cppc, nor is there any info online or in the bios stating that the laptop doesn't support it

Last edited by I_Use_Arch_BTW45 (2022-08-12 22:24:51)

Offline

#30 2022-08-13 04:39:57

regulator
Member
Registered: 2020-01-15
Posts: 22

Re: using the amd-pstate driver in kernel 5.17

I_Use_Arch_BTW45 wrote:

when I run sudo modprobe amd_pstate dyndbg==pmf -v
I get
amd_pstate:amd_pstate_init: amd_pstate: the _CPC object is not present in SBIOS

Did you already add those two kernel parameters?
I have an Ideapad and I believe CPPC is already enabled, there is no toggle in my BIOS.

Offline

#31 2022-08-15 11:01:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,644
Website

Re: using the amd-pstate driver in kernel 5.17

https://www.phoronix.com/news/AMD-P-Sta … t-Miss-6.0  but the v5 proposed changes still include the TODO statement for share memory chips


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#32 2022-08-15 15:45:11

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

Message deleted to avoid confusion. See this: https://bbs.archlinux.org/viewtopic.php … 8#p2062998

Last edited by agapito (2023-02-01 12:18:56)


Excuse my poor English.

Offline

#33 2022-08-15 15:55:21

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,644
Website

Re: using the amd-pstate driver in kernel 5.17

Assuming you are force enabling the driver, it may work fine but it is likely not optimal.  See the comments in the code I linked above.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#34 2022-08-15 17:01:57

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

Message deleted to avoid confusion. See this: https://bbs.archlinux.org/viewtopic.php … 8#p2062998

Last edited by agapito (2023-02-01 12:19:26)


Excuse my poor English.

Offline

#35 2022-08-15 20:08:59

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,644
Website

Re: using the amd-pstate driver in kernel 5.17

I'll wait but do what you will with your hardware tongue


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#36 2022-08-21 08:14:13

regulator
Member
Registered: 2020-01-15
Posts: 22

Re: using the amd-pstate driver in kernel 5.17

I saw that Pop_OS have now enabled amd pstate by default if its supported.

I tried to record some figures but it seems that power usage when idle, when watching a movie, and under max load are pretty similar between amd_pstate and the default ACPI driver. The main thing I notice is under amd.pstate the fan barely comes on when on battery power.

p.s. since kernel 5.19 my scaling issues with schedutil are fixed!

Offline

#37 2022-09-09 22:31:48

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17


Excuse my poor English.

Offline

#38 2022-10-19 16:39:38

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

I've been testing during the last week the newish and still work in progress amd-epp driver, and works great on my 5950x (powersave governor - performance scaling), much better than the default acpi-freq or amd-pstate schedutil option. My CPU idles at 550 Mhz and the performance is like using acpi-cpufreq-performance or even better.

# cpupower frequency-info
analyzing CPU 0:
  driver: amd_pstate_epp
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 550 MHz - 5.08 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 550 MHz and 5.08 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.62 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3400MHz
    Pstate-P1:  2800MHz
    Pstate-P2:  2200MHz

Last edited by agapito (2022-12-28 22:08:23)


Excuse my poor English.

Offline

#39 2022-10-19 18:31:10

obelisk
Member
Registered: 2021-01-10
Posts: 62

Re: using the amd-pstate driver in kernel 5.17

interesting... can you post your output of modinfo amd_pstate please?

Offline

#40 2022-10-20 06:50:18

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

obelisk wrote:

interesting... can you post your output of modinfo amd_pstate please?

name:           amd_pstate
filename:       (builtin)
license:        GPL
file:           drivers/cpufreq/amd_pstate
description:    AMD Processor P-state Frequency Driver
author:         Huang Rui <ray.huang@amd.com>
parm:           shared_mem:enable amd-pstate on processors with shared memory solution (false = disabled (default), true = enabled) (bool)
parm:           epp_enabled:Enable energy performance preference (EPP) control (bool) 

# cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor 
powersave

# cat /sys/devices/system/cpu/cpu1/cpufreq/energy_performance_preference 
performance 
Every 2,0s: cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq /sys/devices/system/cpu/cpu10/cpufreq/scaling_cur_freq ...  archlinux: Thu Oct 20 08:49:23 2022

550000
550000
550000
550000
3599044
550000
550000
3493768
550000
550000
550000
3566702
550000
550000
550000
550000
550000
550000
550000
550000
550000
550000
550000
550000
550000
550000
4888830
550000
550000
550000
550000
550000

Excuse my poor English.

Offline

#41 2022-11-08 15:26:01

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

Message deleted to avoid confusion. See this: https://bbs.archlinux.org/viewtopic.php … 0#p2082430

Last edited by agapito (2023-02-01 12:20:06)


Excuse my poor English.

Offline

#42 2022-11-11 22:05:41

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,644
Website

Re: using the amd-pstate driver in kernel 5.17

graysky wrote:

The TODO comment is still present in the driver code.  Even though it scales, it is likely giving you inferior performance.

https://github.com/torvalds/linux/blob/ … tate.c#L53

Quoting myself from before, but this is still a true statement.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#43 2022-11-12 09:25:15

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

graysky wrote:
graysky wrote:

The TODO comment is still present in the driver code.  Even though it scales, it is likely giving you inferior performance.

https://github.com/torvalds/linux/blob/ … tate.c#L53

Quoting myself from before, but this is still a true statement.

You are wrong. That comment was written almost 1 year ago, when the new amd-pstate-epp driver was not even created. You still can see that kind of comments in the new epp patches.

Due to the performance issue on the processors with `Shared Memory Support`, we disable it presently and will re-enable this by default once we address performance issue with this solution.

But apparently no one has bothered to test it in the last few months because... "EPP:powersave: balance performance" state from EPP driver works GREAT on my 5950x. My CPU idles at 550 Mhz and the performance is like using acpi-cpufreq performance governor. I had zero problems during the last two months using it.

Try v4 yourself: https://www.phoronix.com/news/AMD-P-State-EPP-v4

Have you already tried it? Ok, then tell us how was your experience compared to the kernel defaults (acpi_cpufreq - schedutil).


Excuse my poor English.

Offline

#44 2022-11-12 11:14:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,644
Website

Re: using the amd-pstate driver in kernel 5.17

Am I confusing two different drivers?  Applying the v4 patch to 6.0.8 results in drivers/cpufreq/amd-pstate.c still advertising that warning.

For reference, here is the rebased patchset: https://gist.github.com/graysky2/4bdf30 … 659708abbf

EDIT: look at Documentation/admin-guide/pm/amd-pstate.rst after you apply the patch:

Documentation/admin-guide/pm/amd-pstate.rst wrote:

...

Kernel Module Options for ``amd-pstate``
=========================================

``shared_mem``
Use a module param (shared_mem) to enable related processors manually with
**amd_pstate.shared_mem=1**.
Due to the performance issue on the processors with `Shared Memory Support
<perf_cap_>`_, we disable it presently and will re-enable this by default
once we address performance issue with this solution.

To check whether the current processor is using `Full MSR Support <perf_cap_>`_
or `Shared Memory Support <perf_cap_>`_ : ::

...

Is applies to this version of the driver, no?

Last edited by graysky (2022-11-12 11:24:10)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#45 2022-11-12 13:44:42

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

Message deleted to avoid confusion. See this: https://bbs.archlinux.org/viewtopic.php … 0#p2082430

Last edited by agapito (2023-02-01 12:12:34)


Excuse my poor English.

Offline

#46 2022-12-02 12:17:39

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

Message deleted to avoid confusion. See this: https://bbs.archlinux.org/viewtopic.php … 0#p2082430

Last edited by agapito (2023-02-01 12:12:25)


Excuse my poor English.

Offline

#47 2022-12-22 15:05:05

obelisk
Member
Registered: 2021-01-10
Posts: 62

Re: using the amd-pstate driver in kernel 5.17

Short:
I can confirm, that amd_pstate=passive is needed, up from linux 6.1.1.arch1-1

Long:
I use the official archlinux kernel package, and got today update to 6.1.1, package: linux 6.1.1.arch1-1

> uname -r
6.1.1-arch1-1

With the update my CPU frequency goes not more down to 550MHz in idle state. The driver is now direct in the kenel comiled, not more as loadable module.
I have to change some points that it's runs again:

1. Removing manually loading the kernel module: mv /etc/modules-load.d/amd_pstate.conf /etc/modules-load.d/amd_pstate.conf_off
2. (for those who load it here), removing amd_pstate in file /etc/mkinitcpio.conf in line MODULES=(... amd_pstate ...), to MODULES=(...), (the dots for possible other entries)
3. And the main important thing on my Desktop-PC: Changing kernel parameter command line. I use systemd-boot, my boot parameter:

> cat /boot/loader/entries/arch.conf 
title   Archlinux
linux   /vmlinuz-linux
initrd  /amd-ucode.img
initrd  /initramfs-linux.img

#options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw loglevel=2  amd_pstate.shared_mem=1    <<<not more working with linux 6.1.1.arch1-1
options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw loglevel=2 amd_pstate=passive

Result: When I check the frequency with cpu-x, the frequency goes again down to 550MHz.

Checking it driver is loaded and other informations:

> ls -l /sys/devices/system/cpu/cpu0/cpufreq/
> cat /sys/devices/system/cpu/cpu0/cpufreq/*
> cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
> cpupower frequency-info

Additional informations:
https://git.kernel.org/pub/scm/linux/ke … c?h=v6.1.1
#here search for text amd_pstate=passive, there it is described.
https://git.kernel.org/pub/scm/linux/ke … ?id=v6.1.1

Offline

#48 2022-12-25 10:08:57

Arup
Member
From: Earth
Registered: 2014-02-20
Posts: 95

Re: using the amd-pstate driver in kernel 5.17

obelisk wrote:

Short:
I can confirm, that amd_pstate=passive is needed, up from linux 6.1.1.arch1-1

Long:
I use the official archlinux kernel package, and got today update to 6.1.1, package: linux 6.1.1.arch1-1

> uname -r
6.1.1-arch1-1

With the update my CPU frequency goes not more down to 550MHz in idle state. The driver is now direct in the kenel comiled, not more as loadable module.
I have to change some points that it's runs again:

1. Removing manually loading the kernel module: mv /etc/modules-load.d/amd_pstate.conf /etc/modules-load.d/amd_pstate.conf_off
2. (for those who load it here), removing amd_pstate in file /etc/mkinitcpio.conf in line MODULES=(... amd_pstate ...), to MODULES=(...), (the dots for possible other entries)
3. And the main important thing on my Desktop-PC: Changing kernel parameter command line. I use systemd-boot, my boot parameter:

> cat /boot/loader/entries/arch.conf 
title   Archlinux
linux   /vmlinuz-linux
initrd  /amd-ucode.img
initrd  /initramfs-linux.img

#options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw loglevel=2  amd_pstate.shared_mem=1    <<<not more working with linux 6.1.1.arch1-1
options root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rw loglevel=2 amd_pstate=passive

Result: When I check the frequency with cpu-x, the frequency goes again down to 550MHz.

Checking it driver is loaded and other informations:

> ls -l /sys/devices/system/cpu/cpu0/cpufreq/
> cat /sys/devices/system/cpu/cpu0/cpufreq/*
> cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
> cpupower frequency-info

Additional informations:
https://git.kernel.org/pub/scm/linux/ke … c?h=v6.1.1
#here search for text amd_pstate=passive, there it is described.
https://git.kernel.org/pub/scm/linux/ke … ?id=v6.1.1

Same case here with my ryzen 3900x, had to add the amd_pstate to the kernel parameter to get pstate working. I did it for the first time, I also enabled CPCC in BIOS as well as PBO and Cool n Quiet. I find the CPU in general run cooler under full load and compared to acpi-cpufreq, the frequency generally stays at 1.5 during light load whereas earlier it would never drop below 2.5.

Offline

#49 2022-12-28 21:45:20

regulator
Member
Registered: 2020-01-15
Posts: 22

Re: using the amd-pstate driver in kernel 5.17

Hi guys, a few things

1. in dmesg and journalctl there is no mention of amd-pstate is that normal?

2. how do i validate that my system is using the new epp mode?

3. is it possible yet to lower the highest performance "hint"?

I've been playing a lot with governors and max mhz but ultimately my cpu fan is still on most of the time, also read some people believe that current mhz of a cpu has no reflection on actual power usage which seems hard to believe

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: 2.64 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.46 GHz.
    AMD PSTATE Nominal Performance: 119. Nominal Frequency: 3.20 GHz.
    AMD PSTATE Lowest Non-linear Performance: 41. Lowest Non-linear Frequency: 1.10 GHz.
    AMD PSTATE Lowest Performance: 15. Lowest Frequency: 400 MHz.

Last edited by regulator (2022-12-28 21:53:35)

Offline

#50 2022-12-28 22:07:00

agapito
Member
From: Who cares.
Registered: 2008-11-13
Posts: 678

Re: using the amd-pstate driver in kernel 5.17

regulator wrote:

Hi guys, a few things

1. in dmesg and journalctl there is no mention of amd-pstate is that normal?

2. how do i validate that my system is using the new epp mode?

3. is it possible yet to lower the highest performance "hint"?

I've been playing a lot with governors and max mhz but ultimately my cpu fan is still on most of the time, also read some people believe that current mhz of a cpu has no reflection on actual power usage which seems hard to believe

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: 2.64 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    AMD PSTATE Highest Performance: 166. Maximum Frequency: 4.46 GHz.
    AMD PSTATE Nominal Performance: 119. Nominal Frequency: 3.20 GHz.
    AMD PSTATE Lowest Non-linear Performance: 41. Lowest Non-linear Frequency: 1.10 GHz.
    AMD PSTATE Lowest Performance: 15. Lowest Frequency: 400 MHz.

Have you compiled your kernel with the epp patch i posted on my previous message?

You are not using epp mode anyways.

# cpupower frequency-info
analyzing CPU 0:
  driver: amd_pstate_epp
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 550 MHz - 5.08 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 550 MHz and 5.08 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.60 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3400MHz
    Pstate-P1:  2800MHz
    Pstate-P2:  2200MHz

When you compile your patched kernel you need this config too:

CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE=y

and you enable epp mode using 

amd_pstate=active

as boot parameter.

I have been using the epp driver for the last 3 months and it works really well.

Last edited by agapito (2023-02-01 12:14:10)


Excuse my poor English.

Offline

Board footer

Powered by FluxBB