6

I have an Ubuntu 14.04 system with 8 cores:

$ cat /proc/cpuinfo | grep ^processor | wc -l
8

Yet, I see 11 thermal zones under /sys/classes/thermal:

ls /sys/class/thermal/thermal_zone* | wc -l
11

The thermal zones are named thermal_zone0 to thermal_zone10.

Why this discrepancy and is there a way to obtain a single temperature metric (e.g. temperature of hottest core)? I need a single metric as I want to display it on the i3wm status bar. Displaying 11 temperatures would be cumbersome plus I am not sure how these correspond to the 8 cores.

update

The types of the eleven (11) thermal zones are reported as follows:

$ cat /sys/class/thermal/thermal_zone0/type 
acpitz
$ cat /sys/class/thermal/thermal_zone1/type 
acpitz
$ cat /sys/class/thermal/thermal_zone2/type 
INT3400 Thermal
$ cat /sys/class/thermal/thermal_zone3/type 
TMEM
$ cat /sys/class/thermal/thermal_zone4/type 
TAMB
$ cat /sys/class/thermal/thermal_zone5/type 
TAM2
$ cat /sys/class/thermal/thermal_zone5/type 
TAM2
$ cat /sys/class/thermal/thermal_zone6/type 
TNGF
$ cat /sys/class/thermal/thermal_zone7/type 
TEFN
$ cat /sys/class/thermal/thermal_zone8/type 
TSKN
$ cat /sys/class/thermal/thermal_zone9/type 
T_VR
$ cat /sys/class/thermal/thermal_zone10/type 
x86_pkg_temp

This is confusing rather than elucidating as I now can't tell which thermal zones correspond to the 8 CPU cores.

  • 2
    Some PCI devices may have their own thermal zones (my video card has one). This is not really a solution but (in most cases) if you cat /sys/class/thermal/thermal_zone0/type and it will give you acpiz (or something starting with that) you have a CPU/motherboard sensor. Other sensors use different names. I may be wrong, I'm no hardware naming expert. – grochmal Aug 21 '16 at 20:20
  • @grochmal I have updated the question with the reported types of the thermal zones. – Marcus Junius Brutus Aug 21 '16 at 20:38
  • 1
    I wouldn't expect each core to have a temperature sensor. I think the CPU temperature sensor is x86_pkg_temp (pkg = package = a physically distinguishable chip on the motherboard (or daughter board)). – Gilles Aug 21 '16 at 21:48
5

I can confirm Gilles' comment: the CPU temperature (the hottest core) is given by x86_pkg_temp.

So if

$ cat /sys/class/thermal/thermal_zone10/type 
x86_pkg_temp

then /sys/class/thermal/thermal_zone10/temp is the file that should be used in your i3 status bar.

As a side note, the temperature of each core can be read in temp*_input files in /sys/devices/platform/coretemp.0/hwmon/hwmon*/. The associated temp*_label shows which file is related to which core (4 cores in my case):

.../hwmon*/$  grep "" temp*_label
temp1_label:Physical id 0
temp2_label:Core 0
temp3_label:Core 1
temp4_label:Core 2
temp5_label:Core 3

The file temp1_input corresponds to the hottest value of the cores.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.