Monitor CPU Temperature

Test and fix the Kernel 4.14 features
Post Reply
alexlab
Posts: 4
Joined: Mon May 08, 2017 8:34 pm
languages_spoken: english
ODROIDs: ODROID-XU4
Has thanked: 0
Been thanked: 0
Contact:

Monitor CPU Temperature

Unread post by alexlab » Mon May 08, 2017 8:50 pm

Hi all!

I would like to know what exactly should I use (command/path) to monitor CPU temp?

As of now, I use command like this:
awk '{printf "%3.1f°C\n", $1/1000}' /sys/class/thermal/thermal_zone0/temp
But I know that there are such options as:
/sys/class/thermal/thermal_zone0/temp
/sys/class/thermal/thermal_zone1/temp
/sys/class/thermal/thermal_zone2/temp
/sys/class/thermal/thermal_zone3/temp
/sys/class/thermal/thermal_zone4/temp
and all of them have different values. For example, one time I saw that tz0 was equal to 63C degree while tz2 was 68C.

What are those thermal_zones?

Or I have to use something else to get the current CPU temp?

P.S: guys, you've done a good job to make 4.9 available, thanks!

User avatar
odroid
Site Admin
Posts: 31312
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 44 times
Been thanked: 180 times
Contact:

Re: Monitor CPU Temperature

Unread post by odroid » Mon May 08, 2017 10:24 pm

There are four A15 big-core blocks and one GPU block.
We can see 5 different temperature values for each blocks because there are five sensors.
Note that the temperature sensor has +/- 3°C tolerance error.

tedrogers
Posts: 63
Joined: Fri Nov 23, 2018 6:18 pm
languages_spoken: English
ODROIDs: Odroid XU4Q
Location: The Divided Kingdom of Great Britain
Has thanked: 0
Been thanked: 0
Contact:

Re: Monitor CPU Temperature

Unread post by tedrogers » Mon Dec 10, 2018 7:22 am

odroid wrote:There are four A15 big-core blocks and one GPU block.
We can see 5 different temperature values for each blocks because there are five sensors.
Note that the temperature sensor has +/- 3°C tolerance error.
This is very interesting. I have just jimmied up a USB fan to plonk on top of my passive heatsink for XU4, I bought the fan on eBay for £0.86p delivered but it had the wrong Molex on it, so I just butchered a USB cable to get it spinning. Works great!

Anyway, I'm looking to monitor the temp difference now, so how to we know what the difference is between each of the thermal_zone(s)?

I'm guessing as follows:

Code: Select all

/sys/class/thermal/thermal_zone0/temp <<< CPU 0/1
/sys/class/thermal/thermal_zone1/temp <<< CPU 2/3
/sys/class/thermal/thermal_zone2/temp <<< CPU 4/5
/sys/class/thermal/thermal_zone3/temp <<< CPU 6/7
/sys/class/thermal/thermal_zone4/temp <<< GPU
Is that correct?

Just rolling with the basis that it is correct, you can run this script I wrote / adapted from the code above to see realtime temperature updates.

Code: Select all

#!/bin/bash
bool=true
counter=0
while [ $bool = true ]
do
    echo "Displaying CPU/GPU temperatures...(Press 'ctrl+c' to exit)"; echo
    echo "Running time:" $counter "seconds"; echo
    echo "CPU 0/1:"; awk '{printf "%3.1f°C\n", $1/1000}' /sys/class/thermal/thermal_zone0/temp; echo
    echo "CPU 2/3:"; awk '{printf "%3.1f°C\n", $1/1000}' /sys/class/thermal/thermal_zone1/temp; echo
    echo "CPU 4/5:"; awk '{printf "%3.1f°C\n", $1/1000}' /sys/class/thermal/thermal_zone2/temp; echo
    echo "CPU 6/7:"; awk '{printf "%3.1f°C\n", $1/1000}' /sys/class/thermal/thermal_zone3/temp; echo
    echo "GPU:"; awk '{printf "%3.1f°C\n", $1/1000}' /sys/class/thermal/thermal_zone4/temp; echo
    sleep 1s; ((counter++)); echo
    clear
done
P.S. The fan works! Brings temperatures down and isn't noisy at all.

Thanks.

Thanks.

User avatar
odroid
Site Admin
Posts: 31312
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 44 times
Been thanked: 180 times
Contact:

Re: Monitor CPU Temperature

Unread post by odroid » Mon Dec 10, 2018 9:46 am

CPU 0~3 are little-cores and CPU 4~7 are big-cores.
Little cores have no temperature sensor.

It is worth to browse our wiki pages probably.
https://wiki.odroid.com/odroid-xu4/appl ... ol_the_fan

tedrogers
Posts: 63
Joined: Fri Nov 23, 2018 6:18 pm
languages_spoken: English
ODROIDs: Odroid XU4Q
Location: The Divided Kingdom of Great Britain
Has thanked: 0
Been thanked: 0
Contact:

Re: Monitor CPU Temperature

Unread post by tedrogers » Mon Dec 10, 2018 10:49 am

Thanks for adding some clarity.

Post Reply

Return to “Linux Kernel 4.14 Debugging Party”

Who is online

Users browsing this forum: No registered users and 0 guests