-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
55 lines (42 loc) · 1.26 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import time
import os
import sys
import logging
import config
import nicehash.api
from gpus.gtx1080ti import GTX1080Ti
import nvidia.devices
import stats.nvidia
from stats.profitability import ProfitabilityStats
from utils.units import *
import utils.shell as shell
from miner_manager import MinerManager
import papertrail
def delimiter():
logger = logging.getLogger()
logger.info("=" * 100)
def check():
nicehashstats = nicehash.api.getCurrentStats()
s = ProfitabilityStats(gpuType, gpuCount)
s.print(nicehashstats, limit=6)
return s.calculate(nicehashstats)
logger = papertrail.setup()
if __name__ == "__main__":
activeAlgorithm = None
# make sure there are no zombie processes
shell.reset()
gpuType = GTX1080Ti()
gpuCount = nvidia.devices.count()
manager = MinerManager()
logger.info("Starting niceminer...")
logger.info("Supported algs: %s" % str(manager.supported()))
logger.info("Found %d GPUs" % gpuCount)
stats.nvidia.printGPUs()
while True:
delimiter()
stats = check()
manager.update(stats)
delimiter()
if manager.alg_switched:
time.sleep(config.minimum_time_for_running_alg)
time.sleep(config.check_profitability_interval)