2

I'd like to monitor CPU core temperatures on a Dell Inspiron 16 5625 (which has an AMD Ryzen 7 5825U) but I'm not finding solutions.

The source for k10temp does have chip ids for recent (Zen 3) AMD processors, so the reason may be the 5825U doesn't expose much information to the OS, as reported when I tried the only the safe checks with sudo sensors-detect:

Sorry, no sensors were detected.
This is relatively common on laptops, where thermal management is
handled by ACPI rather than the OS.

And when I run sensors it reports data from k10temp - I think the best available driver is installed. If there is an alternative an answer here is a (somewhat old) guide to installation.

This is what I had originally found, in case it's useful:

I looked at /sys/class/thermal and there's 16 cooling_device entries (I'm not familiar with these, but the CPU has 8 cores and 16 HW threads). There is only one thermal_zone entry, so this doesn't seem to have per-core details.

I had looked at the hwmon support status page on the kernel wiki and the latest AMD architecture listed as supported is "16h". Cross referencing the AMD product page the Zen 3, which according to Wikipedia's AMD CPU codenames, is "19h", so while the chips are detected, I'm not sure if support is complete.

That lm-sensors wiki home page does have a note:

The content at this time is being copied from the archive of lm-sensors.org. Once that is complete the content will be updated.

Unfortunately, lm-sensors.org seems to be down at the moment.

Finally, below is a sensors report (this output didn't change after I ran sensors-detect) and it doesn't call out "CPU" or "cores".

Thanks for any help or guidance.

> sensors
amdgpu-pci-0400
Adapter: PCI adapter
vddgfx:        1.38 V  
vddnb:       768.00 mV 
edge:         +42.0°C  
slowPPT:       3.00 mW

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

BAT0-acpi-0 Adapter: ACPI interface in0: 17.37 V
curr1: 1000.00 uA

dell_smm-isa-0000 Adapter: ISA adapter Processor Fan: 0 RPM Other: +43.0°C
SODIMM: +39.0°C
Ambient: +33.0°C
Other: +38.0°C
GPU: +16.0°C

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

acpitz-acpi-0 Adapter: ACPI interface temp1: +43.0°C (crit = +115.0°C)

Edit: I originally put 24.04 in the question by accident! I meant something current... 22.04 and, well oops! Aplogies!

  • 1
    The two year development cycle that ends with the release of Ubuntu 24.04 LTS (2024-April release) has started; with the first non-LTS snapshot already released (Ubuntu 22.10) & second six month cycle in progress (ie. lunar or what will be released as 23.04), but there is still more than half of the development cycle to run for Ubuntu 24.04 LTS, so it's not yet known what exactly will exist there when 24.04 LTS is released in 2024-April. Did you perhaps mean an actually released product of Ubuntu? – guiverc Dec 16 '22 at 01:14
  • Yes, you are correct! I edited it to say 22.04, which I hope is a little more reasonable. I'm sorry, I'm losing it Iguess... –  Dec 16 '22 at 01:28

2 Answers2

0

One solution for Linux is to use the psutil library in Python:

import psutil
print( psutil.sensors_temperatures() )
print( psutil.sensors_temperatures()['cpu_thermal'][0][1] )

The first print line will show everything returned from the temperature sensors. The second line outputs only the CPU temperature for my Raspberry Pi 4 running Raspbian (a distro based on Debian), and looks like this:

>>> print( psutil.sensors_temperatures()['cpu_thermal'][0][1] )
71.088

More information can be found here.

Another solution is to use Node-RED, with a CPU plugin, like this one.

From that node, I take the reading and publish it to my MQTT broker. Then I consume the data from a few different MQTT clients, who each run a web server (in Node-RED) that shows the temperatures in a gauge and on a chart.

I cannot say enough good things about Node-RED and MQTT.

  • Thanks - I run Raspberry Pi OS on my RPis, and vcgencmd reads and reports temperature sensors, so I haven’t got an issue there. The CPU plug-in you pointed to seems to report processor activity; is there one that reports temperature? I write my tools in Python or C, but if there’s source for the plug in, I might be able to figure it out - I do think there’s a need for a kernel components and I don’t know if NodeRED plugins typically install drivers. MQTT is really beyond me, but fortunately I can use ssh to take remote readings, if I ever needed to. –  Dec 16 '22 at 04:51
  • 1
    I went back to that page and see, further down, support for core temps. I’ll dig around and see if I can find source. Thanks! –  Dec 16 '22 at 05:08
  • From what I can tell, the code of interest is at https://github.com/sebhildebrandt/systeminformation/blob/master/lib/cpu.js, which seems to parse files in /sys/class/thermal, the output of sensors and even the output of vcgencmd when available - so, yeah, I need drivers for hwmon, if I can find ‘em. –  Dec 16 '22 at 05:29
  • One nice thing about NodeRED nodes is they are usually JavaScript and commonly hosted on GitHub. – Adam Howell Dec 16 '22 at 16:12
  • Yep. Digging around, it is the right module (k10temp) being loaded, but it just seems to be reporting that one temp (and I'm not sure what that temp actually is). I think it's going to be an exercise in reading HW docs and more kernel code if I want to get anywhere. –  Dec 16 '22 at 16:58
  • I was able to get CPU temperatures on my Ryzen 5 3600X after modifying the flow here: https://flows.nodered.org/flow/4c4d8009f93941d21363fa132aad50b3 That one uses OpenHardwareMonitor to get the temperature from WMI (via a Python script). Let me know if you have any questions about modifying it. It shouldn't take much to modify the Python and eliminate NodeRED from the solution. – Adam Howell Dec 16 '22 at 17:47
  • WMI? Windows Management Instrumentation? Does that run on Linux? –  Dec 16 '22 at 18:13
  • 1
    Oops, I forgot you were on Linux. That's embarrassing. – Adam Howell Dec 16 '22 at 18:34
0

Consistent with the output of sensors from k10temp, CoreFreq finds only a single temperature sensor on AMD Ryzen laptop chips (see the reports on the CoreFreq wiki).

Unless there are sensors on the chip which can be accessed using a different method, the inability of the OS to monitor individual core temperatures looks like a limitation of the HW.

(For completeness, this is my post on AMD's community site; the author of CoreFreq provided the information for this answer and the relevant links)