Created
March 3, 2025 13:54
-
-
Save neilwightman/6001902acc0387b1e204e527b1bb9e39 to your computer and use it in GitHub Desktop.
nvidia-used.sh - uses nvidia-smi and bc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| used=`nvidia-smi | grep % | cut -c 47-51 | xargs | tr -d '\n'` | |
| max=8192 | |
| echo "scale=3;($used/$max)*100" | bc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment