Announcement

Collapse
No announcement yet.

Linux 6.6's cpupower Utility Enables New AMD P-State Features

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Linux 6.6's cpupower Utility Enables New AMD P-State Features

    Phoronix: Linux 6.6's cpupower Utility Enables New AMD P-State Features

    Linux's cpupower utility lives within the Linux kernel source tree for reading and tuning various CPU power settings rather than poking at sysfs files directly or other means of adjusting your processor power-related tunables. With the upcoming Linux 6.6 kernel cycle the cpupower utility is adding support for adjusting new AMD P-State driver features...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    I did not very scientific synthetic tests with all the different modes including the new guided mode to see how they would perform and my results pretty much lined up with the previous EPYC tests. I only tested with the performance governor since my 5900X gets constrained by the others. I tracked the end result and monitored the frequency with ryzen_smu and ryzen_monitor.

    Guided autonomous mode came out on top, followed by active EPP mode, then with passive mode and CPUFreq being very close to each other. The difference was down to about 10-15MHz from guided to CPUFreq.

    The differences do manifest themselves statistically in synthetic benchmarks, but with only a 0.6% difference at most in one test score and a 50 millisecond difference in another timed benchmark, it won't translate to anything meaningful in real world performance at least on desktops.

    It will be interesting to see tests with guided mode on laptops and mini PCs. The power and thermal constraints led to a more meaningful impact with performance-balanced EPP on the laptops, so maybe guided mode might eek out a bit more.

    Comment


    • #3
      For benefiting both AMD and Intel P-State drivers, there is Energy Performance Preference (EPP) value change support. This allows adjusting the EPP value from the cpupower utility for indicating your energy/performance preference that in turn ultimately influences the CPU frequency scaling behavior. This is exposed via a new "epp" option for cpupower.
      Intel CPUs are accepting values in the range between 0-15, whereas last I checked on AMD it was 0-255 for setting the EPP.

      Is that still the case and if yes, why can't the developers settle on standard values across vendors for this?

      Comment


      • #4
        Not all AMD CPU's support all the p-states. I don't have an "exact" accounting, but most 5000 series Ryzen desktop CPU's only support 3 states. It appears it increases with each new increment of Zen that is released.

        Comment


        • #5
          Building tools supplied by the Linux kernel is a crap shoot. cpupower has a handcrafted Makefile that builds a shared library and puts it in /usr/lib64 . That looks okay for RedHat based systems, not so much for Ubuntu/Debian users. Perhaps RedHat and other companies that profit from the Linux kernel could contribute a few of their professional maintainers to clean up this sort of stuff.

          Comment


          • #6
            Originally posted by edwaleni View Post
            Not all AMD CPU's support all the p-states. I don't have an "exact" accounting, but most 5000 series Ryzen desktop CPU's only support 3 states. It appears it increases with each new increment of Zen that is released.
            I don't have any of the relevant chips, but are you sure you're using amd-pstate? As I recall a very small number of states is what you see with the acpi-cpufreq driver.

            Comment


            • #7
              Originally posted by edwaleni View Post
              Not all AMD CPU's support all the p-states. I don't have an "exact" accounting, but most 5000 series Ryzen desktop CPU's only support 3 states. It appears it increases with each new increment of Zen that is released.
              3 states is an ACPI Ryzen thing. AFAIK, all Ryzens are like this (at least Zen 2 and up on AM4):

              With acpi_cpufreq you'll get 3 states. Lowest, Middle, Highest. That's it. amd-pstate, however, while still having the three state limitation, is able to change the frequency of those available states.

              This is literally from my Zen 2 PC right now:

              Code:
              sudo cpupower frequency-info
              
              analyzing CPU 3:
              driver: amd-pstate-epp
              CPUs which run at the same hardware frequency: 3
              CPUs which need to have their frequency coordinated by software: 3
              maximum transition latency: Cannot determine or is not supported.
              hardware limits: 400 MHz - 4.31 GHz
              available cpufreq governors: performance powersave
              current policy: frequency should be within 400 MHz and 4.31 GHz.
              The governor "performance" may decide which speed to use
              within this range.
              current CPU frequency: Unable to call hardware
              current CPU frequency: 3.07 GHz (asserted by call to kernel)
              boost state support:
              Supported: yes
              Active: yes
              Boost States: 0
              Total States: 3
              Pstate-P0: 3700MHz
              Pstate-P1: 1700MHz
              Pstate-P2: 1400MHz
              It supports anything between 400MHz and 4.31GHz. Using acpi_cpufreq P2 would be forced to 400MHz and P0 would be forced to 4.31GHz. I honestly don't remember what my CPU's Middle frequency is to tell you what P1 would be. amd-pstate can dynamically change those three available Pstate frequencies to give the scheduler more room to work with. If you're not running a maxed out workload you can be better served somewhere between Middle and High frequency.
              Last edited by skeevy420; 02 August 2023, 09:48 AM.

              Comment


              • #8
                Originally posted by yump View Post

                I don't have any of the relevant chips, but are you sure you're using amd-pstate? As I recall a very small number of states is what you see with the acpi-cpufreq driver.
                Yes, I am running the AMD p-state driver.

                Comment


                • #9
                  Originally posted by skeevy420 View Post

                  3 states is an ACPI Ryzen thing. AFAIK, all Ryzens are like this (at least Zen 2 and up on AM4):

                  With acpi_cpufreq you'll get 3 states. Lowest, Middle, Highest. That's it. amd-pstate, however, while still having the three state limitation, is able to change the frequency of those available states.

                  This is literally from my Zen 2 PC right now:

                  Code:
                  sudo cpupower frequency-info
                  
                  analyzing CPU 3:
                  driver: amd-pstate-epp
                  CPUs which run at the same hardware frequency: 3
                  CPUs which need to have their frequency coordinated by software: 3
                  maximum transition latency: Cannot determine or is not supported.
                  hardware limits: 400 MHz - 4.31 GHz
                  available cpufreq governors: performance powersave
                  current policy: frequency should be within 400 MHz and 4.31 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
                  current CPU frequency: Unable to call hardware
                  current CPU frequency: 3.07 GHz (asserted by call to kernel)
                  boost state support:
                  Supported: yes
                  Active: yes
                  Boost States: 0
                  Total States: 3
                  Pstate-P0: 3700MHz
                  Pstate-P1: 1700MHz
                  Pstate-P2: 1400MHz
                  It supports anything between 400MHz and 4.31GHz. Using acpi_cpufreq P2 would be forced to 400MHz and P0 would be forced to 4.31GHz. I honestly don't remember what my CPU's Middle frequency is to tell you what P1 would be. amd-pstate can dynamically change those three available Pstate frequencies to give the scheduler more room to work with. If you're not running a maxed out workload you can be better served somewhere between Middle and High frequency.
                  So I was still correct. 3 p-states, you just exposed a freq variation available in each.

                  There is a table of all the states available in the p-state driver if the Zen level supports it. (sorry, I don't have the link right in front of me)

                  Comment

                  Working...
                  X