greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.86k stars 471 forks source link

nvidia_gpu block: failed to parse nvidia-smi output #1769

Open nwildner opened 1 year ago

nwildner commented 1 year ago

Sup folks.

Since the migration from 0.22 to 0.30, I'm only seeing this message on the statusbar for this specific block:failed to parse nvidia-smi output

It is a Laptop RTX3070, with optimus-manager. GPU IDs remain the same, updated kernel + drivers + i3status-rust just as usual.

image

If I click on the nvidia_gpu block, the following message appears: failed to parse nvidia-smi output. (Cause: bad property: fan_speed. (Cause: invalid digit found in string)).

image

Current block is pretty minimal because I'm in the process of refactoring the config file to be compatible with the new release:

#NVIDIA
[[block]]
block = "nvidia_gpu"
interval = 30

nvidia-smi output:

[nwildner@sandworm ~]$ nvidia-smi 
Thu Feb 23 23:54:34 2023       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.89.02    Driver Version: 525.89.02    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| N/A   40C    P8    13W /  80W |    707MiB /  8192MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

i3status-rust version:

[nwildner@sandworm ~]$ pacman -Q i3status-rust
i3status-rust 0.30.2-1

No significant changes were made to the system, and it used to work on 0.22.

Please let me know if any additional information is needed to investigate this.

ammgws commented 1 year ago

nvidia-smi --query-gpu=name,memory.total,utilization.gpu,memory.used,temperature.gpu,fan.speed,clocks.current.graphics,power.draw

Can you post the output of this?

Menelkir commented 1 year ago

You've missed the format line: --format=csv,noheader,nounits I have the same issue, here's my output (with the --format line): NVIDIA GeForce GTX 650 Ti BOOST, 1991, [N/A], 289, 43, 32, [N/A], [N/A]

MaxVerevkin commented 1 year ago

Oh, values can be optional...

electronybble commented 1 year ago

I am using a temporary workaround—put an nvidia-smi shell script ahead of /usr/bin/ in the path (/usr/local/sbin/ in my case):

#!/bin/bash

/usr/bin/nvidia-smi ${@} | sed 's/\[N\/A\]/0/g'
nwildner commented 1 year ago

nvidia-smi --query-gpu=name,memory.total,utilization.gpu,memory.used,temperature.gpu,fan.speed,clocks.current.graphics,power.draw

Sure thing

[nwildner@sandworm ~]$ nvidia-smi --query-gpu=name,memory.total,utilization.gpu,memory.used,temperature.gpu,fan.speed,clocks.current.graphics,power.draw \
       --format=csv,noheader,nounits
NVIDIA GeForce RTX 3070 Laptop GPU, 8192, 3, 291, 33, [N/A], 210, 12.72
MaxVerevkin commented 1 year ago

Sort of fixed this in e473555. [N/A] will be shown as 0.