Created
July 13, 2018 09:34
-
-
Save Mehanik/cd308151a3a93398f442c1e33dc8ca01 to your computer and use it in GitHub Desktop.
Monitor GPU status by memory consumption and show GPU availability in linux framebuffer.
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 | |
PREV_STARUS=3 | |
while true; do | |
if (( $(nvidia-smi --query-gpu=memory.used --format=csv,nounits,noheader) > 1000 )); then | |
STATUS=0 | |
else | |
STATUS=1 | |
fi | |
if [ $STATUS != $PREV_STARUS ]; then | |
if [ $STATUS == 1 ]; then | |
fbi -T 1 /home/eggnot/free.png | |
else | |
fbi -T 1 /home/eggnot/busy.png | |
fi | |
fi | |
PREV_STARUS=$STATUS | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment