[Solved] How to see the CPU temperature in Debian 11?

Need help with peripherals or devices?
Post Reply
Message
Author
User avatar
Diesel330
Posts: 190
Joined: 2021-11-08 19:57
Location: Eastern Europe
Has thanked: 39 times
Been thanked: 24 times

[Solved] How to see the CPU temperature in Debian 11?

#1 Post by Diesel330 »

If I have to use the terminal, giving me the instructions will be appreciated
Last edited by Diesel330 on 2024-08-02 17:10, edited 1 time in total.

CwF
Global Moderator
Global Moderator
Posts: 3001
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 60 times
Been thanked: 243 times

Re: How to see the CPU temperature in Debian 11?

#2 Post by CwF »

Code: Select all

$  cat /sys/class/hwmon/hwmon*/name
i350bb
radeon
coretemp
coretemp
nct7904
$ ls /sys/class/hwmon/
hwmon0  hwmon1  hwmon2  hwmon3  hwmon4
$ ls /sys/class/hwmon/hwmon4/
device      fan5_input  in11_input  in16_input  in4_input  in9_input    pwm2         pwm4_enable  uevent
fan1_input  fan6_input  in12_input  in1_input   in5_input  name         pwm2_enable  subsystem
fan2_input  fan7_input  in13_input  in20_input  in6_input  power        pwm3         temp1_input
fan3_input  fan8_input  in14_input  in2_input   in7_input  pwm1         pwm3_enable  temp2_input
fan4_input  in10_input  in15_input  in3_input   in8_input  pwm1_enable  pwm4         temp3_input
$  cat /sys/class/hwmon/hwmon4/temp3_input
49500
$  cat /sys/class/hwmon/hwmon4/temp3_input | awk '{print $1/1000}'
49.25
$ notify-send "socket 1 temp $(cat /sys/class/hwmon/hwmon4/temp3_input | awk '{print $1/1000}')°"
Figuring out what's what can be a challenge, but possible if you follow what I did there....Generally speaking CoreTemp is redundant bunk and not really actionable. You should figure out if there is a motherboard mounted sensor in/under the physical socket. There usually is, and this is the actual hot spot and the limiting factor.
Mottainai

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1504
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 102 times
Been thanked: 247 times

Re: How to see the CPU temperature in Debian 11?

#3 Post by steve_v »

CwF wrote: 2024-08-01 16:28 Generally speaking CoreTemp is redundant bunk and not really actionable. You should figure out if there is a motherboard mounted sensor in/under the physical socket. There usually is, and this is the actual hot spot and the limiting factor.
Hogwash.
The values reported by the coretemp module (at least as far as Intel CPUs) are die-sense temperatures (i.e. the actual CPU hotspot) and the same values used by the microcode for clock modulation / thermal boost tables / throttling etc. Motherboard "CPU" temperature sensors (near or under the socket, at some indeterminate distance from what matters) haven't been relevant for years, they're notoriously inaccurate, and since the limiting factor for any silicon is Tjunction not Tcase anyway, they're mostly meaningless.

If by "not actionable" you mean "higher than I like to see, so I look at the other one"... Well, you do you I guess.

As for getting values, why poke about in /sys/class/hwmon by hand when lm-sensors (and the sensors-detect script therein) exists?
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

CwF
Global Moderator
Global Moderator
Posts: 3001
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 60 times
Been thanked: 243 times

Re: How to see the CPU temperature in Debian 11?

#4 Post by CwF »

steve_v wrote: 2024-08-01 19:10 If by "not actionable" you mean "higher than I like to see, so I look at the other one"... Well, you do you I guess.
The opposite.
Core temps run 10-20C cooler on the last boards I've used while not idling. The over heat alarm goes off according to this temp while all cores are within range. The reported bios temps include this, not the cores.

Low core count cpu's are closer in range, higher core count lead to larger differences verses socket temp, the cores always much much cooler if noting the minimum core temp on the package.

Code: Select all

$  cat /sys/class/hwmon/hwmon3/temp8_input
49000
$  cat /sys/class/hwmon/hwmon4/temp3_input
53125
If we were to graph vs time we'd see core temp lead for a short time and then as the setup heat soaks a bit the socket temp leaves core temp behind, and becomes the overall most accurate feedback, the most actionable factor.
The socket temp more accurately tracks input power to the die regardless of core. The cpu is physically closer to the heat extraction point than the socket. At least that's what the thermal pics show...
Mottainai

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1504
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 102 times
Been thanked: 247 times

Re: How to see the CPU temperature in Debian 11?

#5 Post by steve_v »

If socket temperature is higher than the hottest core, then your BIOS is broken, the sensor it's using is even more inaccurate than usual (or should have an offset that board manufacturer didn't contribute to lm-sensors, or is actually core temp but they didn't tell you), or you're seeing thermal inertia - i.e. whatever is reading core temperature isn't updating fast enough or is looking at some irrelevant value (like coolest core or average of all cores).
This is just simple physics, "core temp" sensors are in the CPU. Not near it, not under it, in it.
On-die temperature readings are averages themselves of course (a modern CPU has many, many temperature sensors), but they're always going to be closer to the action than the motherboard.

If you really are more interested in the temperature under the CPU, then by all means... But if your cooler can cool the CPU die faster than the board around it, who cares? It's CPU temperature that matters for performance.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

CwF
Global Moderator
Global Moderator
Posts: 3001
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 60 times
Been thanked: 243 times

Re: How to see the CPU temperature in Debian 11?

#6 Post by CwF »

steve_v wrote: 2024-08-01 19:45 It's CPU temperature that matters for performance.
...and it's the many other areas that determine system failure.

Nothing broken here. Maybe look it up, get some more opinions, or do some testing yourself. I have.
Mottainai

Dai_trying
Posts: 1139
Joined: 2016-01-07 12:25
Has thanked: 9 times
Been thanked: 26 times

Re: How to see the CPU temperature in Debian 11?

#7 Post by Dai_trying »

@Diesel330 You could simply type sensors in the terminal to hopefully see system temps and sometimes more, if you get a command not found error you might need to install lm-sensors.

My laptop shows this info :-

Code: Select all

dai@r93060:~$ sensors
iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +34.0°C  

asus-isa-0000
Adapter: ISA adapter
cpu_fan:     2600 RPM
gpu_fan:        0 RPM

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +41.0°C  

nvme-pci-0400
Adapter: PCI adapter
Composite:    +33.9°C  (low  = -273.1°C, high = +82.8°C)
                       (crit = +84.8°C)
Sensor 1:     +32.9°C  (low  = -273.1°C, high = +65261.8°C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +41.0°C  

ucsi_source_psy_USBC000:001-isa-0000
Adapter: ISA adapter
in0:           0.00 V  (min =  +0.00 V, max =  +0.00 V)
curr1:         0.00 A  (max =  +0.00 A)

amdgpu-pci-0500
Adapter: PCI adapter
vddgfx:        1.46 V  
vddnb:       943.00 mV 
edge:         +38.0°C  
PPT:           8.00 W  

BAT0-acpi-0
Adapter: ACPI interface
in0:          15.57 V  
My CPU is shown here as K10temp although it does not give individual core temps which you may or not want.

CwF
Global Moderator
Global Moderator
Posts: 3001
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 60 times
Been thanked: 243 times

Re: How to see the CPU temperature in Debian 11?

#8 Post by CwF »

Dai_trying wrote: 2024-08-01 22:12 you might need to install lm-sensors.
Good point. In addition to lm-sensors, a 'sensors-detect' run may be needed to determine if any extra modules need to be loaded. My above example jumped right past that point and there would be nothing in those directories without it.
Mottainai

Dai_trying
Posts: 1139
Joined: 2016-01-07 12:25
Has thanked: 9 times
Been thanked: 26 times

Re: How to see the CPU temperature in Debian 11?

#9 Post by Dai_trying »

CwF wrote: 2024-08-01 22:36Good point. In addition to lm-sensors, a 'sensors-detect' run may be needed to determine if any extra modules need to be loaded. My above example jumped right past that point and there would be nothing in those directories without it.
I have run sensors-detect before although I mostly found it gave no additional info which is likely why I forgot to mention it, I've probably just been lucky with my hardware really. :)

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1504
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 102 times
Been thanked: 247 times

Re: How to see the CPU temperature in Debian 11?

#10 Post by steve_v »

CwF wrote: 2024-08-01 20:05 do some testing yourself. I have.
As have I, and with a real instrument (a vintage but well calibrated ERO Memocal 81 to be exact) rather than just comparing onboard sensors. No Motherboard "CPU" sensor I have seen (going back at least as far as Pentium IV systems, which got hot enough to melt the motherboard into your desk) tracked Tcase even remotely well WRT a thermocouple at the CPU heatspreader. Hell, most of them weren't accurate readings of the board temp at the centre of the socket either.

Modern (ish) CPU "package temperature" thermal diodes are slightly better, but still nowhere near as accurate as the core DTS. Add to that the abundant variations on what a particular motherboard (or BIOS revision) reads as "CPU", there's a reason hardcore overclockers use dedicated thermocouples.

As for "looking up more opinions", here ya go.
Of note:
”CPU” temperature is typically inaccurate and can vary greatly with BIOS updates.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

User avatar
Diesel330
Posts: 190
Joined: 2021-11-08 19:57
Location: Eastern Europe
Has thanked: 39 times
Been thanked: 24 times

Re: How to see the CPU temperature in Debian 11?

#11 Post by Diesel330 »

This is what the command ''sensors'' gives me:

Code: Select all

sensors
ath10k_hwmon-pci-0100
Adapter: PCI adapter
temp1:            N/A  

BAT0-acpi-0
Adapter: ACPI interface
in0:           8.42 V  

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +40.0°C  
Tdie:         +40.0°C  

amdgpu-pci-0200
Adapter: PCI adapter
vddgfx:           N/A  
vddnb:            N/A  
edge:         +40.0°C  
Are those temperatures normal?

Dai_trying
Posts: 1139
Joined: 2016-01-07 12:25
Has thanked: 9 times
Been thanked: 26 times

Re: How to see the CPU temperature in Debian 11?

#12 Post by Dai_trying »

Diesel330 wrote: 2024-08-02 08:27 Are those temperatures normal?
I would say yes for an idling system, your cpu temp shows to be very close to my displayed one which was also pretty much idle, obviously this would rise as your system (or CPU specifically) is in higher use.

User avatar
Diesel330
Posts: 190
Joined: 2021-11-08 19:57
Location: Eastern Europe
Has thanked: 39 times
Been thanked: 24 times

Re: How to see the CPU temperature in Debian 11?

#13 Post by Diesel330 »

Dai_trying wrote: 2024-08-02 08:39
Diesel330 wrote: 2024-08-02 08:27 Are those temperatures normal?
I would say yes for an idling system, your cpu temp shows to be very close to my displayed one which was also pretty much idle, obviously this would rise as your system (or CPU specifically) is in higher use.
Thank you, can you tell me which of all the fields is the CPU measurement?

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1504
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 102 times
Been thanked: 247 times

Re: How to see the CPU temperature in Debian 11?

#14 Post by steve_v »

Diesel330 wrote: 2024-08-02 10:37 which of all the fields is the CPU measurement?
k10temp / Tdie is the temperature reported by the CPU internal sensor.
It appears you either don't have or don't have a driver loaded for any motherboard hardware monitoring chip, sensors-detect may suggest additional modules to load.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

User avatar
Diesel330
Posts: 190
Joined: 2021-11-08 19:57
Location: Eastern Europe
Has thanked: 39 times
Been thanked: 24 times

Re: How to see the CPU temperature in Debian 11?

#15 Post by Diesel330 »

steve_v wrote: 2024-08-02 11:25
Diesel330 wrote: 2024-08-02 10:37 which of all the fields is the CPU measurement?
k10temp / Tdie is the temperature reported by the CPU internal sensor.
It appears you either don't have or don't have a driver loaded for any motherboard hardware monitoring chip, sensors-detect may suggest additional modules to load.
I have k10temp Tdie measurement, it is +40.0°C, it is in my previous post

What it is the ''Tctl'' measurement?

CwF
Global Moderator
Global Moderator
Posts: 3001
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 60 times
Been thanked: 243 times

Re: How to see the CPU temperature in Debian 11?

#16 Post by CwF »

Diesel330 wrote: 2024-08-02 13:58 What it is the ''Tctl'' measurement?
Perhaps another sensor on die, closer to the power traces and used for throttling.

@steve_v
I've used everything from laser and touch probes to a flir. I've built passive boxes, some potted. On no system ever was the cpu the hottest spot usually being the 4th or 5th hottest component, and the most actively controlled.

Generally with consumer grade and especially laptops the range isn't much between the low wattage and high wattage choices. On a workstation/server class the same design may be used for a 45W up to a 130+. At the low end the thermals are closer to what you say. At 3x the draw, the heat contribution from simply passing power through a junction has a much larger effect. Translation - not all the heat is coming from the cpu, some is coming from the power junction and that's why they put a sensor there.

Coretemp is one of the modules not loaded by default as I remember if you don't accept the extra modules suggested by sensors-detect. 'coretemp' reports a temp for each core, the bunk part, and also the package temp, the redundant part. On many simple boards that package temp is sensed by the bios, used for overheat action. On boards with higher draw cpu possibilities there may be a second sensor on the board. Either is more useful than core temp. When two are present they should track nearly identically with the cpu package registering within 1C hotter than the motherboard mounted sensor when everything is well. On a well done box the core temps should always be lower, unless using marginal coolers, or on otherwise narrow range designs like a laptop.

Performance throttling is not the same question as system shutdown or failure. So if you set up thermald for zoned case fans, core temp won't serve as well as socket/package readings. Modern cpus do fine moving loads from core to core and throttling without our help or monitoring. The single temp is all we really need, and attainable without coretemp.
Mottainai

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1504
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 102 times
Been thanked: 247 times

Re: How to see the CPU temperature in Debian 11?

#17 Post by steve_v »

Diesel330 wrote: 2024-08-02 13:58 What it is the ''Tctl'' measurement?
Derived value for cooling system / clock modulation control, usually a delta between Tdie and Tjunction or Tcase max. How exactly it is calculated depends on the CPU model in question.
IOW, from the driver docs I linked above:
Tctl is the processor temperature control value, used by the platform to
control cooling systems. Tctl is a non-physical temperature on an
arbitrary scale measured in degrees. It does _not_ represent an actual
physical temperature like die or case temperature. Instead, it specifies
the processor temperature relative to the point at which the system must
supply the maximum cooling for the processor's specified maximum case
temperature and maximum thermal power dissipation.
If you want to know exactly what it means, you'll need to dig up technical documentation for your specific CPU family.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Post Reply