Created
May 5, 2018 23:12
-
-
Save MInner/2b90dfa3e3c6d1aeb5a706b3b1d6d61f to your computer and use it in GitHub Desktop.
Watch nvidia-smi and show associated users
This file contains 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
#!/usr/bin/bash | |
watch "nvidia-smi | tail -n +7; nvidia-smi | nvidia-smi | sed -n '/| Processes:/,\$p' | tail -n +4 | head -n -1 | awk '{print \$3}' | while read line; do ps a -o pid,user | grep \$line | grep -v grep; done | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment