Skip to content

Instantly share code, notes, and snippets.

@MInner
Created May 5, 2018 23:12
Show Gist options
  • Save MInner/2b90dfa3e3c6d1aeb5a706b3b1d6d61f to your computer and use it in GitHub Desktop.
Save MInner/2b90dfa3e3c6d1aeb5a706b3b1d6d61f to your computer and use it in GitHub Desktop.
Watch nvidia-smi and show associated users
#!/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