-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Added the possibility to filter by GPU IDs #22
Conversation
Thanks for the PR. Could you please also update the readme? And, there is also a description of the CLI options at the beginning of the Python script. Could you update that, too? Would it be possible to add a test for this CLI flag? I think you can just copy one of the already present test and just add the |
And do you know since when the |
My pleasure, I've been using the script for some time and figured I'd contribute with my little edit. I added the usage string in the readme and in the Python script, thanks for pointing it out. It's worth stressing out that this implementation sends the I looked into testing the changes, but for the reason above I could not add new test cases, as they'd require I think I've used the native |
Thanks for pointing out it doesn't work in pipe mode. I've added a warning. I also added the test, but it only tests that the option is accepted, nothing more. |
Released in version 1.1.0. Thanks for your contribution! |
Great! Thank you! |
The standard nvidia-smi summary provides an option to display only some of the available GPUs. This feature is very useful in systems with many GPUs.
The standard nvidia-smi command is:
nvidia-smi -i <comma-serparated-gpu-ids>
For example, to display only GPU 1, 2 and 4:
nvidia-smi -i 1,2,4
I added the same exact
-i
argument, exploiting the nvidia-smi command directly.Usage:
nvidia-htop.py -i <comma-separated-gpu-ids>
For example, to display only GPU 1, 2 and 4:
nvidia-htop.py -i 1,2,4
If a wrong ID list is passed, the command fails with the original nvidia-smi error message.
For example, asking for an non-existing GPU ID:
nvidia-htop.py -i 42
ornvidia-htop.py -i random,string
Return:
nvidia-smi exited with error code 6: No devices were found