Instantly share code, notes, and snippets.

@IronicBadger IronicBadger/bootlace
Last active Jan 20, 2018

Embed
What would you like to do?
nvidia gpu check mining linux
# https://github.com/IronicBadger/bootlace
[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
#!/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