CPU temperature is incorrect on Linux
See original GitHub issueDescribe the bug CPU temperature reporting does not work on some Linux systems due to the library not looking in the correct sysfs devices.
To Reproduce
Use systeminformation.cpuTemperature
on affected Linux systems.
Current Output
❯ node -e "require('systeminformation').cpuTemperature(t => console.log(t))"
{ main: 35.9, cores: [], max: 35.9 }
Expected behavior See actual CPU temperature, for instance on my system it was ~20° hotter than sysinf reported.
❯ cat /sys/class/hwmon/hwmon3/temp3_label; cat /sys/class/hwmon/hwmon3/temp3_input
Core 1
54000
Environment (please complete the following information):
- systeminformation package version:
v4.30.4
- OS:
Linux 5.9.10-arch1-1 x86_64
- Hardware: Dell XPS 15 7590
Additional context
Sysinf expects to see the core temperatures on the hwmon1
sysfs device.
https://github.com/sebhildebrandt/systeminformation/blob/7b4693505872b273a87353b339c4b1d6219c4d69/lib/cpu.js#L775
On my device the temps are located at hwmon3
- and I believe the order of hwmon devices is not fixed even from one reboot to another anyway:
❯ cat /sys/class/hwmon/hwmon3/temp*_label
Package id 0
Core 0
Core 1
Core 2
Core 3
Core 4
Core 5
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Incorrect CPU Temp - Linux Mint Forums
Re: Incorrect CPU Temp ... They sense the temperatures, voltages and fans and provide this information to your operating system via a chip...
Read more >CPU temperatures in linux: throttling or wrong reading?
Linux stays at around 2.0Ghz on idle, with a temperature of around 50C. Here's where it gets weird: when stressing the cpu, the...
Read more >sensors reporting incorrect temperatures - Ask Ubuntu
I'm trying to plot these temperatures with Munin, but having one that high makes it impossible to read the real temperatures. Could anyone...
Read more >Cputemp showing wrong temp - LinuxQuestions.org
I am running Ubuntu-Mate and it uses Psensor which uses lmsensor. It is showing 34 degrees F. BIOS shows cpu temp at about...
Read more >Incorrect CPU temp on AMD A10-7850 APU (Kaveri) on ...
In particular, the CPU temperature reported was incorrect: It would read around 0 degrees at idle, then maybe 20 under load. Regardless, after ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@GitSquared version 4.30.7 just published. Thank you for your awesome idea! If you have further ideas for this module, do not hesitate to contact me. Best regards.
@GitSquared wow. No need to push a pull request. Will work on it later tomorrow.