Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Where to find cpu per-core temperatures?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Sat Feb 01, 2025 1:07 pm    Post subject: Where to find cpu per-core temperatures? Reply with quote

Code:
~ # uname -p
AMD Ryzen 9 5950X 16-Core Processor


Looking at the btop display, I see that it shows a per core temperature for this cpu.
I think this means that it is reading the value from either /proc or /sys.

I would like to see the values, so I can play around with scripting stuff.
However, I have looked in vain for the entry that displays cpu core temperature. For example:
Code:
 ~ # tree -f /sys/devices/virtual/thermal/cooling_device0 | grep -i temp
 ~ # tree -f /sys/devices/system/cpu/cpu0 | grep -i therm
 ~ # tree -f /sys/devices/system/cpu/cpu0 | grep -i temp


Google searches suggest coretemp, but:
Code:
ian2 ~ # modinfo coretemp
filename:       /lib/modules/6.13.0-gentoo/kernel/drivers/hwmon/coretemp.ko
license:        GPL
description:    Intel Core temperature monitor
author:         Rudolf Marek <r.marek@assembler.cz>
srcversion:     192255379DA165439094ED5
alias:          cpu:type:x86,ven0000fam*mod*:feature:*01C0*
depends:       
intree:         Y
name:           coretemp
retpoline:      Y
vermagic:       6.13.0-gentoo SMP preempt mod_unload
sig_id:         PKCS#7
signer:         
sig_key:       
sig_hashalgo:   unknown
signature:     
parm:           tjmax:TjMax value in degrees Celsius (int)
ian2 ~ # modprobe coretemp
modprobe: ERROR: could not insert 'coretemp': No such device

..so, Intel only, and btop is seeing the core temperatures without it.

My Google skills (if any) have now hit their limit - does anyone know what path btop is reading to get the core temps?
Thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54856
Location: 56N 3W

PostPosted: Sat Feb 01, 2025 1:50 pm    Post subject: Reply with quote

ipic,

You need
Code:
ryzen_monitor

That depends on the kernel module ryzen_smu which is provided by app-admin/ryzen_smu.

I have the same CPU. It shows
Code:
╭─────────┬────────────┬──────────┬─────────┬──────────┬─────────────┬─────────────┬─────────────╮
│  Core 0 │   Sleeping |  0.051 W | 0.217 V |  29.68 C | C0:   0.1 % | C1:   2.3 % | C6:  97.7 % │
│  Core 1 │   Sleeping |  0.012 W | 0.200 V |  29.83 C | C0:   0.0 % | C1:   0.0 % | C6:  99.9 % │
│  Core 2 │   Sleeping |  0.012 W | 0.200 V |  29.63 C | C0:   0.0 % | C1:   0.0 % | C6: 100.0 % │
│  Core 3 │   Sleeping |  0.012 W | 0.200 V |  29.82 C | C0:   0.0 % | C1:   0.0 % | C6: 100.0 % │
│  Core 4 │   Sleeping |  0.012 W | 0.200 V |  29.60 C | C0:   0.0 % | C1:   0.0 % | C6: 100.0 % │
│  Core 5 │   Sleeping |  0.012 W | 0.200 V |  29.69 C | C0:   0.0 % | C1:   0.0 % | C6: 100.0 % │
│  Core 6 │   Sleeping |  0.012 W | 0.200 V |  29.56 C | C0:   0.0 % | C1:   0.1 % | C6: 100.0 % │
│  Core 7 │   Sleeping |  0.012 W | 0.200 V |  29.73 C | C0:   0.0 % | C1:   0.1 % | C6: 100.0 % │
│  Core 8 │   Sleeping |  0.353 W | 0.258 V |  27.24 C | C0:   2.3 % | C1:   5.9 % | C6:  92.2 % │
│  Core 9 │   Sleeping |  0.117 W | 0.205 V |  26.45 C | C0:   0.4 % | C1:   0.8 % | C6:  99.3 % │
│ Core 10 │   Sleeping |  0.117 W | 0.216 V |  26.61 C | C0:   1.9 % | C1:   0.3 % | C6:  97.9 % │
│ Core 11 │   Sleeping |  0.022 W | 0.201 V |  26.35 C | C0:   0.0 % | C1:   0.2 % | C6:  99.9 % │
│ Core 12 │   Sleeping |  0.006 W | 0.200 V |  26.41 C | C0:   0.0 % | C1:   0.0 % | C6: 100.0 % │
│ Core 13 │   Sleeping |  0.155 W | 0.209 V |  26.33 C | C0:   0.3 % | C1:   1.0 % | C6:  98.8 % │
│ Core 14 │   Sleeping |  0.012 W | 0.201 V |  26.37 C | C0:   0.0 % | C1:   0.2 % | C6:  99.8 % │
│ Core 15 │   Sleeping |  0.006 W | 0.200 V |  26.34 C | C0:   0.0 % | C1:   0.0 % | C6: 100.0 % │
╰─────────┴────────────┴──────────┴─────────┴──────────┴─────────────┴─────────────┴─────────────╯

and lots of other stuff too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Sat Feb 01, 2025 4:20 pm    Post subject: Reply with quote

Many thanks Neddy.
I now have sensory overload :-)

I'm still wondering where btop got its core temp data from though.
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1893
Location: Germany

PostPosted: Sat Feb 01, 2025 8:33 pm    Post subject: Reply with quote

ipic wrote:
Many thanks Neddy.
I now have sensory overload :-)

I'm still wondering where btop got its core temp data from though.

Maybe somewhere here in the source code.
Looks like multuple locations are searched for information about sensors
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Thu Feb 13, 2025 9:24 pm    Post subject: Reply with quote

Just looking at the output from ryzen_monitor, and I see that all 16 cores of my 5950X are 'Sleeping'

Odd - given that ryzen_monitor must have been running on at least one of them to produce the output :-)
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1514
Location: Earth

PostPosted: Thu Feb 13, 2025 11:55 pm    Post subject: Reply with quote

i assume btop getting it via sensors
Code:
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +33.0°C  (high = +80.0°C, crit = +100.0°C)
Core 0:        +32.0°C  (high = +80.0°C, crit = +100.0°C)
Core 1:        +30.0°C  (high = +80.0°C, crit = +100.0°C)
Core 2:        +26.0°C  (high = +80.0°C, crit = +100.0°C)
Core 3:        +28.0°C  (high = +80.0°C, crit = +100.0°C)

8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Fri Feb 14, 2025 8:17 am    Post subject: Reply with quote

That sensors output is not present on my motherboard:
Code:

~ # sensors
nct6798-isa-0290
Adapter: ISA adapter
in0:                      248.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                      992.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                        3.39 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                        3.33 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                        1.01 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                        1.05 V  (min =  +0.00 V, max =  +0.00 V)
in6:                      208.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                        3.39 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                        3.26 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                        1.81 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                     816.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                       2.05 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                       1.03 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                     264.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                     200.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                      600 RPM  (min =    0 RPM)
fan2:                      496 RPM  (min =    0 RPM)
fan3:                      799 RPM  (min =    0 RPM)
fan4:                      527 RPM  (min =    0 RPM)
fan5:                        0 RPM  (min =    0 RPM)
fan6:                     4205 RPM  (min =    0 RPM)
fan7:                      793 RPM  (min =    0 RPM)
SYSTIN:                    +23.0°C  (high = +80.0°C, hyst = +75.0°C)
                                    (crit = +125.0°C)  sensor = thermistor
CPUTIN:                    +24.5°C  (high = +80.0°C, hyst = +75.0°C)
                                    (crit = +125.0°C)  sensor = thermistor
AUXTIN0:                   +95.0°C  (high = +80.0°C, hyst = +75.0°C)  ALARM
                                    (crit = +125.0°C)  sensor = thermistor
AUXTIN1:                   +36.0°C  (high = +80.0°C, hyst = +75.0°C)
                                    (crit = +125.0°C)  sensor = thermistor
AUXTIN2:                   -62.0°C  (high = +80.0°C, hyst = +75.0°C)
                                    (crit = +100.0°C)  sensor = thermistor
AUXTIN3:                   +84.0°C  (high = +80.0°C, hyst = +75.0°C)  ALARM
                                    (crit = +100.0°C)  sensor = thermistor
AUXTIN4:                   +23.0°C  (high = +80.0°C, hyst = +75.0°C)
                                    (crit = +100.0°C)
PECI Agent 0 Calibration:  +24.0°C  (high = +80.0°C, hyst = +75.0°C)
PCH_CHIP_CPU_MAX_TEMP:      +0.0°C 
PCH_CHIP_TEMP:              +0.0°C 
PCH_CPU_TEMP:               +0.0°C 
PCH_MCH_TEMP:               +0.0°C 
TSI0_TEMP:                 +31.5°C 
pwm1:                          22%  (mode = pwm)
pwm2:                          26%  (mode = pwm)
pwm3:                          36%  (mode = pwm)
pwm4:                          44%  (mode = pwm)
pwm5:                          76%  (mode = pwm)  MANUAL CONTROL
pwm6:                         128%  (mode = pwm)
intrusion0:               ALARM
intrusion1:               ALARM
beep_enable:              disabled

drivetemp-scsi-4-0
Adapter: SCSI adapter
temp1:        +20.0°C  (low  =  +0.0°C, high = +100.0°C)
                       (crit low =  +0.0°C, crit = +100.0°C)
                       (lowest = +19.0°C, highest = +27.0°C)

drivetemp-scsi-2-0
Adapter: SCSI adapter
temp1:        +22.0°C  (low  =  +0.0°C, high = +100.0°C)
                       (crit low =  +0.0°C, crit = +100.0°C)
                       (lowest = +19.0°C, highest = +27.0°C)

amdgpu-pci-0800
Adapter: PCI adapter
vddgfx:        1.04 V 
fan1:         945 RPM  (min =    0 RPM, max = 3200 RPM)
edge:         +21.0°C  (crit = +94.0°C, hyst = -273.1°C)
PPT:          42.01 W  (cap = 175.00 W)
pwm1:             26%  MANUAL CONTROL
sclk:         779 MHz
mclk:         300 MHz

drivetemp-scsi-5-0
Adapter: SCSI adapter
temp1:        +19.0°C  (low  =  +0.0°C, high = +100.0°C)
                       (crit low =  +0.0°C, crit = +100.0°C)
                       (lowest = +18.0°C, highest = +28.0°C)

drivetemp-scsi-3-0
Adapter: SCSI adapter
temp1:        +36.0°C 

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +31.8°C 
Tccd1:        +30.0°C 
Tccd2:        +26.5°C 

~ #

Back to top
View user's profile Send private message
user
Apprentice
Apprentice


Joined: 08 Feb 2004
Posts: 220

PostPosted: Fri Feb 14, 2025 12:57 pm    Post subject: Reply with quote

coretemp is for Intel based CPUs. https://docs.kernel.org/hwmon/coretemp.html
k10temp is for AMD based CPUs. https://docs.kernel.org/hwmon/k10temp.html

k10temp display Tctl/Tdie/CCD temperatures but not per-core temperature.
As NeddySeagoon pointed out try app-admin/ryzen_monitor (need to load custom kernel module) to display per-core temperature.
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Fri Feb 14, 2025 2:44 pm    Post subject: Reply with quote

user wrote:
coretemp is for Intel based CPUs. https://docs.kernel.org/hwmon/coretemp.html
k10temp is for AMD based CPUs. https://docs.kernel.org/hwmon/k10temp.html

k10temp display Tctl/Tdie/CCD temperatures but not per-core temperature.
As NeddySeagoon pointed out try app-admin/ryzen_monitor (need to load custom kernel module) to display per-core temperature.


Yeah. I got that. At the start of the thread.

However, btop displays per core temperatures on my platform.
The thread is about where these values come from. I'm looking at the source code but it's slow going.
Back to top
View user's profile Send private message
CooSee
Veteran
Veteran


Joined: 20 Nov 2004
Posts: 1514
Location: Earth

PostPosted: Fri Feb 14, 2025 4:19 pm    Post subject: Reply with quote

start btop >> press M for Menu >> then Options >> Nr. 2 for CPU >> Cpu Sensor << defaults to Auto

via arrow keys you'll see which Sensor Modules are available on your System << choose to try out which is showing the Temps.

8)
_________________
" Die Realität ist eine Illusion, die durch Mangel an ehrlicher Kommunikation entsteht "
---
" Der Mensch ist von Natur aus neugierig, was am Ende übrig bleibt ist die Gier "
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Fri Feb 14, 2025 5:02 pm    Post subject: Reply with quote

CooSee wrote:
start btop >> press M for Menu >> then Options >> Nr. 2 for CPU >> Cpu Sensor << defaults to Auto

via arrow keys you'll see which Sensor Modules are available on your System << choose to try out which is showing the Temps.

8)


Thanks for the tips.
Scrolling through the available sensors shows me the same as what sensors shows me.
Interestingly, if I change the sensor to something stupid (like an unconnected value), the core displays keep showing the core cpu temps (not the stupid value)

I think I have almost reached the point where I can say that btop is faking the core temps - as in using a K10 value and just repeating it.
My hypothesis is that it 'looks' like its reporting core temps because the value changes as its samples for each of the 32 threads.

Still hunting through the btop code to confirm this.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2722

PostPosted: Fri Feb 14, 2025 7:21 pm    Post subject: Reply with quote

Do you happen to have zenpower3 built?

I used to use it but once I forgot to emerge it for the new kernel and Freon, a Gnome extension was able to still show tdie and tctl.

But it was capable of displaying everything per core. There was a small program - zenmonitor3 which read it all and displayed it.

Unfortunately it doesn't produce a module fo kernels >6.1. Only some zenstats.ko which I don't know what's good for.

p.s. I now use k10temp but btop doesn't show per core temperature. Only load. My CPU is R7 5800H.

Best Regards,
Georgi
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Fri Feb 14, 2025 7:35 pm    Post subject: Reply with quote

These are the only references to zenpower or zenmonitor that I can find on the system:
Code:

~ # ls /var/cache/edb/dep/var/db/repos/guru/sys-kernel/zenpower3-0.2.0
/var/cache/edb/dep/var/db/repos/guru/sys-kernel/zenpower3-0.2.0
~ # ls /var/cache/edb/dep/var/db/repos/guru/app-admin/zenmonitor3-2.0.0
/var/cache/edb/dep/var/db/repos/guru/app-admin/zenmonitor3-2.0.0
~ #


Once apon a time I used the guru overlay to pull a ebuild in, but it is not currently active.
I think the above is a result of running `eselect repository list` at some point.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2722

PostPosted: Fri Feb 14, 2025 7:44 pm    Post subject: Reply with quote

I went and dug old sources of zenmonitor. It didn't show per core temperatures. I don't think Ryzen's have separate sensors at all. Or if they have them, if they are individually accessible. I think the sensor is composite.

I also remember when they were developing zenpower3, the goal was to have tdie and tctl, not per CPU temperatures. It only shows per CPU frequencies and power consumption.

Could you tell me how you make btop to show you the temperatures?

Best Regards,
Georgi
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2722

PostPosted: Fri Feb 14, 2025 7:55 pm    Post subject: Reply with quote

OK, ryzen_monitor shows Core Statistics (Calculated) where it shows temperatures for every core. However pay attention to the red text.

Best Regards,
Georgi
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Fri Feb 14, 2025 8:03 pm    Post subject: Reply with quote

logrusx wrote:
I went and dug old sources of zenmonitor. It didn't show per core temperatures. I don't think Ryzen's have separate sensors at all. Or if they have them, if they are individually accessible. I think the sensor is composite.

I also remember when they were developing zenpower3, the goal was to have tdie and tctl, not per CPU temperatures. It only shows per CPU frequencies and power consumption.

Could you tell me how you make btop to show you the temperatures?

Best Regards,
Georgi


I just type
Code:
btop
and it shows per core temperatures. I made no changes since emerging it, and it's ebuild has no use flags.
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2722

PostPosted: Fri Feb 14, 2025 8:05 pm    Post subject: Reply with quote

ipic wrote:


I just type
Code:
btop
and it shows per core temperatures. I made no changes since emerging it, and it's ebuild has no use flags.


Maybe our CPU's are not that similar as I think.

p.s. I recalled something: https://forums.gentoo.org/viewtopic-p-8834990.html#8834990

Best Regards,
Georgi
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54856
Location: 56N 3W

PostPosted: Fri Feb 14, 2025 8:49 pm    Post subject: Reply with quote

ipic,

I've just tried btop on my 5950X. Its 16 cores with 2 threads/core

btop shows me temperatures for 32 cores. I don't believe it.
How can it tell which thread is which for temperature sensing?
There are certainly no sensors like that.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ipic
Guru
Guru


Joined: 29 Dec 2003
Posts: 441
Location: UK

PostPosted: Fri Feb 14, 2025 10:00 pm    Post subject: Reply with quote

NeddySeagoon wrote:
ipic,

I've just tried btop on my 5950X. Its 16 cores with 2 threads/core

btop shows me temperatures for 32 cores. I don't believe it.
How can it tell which thread is which for temperature sensing?
There are certainly no sensors like that.


I agree. I think it is just taking whatever it has decided is the CPU temperature, and reading that for each "core" (actually thread - as you point out).

ryzen_monitor on the other hand gives load of useful info, like the power per core and total power output, etc
I'm writing myself a program that will present that in a few different ways - just for my enjoyment :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum