Google Sends Patches For AMD Zen / Zen 2 RAPL PowerCap Support
Building off the work sent out by Google engineers in recent months and merged for Linux 5.8 around RAPL support for AMD Zen / Zen 2 CPUs with supporting the "runtime average power limiting" counters on Linux similar to Intel's longstanding support, that work has continued now with Zen RAPL support in the PowerCap driver.
Google engineer Victor Ding sent out a set of patches this morning for AMD Zen / Zen 2 RAPL support within the PowerCap Linux driver that allows power capping of the CPU(s) if so desired and some new interfaces via sysfs.
The support amounts to less than 50 lines of new code as the RAPL counters exposed by AMD Zen/Zen2 CPUs operate in a similar manner to the Intel RAPL support that has long offered working Linux support. More details on the kernel's power capping framework can be found via the kernel documentation.
With re-using all of the existing Intel code paths, existing Linux power capping tools and other programs tapping the /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj and /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj interfaces will "just work" with the AMD Ryzen / EPYC processors.
It's a pity it took this long for the support to materialize, but at least it's finally coming thanks to the work by Google engineers. The Linux 5.9 merge window is kicking off potentially next week already, so it may be too close for getting it into this next version of the kernel, but we'll see if it squeezes in at the last minute given the rather simplicity of the patches.
Google engineer Victor Ding sent out a set of patches this morning for AMD Zen / Zen 2 RAPL support within the PowerCap Linux driver that allows power capping of the CPU(s) if so desired and some new interfaces via sysfs.
The support amounts to less than 50 lines of new code as the RAPL counters exposed by AMD Zen/Zen2 CPUs operate in a similar manner to the Intel RAPL support that has long offered working Linux support. More details on the kernel's power capping framework can be found via the kernel documentation.
With re-using all of the existing Intel code paths, existing Linux power capping tools and other programs tapping the /sys/class/powercap/intel-rapl/intel-rapl:0/energy_uj and /sys/class/powercap/intel-rapl/intel-rapl:0/intel-rapl:0:0/energy_uj interfaces will "just work" with the AMD Ryzen / EPYC processors.
It's a pity it took this long for the support to materialize, but at least it's finally coming thanks to the work by Google engineers. The Linux 5.9 merge window is kicking off potentially next week already, so it may be too close for getting it into this next version of the kernel, but we'll see if it squeezes in at the last minute given the rather simplicity of the patches.
3 Comments