Bug 452763 - CPU temperature not working for AMD sensor
Summary: CPU temperature not working for AMD sensor
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 5.27.10
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 452782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-04-19 11:57 UTC by Martin
Modified: 2024-02-14 17:40 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2022-04-19 11:57:33 UTC
CPU temperature is missing despite it being present in sensors' output. According to this bug https://bugs.kde.org/show_bug.cgi?id=438318 sensors for k10temp-pci-00c3 are blacklisted.
Temperature reported by k10temp-pci-00c3 is the only way I can get CPU temperature.
There's a patch attached to the linked bug that fixes this issue, that is, removes blacklisting of k10temp-pci-00c3


sensors output:
it8720-isa-0228
Adapter: ISA adapter
in0:         896.00 mV (min =  +0.00 V, max =  +4.08 V)
in1:           1.52 V  (min =  +0.00 V, max =  +4.08 V)
in2:           3.34 V  (min =  +0.00 V, max =  +4.08 V)
+5V:           2.99 V  (min =  +0.00 V, max =  +4.08 V)
in4:           3.02 V  (min =  +0.00 V, max =  +4.08 V)
in5:         848.00 mV (min =  +0.00 V, max =  +4.08 V)
in6:           3.34 V  (min =  +0.00 V, max =  +4.08 V)
5VSB:          2.98 V  (min =  +0.00 V, max =  +4.08 V)
Vbat:          3.10 V
fan1:         890 RPM  (min =    0 RPM)
fan2:           0 RPM  (min =    0 RPM)
fan3:           0 RPM  (min =    0 RPM)
fan5:           0 RPM  (min =    0 RPM)
temp1:        +33.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
temp2:        +25.0°C  (low  = +127.0°C, high = +70.0°C)  sensor = thermal diode
temp3:        +81.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
cpu0_vid:    +1.250 V
intrusion0:  ALARM

k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +33.6°C  (high = +70.0°C)
                       (crit = +70.0°C, hyst = +68.0°C)

amdgpu-pci-0100
Adapter: PCI adapter
vddgfx:      893.00 mV
fan1:        1022 RPM  (min =    0 RPM, max = 3500 RPM)
edge:         +40.0°C  (crit = +97.0°C, hyst = -273.1°C)
Comment 1 David Redondo 2022-04-28 13:28:41 UTC
AMD CPU temperatures should be available under "CPU"
 https://invent.kde.org/plasma/ksystemstats/-/blob/master/plugins/cpu/linuxcpuplugin.cpp#L138

Are these missing there too?
Comment 2 David Redondo 2022-04-28 13:29:03 UTC
*** Bug 452782 has been marked as a duplicate of this bug. ***
Comment 3 Martin 2022-04-28 14:10:36 UTC
(In reply to David Redondo from comment #1)
> AMD CPU temperatures should be available under "CPU"
>  https://invent.kde.org/plasma/ksystemstats/-/blob/master/plugins/cpu/
> linuxcpuplugin.cpp#L138
> 
> Are these missing there too?

W can see sensors name "Core X Current Temperature" (X from 1 to 4). There's also a group sensor that adds temperatures for all for cores in one go. All of those show 0°C though.
What could be missing? Some kernel config option?
Comment 4 David Redondo 2022-04-29 06:46:19 UTC
I think Arjen has an AMD CPU and encountered the same
Comment 5 Martin 2022-04-29 15:40:53 UTC
Here's /proc/cpuinfo (just for the first core)

        processor       : 0
        vendor_id       : AuthenticAMD
        cpu family      : 16
        model           : 4
        model name      : AMD Phenom(tm) II X4 965 Processor
        stepping        : 3
        microcode       : 0x10000c8
        cpu MHz         : 3400.000
        cache size      : 512 KB
        physical id     : 0
        siblings        : 4
        core id         : 0
        cpu cores       : 4
        apicid          : 0
        initial apicid  : 0
        fpu             : yes
        fpu_exception   : yes
        cpuid level     : 5
        wp              : yes
        flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
        bugs            : tlb_mmatch apic_c1e fxsave_leak sysret_ss_attrs null_seg amd_e400 spectre_v1 spectre_v2
        bogomips        : 6831.28
        TLB size        : 1024 4K pages
        clflush size    : 64
        cache_alignment : 64
        address sizes   : 48 bits physical, 48 bits virtual
        power management: ts ttp tm stc 100mhzsteps hwpstate
Comment 6 Arjen Hiemstra 2022-05-03 10:59:33 UTC
> I think Arjen has an AMD CPU and encountered the same

Actually it turns out I can't remember my own tools and the sensor is working fine.

> What could be missing? Some kernel config option?

I can't remember exactly when we made libsensors a required dependency, I think it was Plasma 5.24. Before that it was optional and might've been something your distro did not ship with.
Comment 7 Martin 2022-05-03 11:30:28 UTC
(In reply to Arjen Hiemstra from comment #6)
> 
> > What could be missing? Some kernel config option?
> 
> I can't remember exactly when we made libsensors a required dependency, I
> think it was Plasma 5.24. Before that it was optional and might've been
> something your distro did not ship with.

libsensor seems to be part of lm_sensors, which I have installed (/usr/lib64/libsensors.so.5)
`sensors` command shows cpu temp just fine (k10temp-pci-00c3)
System monitor started showing that temperature only after I applied the patch that skips blacklisting of k10temp-pci-00c3
Comment 8 Lastique 2022-05-14 12:36:52 UTC
I have the same problem with Intel Core i7 12700K. No CPU temps available in KDE sensors. `sensors` output is:

ucsi_source_psy_0_00081-i2c-0-08
Adapter: NVIDIA GPU I2C adapter
in0:           0.00 V  (min =  +0.00 V, max =  +0.00 V)
curr1:         0.00 A  (max =  +0.00 A)

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

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +30.0°C  (high = +80.0°C, crit = +100.0°C)
Core 0:        +26.0°C  (high = +80.0°C, crit = +100.0°C)
Core 4:        +27.0°C  (high = +80.0°C, crit = +100.0°C)
Core 8:        +25.0°C  (high = +80.0°C, crit = +100.0°C)
Core 12:       +26.0°C  (high = +80.0°C, crit = +100.0°C)
Core 16:       +25.0°C  (high = +80.0°C, crit = +100.0°C)
Core 20:       +26.0°C  (high = +80.0°C, crit = +100.0°C)
Core 24:       +27.0°C  (high = +80.0°C, crit = +100.0°C)
Core 28:       +27.0°C  (high = +80.0°C, crit = +100.0°C)

Please remove coretemp from the blacklist. In fact, please remove the blacklist entirely - users must be able to add whatever sensors they see fit.
Comment 9 Patrick 2022-05-22 04:56:24 UTC
I have the same issue - please bring back the k10temp sensor, I can't read out AMD Ryzen's temperature anymore with KDE 5.24.4. My SSD temperatures are also no longer displayed in the Thermal Monitor widget, but they show up in System Monitor. I guess it's a different bug though?

I've also posted this as a question here:
https://askubuntu.com/questions/1409715/kubuntu-22-04-thermal-monitor-broken-cannot-see-cpu-and-sdd-temperatures
Comment 10 Martin 2022-07-02 12:34:16 UTC
I've just upgraded to plasma 5.25.2 and this problem still persists. I used patch attached to the bug I linked in my original post to fix it.
Comment 11 Riccardo Robecchi 2022-11-24 12:17:05 UTC
Is this still an issue? I do not experience it on any of my systems, all AMD based and of different generations: Ryzen 7 1700X, Ryzen 5 2500U and Ryzen 5 3600. I use Neon on all of those computers. What distro are you using?
Comment 12 Martin 2022-11-24 13:59:43 UTC
(In reply to Riccardo Robecchi from comment #11)
> Is this still an issue? I do not experience it on any of my systems, all AMD
> based and of different generations: Ryzen 7 1700X, Ryzen 5 2500U and Ryzen 5
> 3600. I use Neon on all of those computers. What distro are you using?

I'm on Slackware but I build KDE myself. This is the version I'm using currently and it had this issue. I had to apply the patch attached to this bug https://bugs.kde.org/show_bug.cgi?id=438318 
Looks like my cpu is just blacklisted. There's no other way of making sensors to show cpu temp.
```
Operating System: Slackware 15.0
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.7

Graphics Platform: X11
Processors: 4 × AMD Phenom(tm) II X4 965 Processor
Memory: 7.8 GiB of RAM
Graphics Processor: AMD Radeon RX 550 / 550 Series
```

I'm guessing it's still an issue since the piece of code blacklisting my CPU is still there https://invent.kde.org/plasma/ksystemstats/-/blob/master/plugins/lmsensors/lmsensors.cpp#L27
Comment 13 David Redondo 2022-11-24 14:17:18 UTC
The cpu temp is not shown in lmsensors plugin because it is in the CPU plugin as I said multiple times
Comment 14 David Redondo 2022-11-24 14:18:30 UTC
*in the other bug
Comment 15 Martin 2022-11-24 14:45:16 UTC
(In reply to David Redondo from comment #13)
> The cpu temp is not shown in lmsensors plugin because it is in the CPU
> plugin as I said multiple times

The only way I could display CPU temperature was when applying the patch. I couldn't find CPU temperature in any other sensor.

I mentioned this above:

> W can see sensors name "Core X Current Temperature" (X from 1 to 4). There's also a group sensor that adds temperatures for all for cores in one go. All of those show 0°C though.
Comment 16 Martin 2022-12-02 19:35:23 UTC
I've just built plasma 5.26.4. CPU temperature is still missing, what's available shows 0°C.

I had to apply the patch attached to the linked ticket again. Only now I'm able to see temperature for my CPU.
Comment 17 David Redondo 2023-01-13 11:35:18 UTC
I tried to  test it on my steam deck which has an amd cpu, but apparently k10temp doesn't support its CPU :/
Comment 18 Martin 2023-07-08 17:30:15 UTC
Sadly, this is still an issue for me. All the sensors show cpu temp as 0°C.
Only after applying the change I was talking about before I can see the CPU temp.
Comment 19 Jonathan Richards 2023-07-14 11:03:57 UTC
This has gone on for too long, now.  Ksysguard could display my CPU temperature until it died, so could the plasma widget at one time, and 'sensors' at the command line still can:
>jonathan@Odin:~$ sensors
>k10temp-pci-00c3
>Adapter: PCI adapter
>temp1:        +25.6°C  (high = +70.0°C)
>                       (crit = +90.0°C, hyst = +85.0°C)
> it8721-isa-0290
> ...
Steps to reproduce: Add a System Monitor widget to the desktop
Configure System Monitor; select presets: Temps and Apply
Result: Widget displays
> Temperature 1                  41°C
> Temperature 2                  35°C
> GPU 1 Temperature            0°C
(Note that Temps 1 and 2 are the northbridge and southbridge temperatures reported from the it8721 chip, which I have omitted from the 'sensors' output)
Compare this to the 'sensors' output for k10temp reading, above.  CPU temperature is absent.  Let's try to fix it.
Select Sensors Details, Sensors, CPU, All, Average CPU temperature.  (The new sensor entry is displayed).  Apply.
Result: Widget displays as before with an added line
>Average CPU Temperature  0.0°C
The System Monitor application also has all six core temperatures at 0°.

This is a recent re-install of KDE Neon:

Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Kernel Version: 5.19.0-46-generic (64-bit)
Graphics Platform: X11
Processors: 6 × AMD Phenom(tm) II X6 1090T Processor
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080/PCIe/SSE2
Motherboard: Asus Crosshair V Formula
Comment 20 Martin 2023-11-25 17:21:11 UTC
When I was upgrading to Plasma 5.27.9 I applied the patch included in one of the posts above without even trying without it. The code still blacklists k10temp.

I just don't understand why k10temp is blacklisted, it's the only temperature reading that has the actual CPU temperature.
Comment 21 Martin 2023-12-19 06:49:03 UTC
This is still an issue on plasma 5.27.10.

Had to modify the code before building ksystemstats to get my cpu temperature showing.
Comment 22 Francesco 2024-01-05 21:30:57 UTC
I've configured sensors on plasma-systemmonitor before upgrading Debian from 11 (plasma-systemmonitor 5.20.0) to 12 (plasma-systemmonitor 5.27.5) and with the previous version k10temp was listed and plotted without errors.
After the ugrade is disappear. I can continue select and using all other sensors (see below) but not k10temp

atk0110-acpi-0
Adapter: ACPI interface
Vcore Voltage:        1.21 V  (min =  +0.80 V, max =  +1.60 V)
+3.3V Voltage:        3.31 V  (min =  +2.97 V, max =  +3.63 V)
+5V Voltage:          5.00 V  (min =  +4.50 V, max =  +5.50 V)
+12V Voltage:        12.02 V  (min = +10.20 V, max = +13.80 V)
CPU Fan Speed:      4017 RPM  (min =  600 RPM, max = 7200 RPM)
Chassis Fan Speed:     0 RPM  (min =  600 RPM, max = 7200 RPM)
Chassis2 Fan Speed:    0 RPM  (min =  600 RPM, max = 7200 RPM)
Power Fan Speed:       0 RPM  (min =  600 RPM, max = 7200 RPM)
CPU Temperature:     +45.0°C  (high = +60.0°C, crit = +95.0°C)
MB Temperature:      +36.0°C  (high = +45.0°C, crit = +75.0°C)

k10temp-pci-00c3
Adapter: PCI adapter
temp1:        +36.8°C  (high = +70.0°C)
                       (crit = +90.0°C, hyst = +85.0°C)

drivetemp-scsi-3-0
Adapter: SCSI adapter
temp1:        +37.0°C  (low  =  +0.0°C, high = +60.0°C)
                       (crit low = -41.0°C, crit = +85.0°C)
                       (lowest = +22.0°C, highest = +39.0°C)
Comment 23 Riccardo Robecchi 2024-01-06 09:58:33 UTC
Francesco, a small note here: you changed the version of this bug from 5.27.10 to the earlier 5.27.5. If you comment on already-open bugs and you see that the version mentioned there came out after the one you have tried, like in this case, it is safe to leave that version there because it (probably!) means all versions up to the one mentioned are affected. If you have an earlier version which is not affected, you should say that but leave the version mentioned in the bug info unaltered.
Comment 24 Bug Janitor Service 2024-02-05 15:49:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/ksystemstats/-/merge_requests/75
Comment 25 Arjen Hiemstra 2024-02-07 11:24:17 UTC
Git commit 19cf85eeb1a85c8ef4fc02cd46a61442e4c4e46c by Arjen Hiemstra.
Committed on 07/02/2024 at 11:23.
Pushed by ahiemstra into branch 'master'.

cpu: Also consider "temp1" and "temp2" for AMD temperature sensors

Apparently some older CPUs/kernels report Tctl and/or Tdie as "temp1/2"
so also check those names. In addition, be a little more verbose if we
encounter something that doesn't match what we expect.

M  +5    -4    plugins/cpu/linuxcpuplugin.cpp

https://invent.kde.org/plasma/ksystemstats/-/commit/19cf85eeb1a85c8ef4fc02cd46a61442e4c4e46c
Comment 26 Arjen Hiemstra 2024-02-07 12:08:16 UTC
Git commit 62c4a20eeb22cf1c7edf0ba8d3c2ac9f86d5ff23 by Arjen Hiemstra.
Committed on 07/02/2024 at 12:05.
Pushed by ahiemstra into branch 'Plasma/6.0'.

cpu: Also consider "temp1" and "temp2" for AMD temperature sensors

Apparently some older CPUs/kernels report Tctl and/or Tdie as "temp1/2"
so also check those names. In addition, be a little more verbose if we
encounter something that doesn't match what we expect.


(cherry picked from commit 19cf85eeb1a85c8ef4fc02cd46a61442e4c4e46c)

M  +5    -4    plugins/cpu/linuxcpuplugin.cpp

https://invent.kde.org/plasma/ksystemstats/-/commit/62c4a20eeb22cf1c7edf0ba8d3c2ac9f86d5ff23
Comment 27 Martin 2024-02-14 17:40:06 UTC
(In reply to Arjen Hiemstra from comment #25)
> Git commit 19cf85eeb1a85c8ef4fc02cd46a61442e4c4e46c by Arjen Hiemstra.
> Committed on 07/02/2024 at 11:23.
> Pushed by ahiemstra into branch 'master'.
> 
> cpu: Also consider "temp1" and "temp2" for AMD temperature sensors
> 
> Apparently some older CPUs/kernels report Tctl and/or Tdie as "temp1/2"
> so also check those names. In addition, be a little more verbose if we
> encounter something that doesn't match what we expect.
> 
> M  +5    -4    plugins/cpu/linuxcpuplugin.cpp
> 
> https://invent.kde.org/plasma/ksystemstats/-/commit/
> 19cf85eeb1a85c8ef4fc02cd46a61442e4c4e46c

Hello,

I applied this patch to ksystemstats-5.27.10.

I can confirm that now I can see temperatures for each of my four CPU cores.
Previously I could add just a single temperature for the entire CPU but it's not a big deal.

Thank you!!!

I'll be building the entire thing once this commit is released in 5.27.x. I'll let you know if something is broken then.

Regards
Martin