Last active
January 20, 2018 05:27
-
-
Save ironicbadger/2f9d5497912b331a50279d6044c44633 to your computer and use it in GitHub Desktop.
nvidia gpu check mining linux
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
# https://github.com/IronicBadger/bootlace |
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
[Unit] | |
Description=Mine MONA with ccminer | |
After=network.target | |
[Service] | |
Environment=GPU_FORCE_64BIT_PTR=0 | |
Environment=GPU_MAX_HEAP_SIZE=100 | |
Environment=GPU_USE_SYNC_OBJECTS=1 | |
Environment=GPU_MAX_ALLOC_PERCENT=100 | |
Environment=GPU_SINGLE_ALLOC_PERCENT=100 | |
ExecStart=/usr/bin/ccminer -o stratum+tcp://mona.suprnova.cc:2995 -a lyra2rev2 -u alexktz.zaphod -p nope -i 21 | |
[Install] | |
WantedBy=multi-user.target |
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 | |
for GPU in {0..1} | |
do | |
UTIL=`nvidia-smi -i $GPU --query-gpu=utilization.gpu --format=csv,noheader | cut -f1 -d" "` | |
if (($UTIL < 75)); then | |
sleep 5 | |
UTILRECHECK=`nvidia-smi -i $GPU --query-gpu=utilization.gpu --format=csv,noheader | cut -f1 -d" "` | |
if (($UTILRECHECK < 75)); then | |
GPUINFO=`nvidia-smi -i $GPU --query-gpu=index,name,utilization.gpu,temperature.gpu --format=csv,noheader` | |
### restart ccminer | |
systemctl restart ccmona | |
python3 /usr/bin/bootlace \ | |
-m "Mona ccimer restarted. $GPUINFO was IDLE!" \ | |
-T "MONA check" \ | |
-t nope \ | |
-u nope | |
# so that we don't restart the service more times the neccessary, force exit here | |
exit 1 | |
fi | |
else | |
echo "all is well" | |
#TODO: some magic with the whattomine JSON feed... | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment