Skip to content

Instantly share code, notes, and snippets.

@woolpeeker
Created March 12, 2022 08:43
Show Gist options
  • Save woolpeeker/35a881bb26b439fe5220acae5f32bf93 to your computer and use it in GitHub Desktop.
Save woolpeeker/35a881bb26b439fe5220acae5f32bf93 to your computer and use it in GitHub Desktop.
script for grabbing gpu
while true
do
m=`nvidia-smi --format=csv --query-gpu=memory.used 2>&1 | awk '{if(NR>1 && NR<=2)print $1}'`
if [ $m -lt 2000 ]
then
echo executing
exec python tools/train.py --gpus 0,1 configs/res18.yaml --name res18_base
else
echo memory $m
sleep 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment