Google Posts Patches Allowing AMD Zen/Zen2 CPUs To Expose Power Usage On Linux Via RAPL
![AMD](/assets/categories/amd.webp)
Google engineer Stephane Eranian posted a patch series to expose the necessary hardware counters for reading the power usage on Linux and tie into the kernel's RAPL framework. The Running Average Power Limit "RAPL" interface was devised by Intel years ago and supported by their hardware for being able to read (and, in some cases, limit) the power consumption. The power usage is exposed via a PowerCap sysfs interface and via a perf interface.
With the patches posted by Google that come in at less than 60 lines of code, it allows finally being able to read the CPU power consumption based upon the data exposed via its counters. With the current patches, the energy package level consumption is exposed. Both Zen 1 and Zen 2 CPUs are supported.
It's great to see these patches finally materialize but long overdue especially with the AMD Windows software (Ryzen Master, et al) long exposing the power metrics. It's been a topic I've long brought up with AMD as an area to improve, similar to the AMD Zen thermal monitoring Linux driver support being another item left up to the community to tackle.
29 Comments