Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let --gpuname-width clip gpu names longer than the specified width #47

Closed
gabriel-vanzandycke opened this issue Sep 6, 2018 · 4 comments

Comments

@gabriel-vanzandycke
Copy link

gabriel-vanzandycke commented Sep 6, 2018

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.

@Stonesjtu
Copy link
Collaborator

The actual name width is calculated as in:

gpuname_width = max([gpuname_width] + entry_name_width)

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.

@ajason08
Copy link

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.

@wookayin wookayin changed the title --gpuname-width not working Let --gpuname-width clip gpu names longer than the specified width Jul 27, 2020
@wookayin
Copy link
Owner

@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).

@wookayin wookayin added this to the 1.0 milestone Jul 27, 2020
@wookayin wookayin modified the milestones: 1.0, 1.1 Aug 13, 2021
@wookayin wookayin modified the milestones: 1.1, 1.0 Jul 9, 2022
@wookayin
Copy link
Owner

wookayin commented Aug 8, 2022

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 | ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants