paradoxxxzero / gnome-shell-system-monitor-applet

Display system informations in gnome shell status bar, such as memory usage, cpu usage, network rates…
GNU General Public License v3.0
1.75k stars 324 forks source link

feature request: multi GPU support with gpu and vram? #549

Open 3blake7 opened 5 years ago

3blake7 commented 5 years ago

I was wondering if you'd be willing to add multi GPU support with gpu and vram?

marcinbogdanski commented 4 years ago

Both Multi-GPU and VRAM support would be super amazing and the most useful thing ever.

menoos commented 3 years ago

I see not much interest in this feature, but I'd love to have it too. Adding comment just to refresh it :)

dcerisano commented 1 year ago

There is support for multi-gpu system (sort of) on linux with nvidia at least:

Edit gpu.sh, the script that polls the GPU:

nano ~/.local/share/gnome-shell/extensions/system-monitor-next@paradoxxx.zero.gmail.com/gpu.sh

Where you seenvidia-smi -i 0 ... change to your desired GPU (GPU 0 is the default).

No restart necessary, the change starts to work immediately (awesome).

Note: Since it is already using nvidia-smi, all info about all GPUs is already available. Should not be too hard to graph all GPUs at the same time (different color scheme for each). That would lead to a pretty cluttered graph, but it is do-able. Maybe a separate chart for each would be cool.

dcerisano commented 1 year ago

I realized that the current gpu_usage.sh uses GPU0 as default which on a multi-gpu system can easily be the wrong one, depending on where you have your monitors plugged in. nvidia-smi always sets GPU0 as the first one detected (CUDA sets GPU0 as the fastest).

The vast majority of systems will have a single GPU so no need to arbitrarily pick GPU0, since only one will be returned form nvidia-smi. In the case of multi-gpu, aggregation of all GPUs can be used (exactly like the CPU multi-core monitor)

I rewrote the polling for NVidia GPUs and created a pull request.

This is a multi (1 to any) GPU stat aggregator that works exactly the same as current polling in the case of 1. In the case of a multi-GPU set up, the stats returned from nvidia-smi are added (aggregated) for each GPU and the last aggregate is returned.

Fully tested, works for 1 to any number of GPUs.