btop
btop copied to clipboard
[REQUEST] Show GPU use
Is your feature request related to a problem? Please describe. If I need to check the GPU usage status, I must type "nvidia-smi" to do it, which maybe can be described the ps -ef equivalent for GPUs. This is especially useful for computers that do heavy usage of multiple GPUs due to deep learning training and applications.
Describe the solution you'd like I'd love to see GPU status (the info given by nvidia-smi) integrated with btop's great interface.
Describe alternatives you've considered
Additional context
Also Intel GPU's, currently using intel_gpu_top. Don't know how feasible this would be.
I simiarly have to use readeontop to check my GPU processing and memory usage.
The best I've found so far for NVIDIA is gpustat: https://github.com/wookayin/gpustat Maybe this can give you some inspiration!
It would be neat to show GPU stats so memory usage and temperatures like the current CPU stats. As relying on GPU specific tools is a can of worms, it's probably more worthwhile to use a GL extension to query the memory/gpu usage stats similar to what mangohud probably does. The temperatures should be readable from hwmon
https://github.com/grawity/code/blob/main/desktop/gl-mem.c
That would mean a new dependency on for example libepoxy
or libgl
for doing GL queries.
There is also nvtop here:
https://github.com/Syllo/nvtop
which is written in C
I am using this at this moment - https://github.com/XuehaiPan/nvitop Works very well for Nvidia GPUs.
:+1:
Current features are delightful to use. Would be great to have GPU support. Thanks for your work.
Would be so awesome to have all the base monitoring in one place i am surprised it has not been added yet. Please add it i love your work!
i'd be very interested in this, primarily so i can monitor my gpu-having servers without spawning 2 ssh sessions
Apart from Radeontop, is there any utility similar to nvitop for AMD? I really enjoy btop's design and all I'm missing is a sleek utility for my GPU
- for this, muy importante
I made a proof-of-concept of how this could work. It's nowhere near PR-ready yet as right now it only supports nvidia cards and shows only a single GPU, but feel free to try it out here: https://github.com/romner-set/btop-gpu
As I said, it's only a proof-of-concept at this stage. I'm still not sure if the VRAM info should be in the mem panel or together with the utilization as it is right now, and how to handle multiple GPUs (single panel with averages, or one panel for each GPU?). The process list also has to go somewhere, which could be a separate panel or somehow integrated with the CPU one.
Suggestions are welcome.
@romner-set That is some really nice work! I like it! 👍🏼
You can see how I implemented the layout for gpu in the code and screenshots on https://github.com/aristocratos/btop4win With the "up" graph in the cpu panel being cpu and the "down" graph gpu.
Having a separate panel for gpu might be preferable to some but will also constrains the available space a bit, and force the minimum terminal size above 80x25 to fit everything. So could be an idea to have a toggle for gpu shown in its own panel or incorporated in the cpu panel (like in btop4win).
Feel free to open a PR (even if it's not ready yet).
@aristocratos Thanks! I had no idea GPU usage was already implemented in btop4win, that would've made things a whole lot easier.
I've got another idea that also seems like it'd work pretty well even with multi-GPU setups:
- Keep the btop4win layout
- Either make each GPU split the usage graph horizontally or just show average usage, depending on a setting
- Have each GPU's usage meter, temp graph and maybe some other info on a separate line or two of the CPU side panel, with a setting to show graphs instead of meters for the usage
- Bind the 5,6,7,8,9,0 keys to open a separate detailed panel for each of the first 6 GPUs, which would look something like what I already made
Best of both worlds, I think. Before I start working on all that I'll make a new branch on my fork to match the btop4win layout and open a PR when that's in a usable state, shouldn't take too long.
@romner-set Yeah, that would work. Considering the gpu panel could have a fixed minimal size (unlike the cpu panel with variable number of cores), it wouldn't be too much issue having multiple panels for multiple gpus sharing space horizontally.
And then if the terminal size goes below a certain size, the gpu panels are hidden and it goes back to the less verbose mode sharing space with the cpu panel.
Could also add an option for the smaller gpu stats in the cpu panel where you select from a list, something like {Auto, Average, GPU1, GPU2, ...}. Where "Auto" would select the gpu with highest current usage, "Average" would calculate an average of all and so on.
// TODO, there's gotta be a more elegant way to do this... out += Mv::to(b_y + 3, b_x) + Theme::c("div_line") + Symbols::div_left+Symbols::h_line [...]
😄 Have been thinking about pulling in fmtlib to make the current string building soup into something more readable. Give it a try if you want to. If works well, I will try to work it in to a bigger overhaul of the codebase some time in the future.
Are there any updates?
@rusmux #529
Would be epic. I guess plenty of requests for getting GPU data from the nvidia blobs, but my request would be to get it from intel_gpu_top
and radeontop
. BTOP rocks!
just here to report
#529 is easy to merge and works great for my nvidia gpu.
tip: toggle the gpu view on by typing 5
This is so great !! Congratulations to all that worked on this!
@sfikas I don't think that you should close this issue, as the implementation has not been released yet. Additionally, I believe that some individuals, myself included, have been using this issue to monitor the progress of the feature.
Are still some pending changes, cleanup/fixes, documentation, etc. needed to make this work well for all platforms. (Only enabled on Linux with Nvidia or Amd cards right now, but need to make sure the new shared data structures and so on are handled correctly when GPU support is off.) Will get to it soon.
@Samoed Sorry about that!
Apart from Radeontop, is there any utility similar to nvitop for AMD? I really enjoy btop's design and all I'm missing is a sleek utility for my GPU
Sorry for necro posting, but nvtop despite being called nvtop works fine on AMD now actually. So if you want something in the meantime until GPU support gets added in packages etc. Nvtop will work just fine, just maybe with a little bit of a cursed name considering it's on a AMD GPU now
Apart from Radeontop, is there any utility similar to nvitop for AMD? I really enjoy btop's design and all I'm missing is a sleek utility for my GPU
Sorry for necro posting, but nvtop despite being called nvtop works fine on AMD now actually. So if you want something in the meantime until GPU support gets added in packages etc. Nvtop will work just fine, just maybe with a little bit of a cursed name considering it's on a AMD GPU now
- fyi, that image url contains a jwt lol
- btop also includes amd (and possibly nvidia?) gpu support as of #529
Apart from Radeontop, is there any utility similar to nvitop for AMD? I really enjoy btop's design and all I'm missing is a sleek utility for my GPU
Sorry for necro posting, but nvtop despite being called nvtop works fine on AMD now actually. So if you want something in the meantime until GPU support gets added in packages etc. Nvtop will work just fine, just maybe with a little bit of a cursed name considering it's on a AMD GPU now
- fyi, that image url contains a jwt lol
- btop also includes amd (and possibly nvidia?) gpu support as of Add GPU monitoring support #529
I don't understand what you mean by "jwt", but yes it is true that it has GPU support now. However, to my understanding it's not enabled by default yet or packaged for that matter on many distros. I was just bringing up a alternative in the meantime, or more correctly showing that it also works on AMD as well
NVIDIA support works for me on NixOS by overriding the following:
You could try taking a few things from the nvtop package in nixpkgs to get it to work on AMD.
You could try taking a few things from the nvtop package in nixpkgs to get it to work on AMD.
works fine on AMD on arch, not sure about nix however.
not able to bring this in nixos for amd gpu. Please show us how to add this!