Created
April 17, 2020 05:15
-
-
Save zxybazh/dc36ff73046ad09d903fc2435f0e603f to your computer and use it in GitHub Desktop.
Script to record maxmimum GPU memory usage of the first card using nvidia-smi in a time period.
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
#!/bin/bash | |
max=0 | |
while true; do | |
tmp=$(nvidia-smi | grep 11019MiB | awk '{split($0,a,"|"); print a[3]}' | awk '{split($0, a, "/"); print a[1]}' | awk 'NR==1{print $1}' | awk '{split($0, a, "M"); print a[1]}') | |
if [[ "$tmp" > "$max" ]]; then | |
max=$tmp | |
fi | |
echo $max "MiB" | |
sleep .5; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment