Linux 5.6 Will Support Per-Die Temperature Readings On AMD Zen2 Processors
The latest generation AMD processors have per-die temperature sensors. A series of patches by Guenter Roeck with support for Core Complex Die (CCD) temperatures on Ryzen 3000 (Zen2) CPUs and Vcore and SOC voltage and current sensors on all Ryzen CPUs have been merged to the linux-next tree.
written by Öyvind Sæther. published 2020-01-24 - last edited 2020-01-29
k10temp kernel driver for sensors on AMD processors is currently severely limited.
k10temp kernel driver is not just for AMD family 10h (also called k10) processors (those would be the Phenom, Athlon64 and Opteron chips from 2007), it is the standard temperature sensor module for all modern AMD processors. The
k10temp driver in current kernels can tell you the CPU temperature and that's it.
k10temp module will currently show a
temp1 and a
Tctl value on Ryzen processors but those are in reality the same
temp1 value with an offset (defined in a
tctl_offset tctl_offset_table in
k10temp.c). The reason for this silliness is that AMD thought it would be clever to provide a reported temperature (Tctl) which is higher than the actual die temperature (Tdie) to ensure that BIOS fan control systems would make the fans spin faster on higher-end processors. Both values are, in reality, provided by the same sensor.
Per Die Temperature Readings
Guenter Roeck made some significant improvements to the
k10temp kernel driver which have been merged into the "linux-next" tree. That tree will be merged into Linux 5.6 as a matter of routine.
One patch adds per CPU die temperature readings to AMD Zen2 processors. Those chips are made up of several "chiplets". Future kernels will be able to show temperature readings from each of those chiplets. Another patch adds support for up to eight such sensors on Zen2 based Threadripper CPUs.
Voltages and Currents
Another patch from the same batch by Guenter Roeck brings support for showing voltages and currents on Ryzen CPUs. That patch does not work for Threadripper and EPYC CPUs. It does work for all the Ryzen CPUs, not just the Zen2 based ones. The
k10temp will, with this patch applied, show the following information on a Ryzen 1700X:
k10temp-pci-00c3 Adapter: PCI adapter Vcore: +0.90 V Vsoc: +0.90 V CPU: +28.6°C Tctl: +48.6°C Icore: +5.20 A Isoc: +7.21 A
It is currently possible to get that information using motherboard I/O chips and drivers for them such as
it87. Future kernels will allow you to read that information directly from processor sensors.
Another patch removes the (high = +70.0°C) value from the temperature output. 70 is currently been hard-coded in
k10temp.c for no particular reason.
No Fix For Inaccurate Readings On Older AMD APUs
No patches submitted to "linux-next", the Linux Kernel Mailing List or anywhere else address the totally off temperature readings on older pre-Ryzen AMD processors who are, reportedly, chilling below room temperature under moderate load. We did not ask Guenter Roeck for a fix since he would probably rightfully reply to a request asking him to debug an old and outdated APU with:
k10temp improving patches will not be a part of the upcoming Linux 5.5 kernel expected to be released a few days from now. They could be added to 5.5 and stable branch kernels like 5.4.x and 4.19.x, they can be cleanly applied to 5.4.14. Time will show if they will be applied to older kernels or not. You could apply them to current kernels yourself if you want the per-die temperature information and/or the voltage and current information and you do not want to wait for Linux 5.6.