The New AMD Energy Driver Is Working Out Well On Linux For Per-Socket/Core Reporting
Written by Michael Larabel in AMD on 27 May 2020 at 12:57 PM EDT. 13 Comments
AMD --
Of the many features coming for Linux 5.8 one of the new drivers we are very much looking forward to is the AMD energy driver for finally exposing per-core and per-socket/package energy reporting of Zen/Zen2 CPUs under Linux. It's working out well so far in my evaluation.

CPU energy/power reporting is something that I and many other Linux users have long wanted to see under Linux for Zen CPUs, since it's exposed after all on Windows with Ryzen Master and other software. In the past AMD also maintained the "fam15h_power" driver for power reporting back on Bulldozer CPUs. But until Google sent out RAPL Zen patches recently and this "amd_energy" driver was then sent out by AMD engineers, there wasn't much public activity on getting this capability for existing Zen processors. There has also been the out-of-tree "Zenpower" driver for offering this based on public MSR data for Zen, albeit that driver isn't mainline, not maintained by AMD, and conflicts with k10temp when loading.

Now this amd_energy driver is queued in hwmon-next ahead of the Linux 5.8 merge window, I've been tested out this driver and it has worked out fairly well. For those wanting to give it a whirl but not feeling like spinning your own kernel from source using the patches, here is an Ubuntu x86_64 kernel build as of the latest hwmon-next branch that I built for the amd_energy testing.


This amd_energy driver has been working out well so far for the per-core and per-socket energy reporting, finally! While Intel CPUs expose their energy usage under /sys/class/powercap/intel-rapl, the amd_energy metrics are exposed as a conventional hwmon driver.

A test run with the Threadripper 3970X above... The latest Phoronix Test Suite Git code also has support for reading the amd_energy data now as well for calculating and exposing total CPU power consumption reporting. That addition is in Git for next quarter's Phoronix Test Suite 9.8 release.

So far so good on trying the Linux amd_energy driver with different CPUs. This driver will debut official with Linux 5.8, which should be out as stable in August, but if you are comfortable doing so feel free to try hwmon-next to help ensure this driver is in great shape for finally exposing AMD Zen CPU energy data on the mainline kernel. This new driver plus the recent k10temp thermal reporting improvements (Linux 5.6+) have the recent AMD processors now in good shape on the sensor front under Linux.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Popular News This Week