0ry0n / Resource_Monitor

Resource_Monitor is a GNOME Shell extension that Monitor the use of system resources like cpu, ram, disk, network and display them in GNOME Shell top bar.
https://extensions.gnome.org/extension/1634/resource-monitor/
GNU General Public License v3.0
153 stars 21 forks source link

CPU temperature not being properly reported. #21

Closed ghost closed 2 years ago

ghost commented 3 years ago

The CPU temperature is directed to acpitz-acpi-0. Here it reports a the wrong temperature as my CPU runs 30-35C minimum (idle) in both Linux and Windows . After installing lm-sensors I ran sensors-detect, then the command 'watch -n 1 sensors'.

Here I saw the following. 2021-01-16_06-37

I looked through extension.js and found that it was looking at thermal_zone0 when my CPU was being reported to thermal_zone1. Changing this and reinstalling the extension set the correct temp for my CPU.

From doing some googling I believe the first temp is the CPU Socket temperature.

I'm sure I'm the only person with this problem but I still though to report it just in case.

Take care!

Partial System Specs

  1. Motherboard: Asus Prime Z390-A
  2. Processor: i9-9900K @ 4.8Ghz
  3. Case: Lian Li 205m
  4. CPU Cooler: Corsair H100i PRO AIO
  5. OS: Ubuntu 5.8.0-38.43~20.04.1-generic 5.8.18
machetie commented 3 years ago

You're not the only person. Should get an option witch sensor is reporting from. Reporting from acpitz-acpi-0 need k10temp-pci-00c3 $ sensors acpitz-acpi-0 Adapter: ACPI interface temp1: +16.8°C (crit = +20.8°C)

k10temp-pci-00c3 Adapter: PCI adapter Tctl: +42.5°C
Tdie: +42.5°C
Tccd1: +33.8°C
Tccd2: +34.8°C

Partial System Specs

  1. Motherboard: Gigabyte x570 Master
  2. Processor: Ryzen 9 3950x
fzamperin commented 2 years ago

Same problem for me, it gives me an error at the taskbar for temps, sensors output:

amdgpu-pci-0b00
Adapter: PCI adapter
vddgfx:        6.00 mV 
fan1:           0 RPM  (min =    0 RPM, max = 3400 RPM)
edge:         +38.0°C  (crit = +100.0°C, hyst = -273.1°C)
                       (emerg = +105.0°C)
junction:     +52.0°C  (crit = +110.0°C, hyst = -273.1°C)
                       (emerg = +115.0°C)
mem:          +48.0°C  (crit = +100.0°C, hyst = -273.1°C)
                       (emerg = +105.0°C)
power1:       33.00 W  (cap = 332.00 W)

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +48.1°C  
Tdie:         +48.1°C  
Tccd1:        +50.0°C  
Tccd2:        +43.2°C  

nvme-pci-0400
Adapter: PCI adapter
Composite:    +45.9°C  (low  =  -5.2°C, high = +83.8°C)
                       (crit = +87.8°C)

nvme-pci-0100
Adapter: PCI adapter
Composite:    +45.9°C  (low  = -20.1°C, high = +74.8°C)
                       (crit = +79.8°C)

Specs: Motherboard: Asus x570 tuf gaming Processor: Ryzen 9 5900x

fzamperin commented 2 years ago

I've made a change at the file extensions.js, function _refreshCpuTemperature

        _refreshCpuTemperature() {
            const command_temperature = "sensors k10temp-pci-00c3 | grep Tdie | awk '{print $2}' | tr -d +";
            let proc = Gio.Subprocess.new(['bash', '-c', command_temperature], Gio.SubprocessFlags.STDOUT_PIPE | Gio.SubprocessFlags.STDERR_PIPE);
            proc.communicate_utf8_async(null, null, (proc, res) => {
                const [, stdout, stderr] = proc.communicate_utf8_finish(res);
                if(proc.get_successful()) {
                    let temperature = parseFloat(stdout.split('\n')[0].split('°')[0]);
                    if (this.cpuTemperatureFahrenheit) {
                        temperature = (temperature * 1.8) + 32;
                    }
                    if (this.displayDecimals) {
                        this.cpuTemperature.text = `[${temperature.toFixed(1)}`;
                    } else {
                        this.cpuTemperature.text = `[${temperature.toFixed(0)}`;
                    }
                }
            })
        }

Just run sensors and look for your processor sensor name, in my case is k10temp-pci-00c3, don't know if is the best way to do this but it works

0ry0n commented 2 years ago

Ok, now I've added the ability to choose what to monitor (from preferences). Please give me feedback especially for amd cpu (@fzamperin @machetie). Thanks for collaboration. P.S. this fix is in the develop branch.

fzamperin commented 2 years ago

Thanks @0ry0n, I was facing error problem, with this new develop fix I'm still having issues, this is my screenshot.

Screenshot from 2021-12-10 09-41-44

fzamperin commented 2 years ago

Strangely, the list of devices now in the thermal options for me are blank, no options available to select Screenshot from 2021-12-10 09-49-44

0ry0n commented 2 years ago

Please give me this output. ls /sys/devices/virtual/thermal/ cat /sys/devices/virtual/thermal/thermal_zone*/temp

fzamperin commented 2 years ago

Screenshot from 2021-12-10 10-10-20

0ry0n commented 2 years ago

@fzamperin ok, are you in Virtual Machine?

fzamperin commented 2 years ago

No, I'm running a physical machine

Linux bife-desktop 5.13.19-2-MANJARO #1 SMP PREEMPT Sun Sep 19 21:31:53 UTC 2021 x86_64 GNU/Linux

0ry0n commented 2 years ago

@fzamperin ok, this should work.

fzamperin commented 2 years ago

Confirming, It's working now, the devices are detected, selecting the right sensor and temperature works. Screenshot from 2021-12-10 13-42-52

And the temperature monitor:

Screenshot from 2021-12-10 13-43-50

Thanks a lot for your effort, really appreciate, this extension is amazing!!