Post
Topic
Board Mining (Altcoins)
Re: SILENTARMY v5: Zcash miner, 115 sol/s on R9 Nano, 70 sol/s on GTX 1070
by
Arceny
on 13/11/2016, 00:03:43 UTC
Someone have a script .bat for reboot silentarmy-cywin on windows ? I have some crashs Sad

I'd like to see a linux script for rebooting after GPU crashes.  I don't know how to have the script detect a GPU crash so right now I just am using a script that restarts the rig and miner every hour or so.  But it would be much more efficient if it only rebooted the computer when a GPU crashed.

At first
# pip install sh
or
apt-get install python-sh

then follow output of the miner to log-file, for example /var/run/miner.output

start the watchdog.py loop:


#!/usr/bin/python
from sh import tail
import re
import subprocess
from datetime import datetime, timedelta

reg = re.compile('dev(\d) (\d+\.\d)')
fail_ = {}

for line in tail("-f", "/var/run/miner.output", _iter=True):
    solrate = {int(s[0]): float(s[1]) for s in reg.findall(line)}
    print '%.2f: %s' % (sum(solrate.values()),  solrate)
    for gpu in solrate:
        if solrate[gpu] < 10:
            if not fail_.get(gpu):
                fail_[gpu] = datetime.now()
            elif datetime.now() - fail_[gpu] > timedelta(seconds=60):
                print 'REBOOTING'
                print datetime.now()
                subprocess.call('reboot', shell=True)
                # TODO: edit your reboot command here
                exit(1)
        else:
            fail_[gpu] = None