I've just finished building a new machine with a i9 9900k CPU, a CPU with 1 socket, 8 cores and 16 threads. I installed Ubuntu Bionic on it, and I am just about to add checks to the CPU temperatures.
However, when I run cat /sys/class/thermal/thermal_zone*/temp
(as recommended by https://askubuntu.com/a/15834/822289) I get 3 results:
27800
40000
28000
Edit 1: The "correct" CPU-temperature is the one shown at thermal_zone2.
I thought maybe a 3rd-party program like acpi might help:
# acpi -t
Thermal 0: ok, 27.8 degrees C
But that one only gives me what's on thermal_zone0
. What do the other ones represent, especially thermal_zone1, and how can I find more information about that?
Edit 2: The answer to what do the other ones represent can be found by running the following command:
cat /sys/class/thermal/thermal_zone*/type
Which gives me, in this case, the following output:
acpitz
pch_cannonlake
x86_pkg_temp
sudo rdmsr --bitfield 22:16 -u 0x1b1
The core temperature for each CPU:sudo rdmsr --bitfield 22:16 -u -a 0x19c
. See also here. – Doug Smythies Jan 19 '19 at 17:40Thermal zone 0 is static and never changes. I am very curious though what's on thermal zone 1.
– Oleg Jan 22 '19 at 10:09cat /sys/class/thermal/thermal_zone2/type
and I think you'll getx86_pkg_temp
, which i think is good enough for what you want. On my computer thermal zone 1 is the fan (I think), and I still don't know what thermal zone 0 is, but the type isacpitz
. If you really want all the core temps dogrep . /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp*_input
, however note that it uses considerable code and will show a higher temp than it should for an idle system, just due to itself. – Doug Smythies Jan 22 '19 at 19:34cat /sys/class/thermal/thermal_zone1/type pch_cannonlake
So
– Oleg Feb 20 '19 at 10:49thermal_zone1
is the Platform Controller Hub. Thank you for your help!