Skip to content

Instantly share code, notes, and snippets.

@ravijo
Created September 29, 2018 02:57
Show Gist options
  • Save ravijo/0c5cf88f05015c880aa8bae3acde6085 to your computer and use it in GitHub Desktop.
Save ravijo/0c5cf88f05015c880aa8bae3acde6085 to your computer and use it in GitHub Desktop.
This shell script prints all the information of processes using GPU
#!/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