Score:2

How can I install or enable support for temperature sensors on 22.04 LTS for AMD's 5825U laptop chip?

US flag
user495343

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!

guiverc avatar
cn flag
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?
Score:0
cn flag

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.

Adam Howell avatar
cn flag
One nice thing about NodeRED nodes is they are usually JavaScript and commonly hosted on GitHub.
Adam Howell avatar
cn flag
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 avatar
cn flag
Oops, I forgot you were on Linux. That's embarrassing.
Adam Howell avatar
cn flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/141360/discussion-between-adam-howell-and-daniel-m-gessel).
Score:0
US flag
user495343

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)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.