Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Set of scripts to manage ethereum miner ethminer.
#!/bin/bash
export DISPLAY=:0
sudo nvidia-smi -pl 108
tmux \
set-option -g remain-on-exit on \; \
new-session -A -s ethminer "mining-oc && ethminer -SP 2 -U -S daggerhashimoto.eu.nicehash.com:3353 -O <address>:<miner>" \; \
split-window "mining-stats" \; \
select-layout even-horizontal \; \
split-window "mining-watchdog" \; \
split-window "/usr/bin/bash"
#!/bin/bash
export DISPLAY=:0
nvidia-settings -a "GPUGraphicsClockOffset[3]=0"
nvidia-settings -a "GPUMemoryTransferRateOffset[3]=1400"
# nvidia-settings -a "GPUFanControlState=1"
# nvidia-settings -a "GPUTargetFanSpeed=70"
#!/bin/bash
watch -n60 -t -d "nvidia-smi --query-gpu=index,pci.bus_id,clocks.current.graphics,clocks.current.memory,temperature.gpu,fan.speed,power.draw,power.limit,utilization.gpu,uti
lization.memory,pstate --format=csv"
#!/bin/bash
file=/tmp/ethminer-powerdrop.txt
POWER_THRESHOLD=50
DELAY=60
# rm -f $file
while true
do
echo "Next health check in $DELAY seconds ..."
sleep $DELAY
power_draw=$(nvidia-smi --id=0 --query-gpu=power.draw --format=csv,noheader,nounits)
if (( $(echo "$power_draw < $POWER_THRESHOLD" | bc -l) ))
then
echo $(date), "Power dropped below threshold (${POWER_THRESHOLD} W)!", $power_draw W, "Restarting miner..." | tee -a $file
tmux respawn-pane -k -t ethminer:0.0 && echo "...miner restarted." | tee -a $file
else
echo $(date), $power_draw W
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment