gpustat
gpustat copied to clipboard
Let --gpuname-width clip gpu names longer than the specified width
I guess the behaviour should change the output from
gpustat [0] GeForce GTX 1080 Ti | 32'C, 0 % | 10795 / 11172 MB
to
gpustat --gpuname-width 10 [0] GeForce GT | 32'C, 0 % | 10795 / 11172 MB
but it doesn't seem to do anything
version: gpustat 0.5.0.dev1 os: Ubuntu 16.04.5 LTS python: Python 3.6.4 :: Anaconda, Inc.
The actual name width is calculated as in: https://github.com/wookayin/gpustat/blob/f39d9c9a22e73b574be179e73db70d7b4e4778c2/gpustat/core.py#L435
The name of this option should be something like min-gpuname-width. Perhaps it's assumed that user always want the whole name. So could you tell us how would you want to get a partial gpu name.
So could you tell us how would you want to get a partial gpu name.
Well I am facing the same issue. In my case I have a narrow screen and all GPUs have the same name, so I would prefer to be able to hide the entire column.
I think a good behavior for --gpuname-width (and probably more intuitive), is to use the value to define the number of characters to display, so it will crop/clip the rest. Hence, a value of 0 will "hide" the column, but it also can satisfies other user preferences about how much to display.
@gabriel-vanzandycke @ajason08 Thanks for your suggestion. I'm considering changing the behavior to clipping as you suggested as a part of v1.0 release. Let me work on that if I have some extra cycle (contributions are still welcome).
This now has been implemented and will be a part of v1.0 release (since it's a kind of breaking change).
Longer GPU names will truncate at left, because GPU cards are better distinguishable with suffixes rather than prefixes. For example:
❯❯❯ gpustat
[0] NVIDIA GeForce GTX TITAN X | 67°C, 77 % | 1972 / 12212 MB | ...
❯❯❯ gpustat --gpuname-width 10
[0] …X TITAN X | 67°C, 77 % | 1972 / 12212 MB | ...
❯❯❯ gpustat --gpuname-width 0
[0] 67°C, 70 % | 1972 / 12212 MB | ...