tmux-plugins / tmux-cpu

Plug and play cpu percentage and icon indicator for Tmux.
MIT License
444 stars 69 forks source link

temp: support AMD CPU, support GPU unit "F", fix documented name #66

Closed wuweituzi closed 3 years ago

wuweituzi commented 3 years ago

All directions were followed for install: iostat , lm-sensors, etc. installed on my Debian system. The plugin is working perfectly for all other variables but for some reason:

-#{gpu_temp} shows "C" scale in status bar. My .tmux.conf:

set -g @gpu_temp_format '%2.0f'
set -g @gpu_temp_units 'F'

Any suggestions?

casperdcl commented 3 years ago

From the readme:

  • lm-sensors is used for CPU temperature.

What's the output of running sensors and sensors -f on your machine?

Regarding 'F'... oddly I can't actually find any commits supporting anything other than "C". Weird. it's an incorrectly documented variable name. cpu_temp_unit not cpu_temp_units.

GPU doesn't support 'F'. Happy to accept a PR #67 adding barbaric units :)

wuweituzi commented 3 years ago

lol. Thank you. Just made the correction and now cpu temp shows the correct scale: -nanF. For some reason, gpu_temp_unit is still showing as "C" even after plugin update and tmux restart. I'll try a refresh again later.

Here's the output for sensors:

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +19.0°C

k10temp-pci-00c3
Adapter: PCI adapter
Vcore:        +1.00 V
Vsoc:         +0.99 V
Tctl:         +34.2°C
Tdie:         +34.2°C
Tccd1:        +29.5°C
Tccd2:        +29.5°C
Icore:        +2.00 A
Isoc:         +6.75 A

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

nvme-pci-0400
Adapter: PCI adapter
Composite:    +18.9°C  (low  =  -5.2°C, high = +79.8°C)
                       (crit = +84.8°C)

And the output for sensors -f:

iwlwifi_1-virtual-0
Adapter: Virtual device
temp1:        +64.4°F

k10temp-pci-00c3
Adapter: PCI adapter
Vcore:        +1.49 V
Vsoc:         +0.99 V
Tctl:         +96.8°F
Tdie:         +96.8°F
Tccd1:        +97.7°F
Tccd2:        +99.5°F
Icore:       +20.00 A
Isoc:         +7.00 A

nvme-pci-0100
Adapter: PCI adapter
Composite:    +74.9°F  (low  = +31.7°F, high = +166.7°F)
                       (crit = +175.7°F)

nvme-pci-0400
Adapter: PCI adapter
Composite:    +65.9°F  (low  = +22.7°F, high = +175.7°F)
                       (crit = +184.7°F)

I'm still perplexed why it's showing as -nan in status bar.

casperdcl commented 3 years ago

ah... your sensors output is in a very different format from what is expected. A bit of research indicates you have an AMD Ryzen CPU and they've created confusion with temperature reporting choices.

I get this:

coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +52.0°C  (high = +100.0°C, crit = +100.0°C)
Core 0:        +52.0°C  (high = +100.0°C, crit = +100.0°C)
Core 1:        +52.0°C  (high = +100.0°C, crit = +100.0°C)
Core 2:        +51.0°C  (high = +100.0°C, crit = +100.0°C)
Core 3:        +50.0°C  (high = +100.0°C, crit = +100.0°C)

In your case I think it's best to average over Tccd1 & Tccd2 but I'm not sure.

wuweituzi commented 3 years ago

Averaging the highest point temps probably is simplest/best course of action in this case. These cpu's are evermore popular these days. Surprised no one else has reported this issue thus far.

casperdcl commented 3 years ago

well congratulations on reporting 3 issues in one :)

Can you try out #67?

cd ~/.tmux/plugins/tmux-cpu
git pull --all
git checkout temp_unit

Then prefix+B, I to install/refresh?

wuweituzi commented 3 years ago

Beautiful. Everything is reporting correctly now. Output:

Branch 'temp_unit' set up to track remote branch 'temp_unit' from 'origin'.
Switched to a new branch 'temp_unit'