Created
September 29, 2018 02:57
-
-
Save ravijo/0c5cf88f05015c880aa8bae3acde6085 to your computer and use it in GitHub Desktop.
This shell script prints all the information of processes using GPU
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 | |
# author: ravi joshi | |
# date: 29 sep 2018 | |
# this shell script prints all the information of processes using GPU | |
# grab all the processes shown by nvidia-smi | |
pids=$(nvidia-smi | awk '$4=="G" || $4=="C" {print $3}') | |
# print information of each proces | |
ps -fp $pids | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment