Created
February 1, 2014 20:10
-
-
Save OkayDave/8758028 to your computer and use it in GitHub Desktop.
Cudaminer temperature control
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
#!/usr/bin/env python | |
import subprocess | |
import time | |
def get_temp(): | |
output = subprocess.check_output(" nvidia-smi | grep Default | cut -d' ' -f5", shell=True) | |
temp = float(output.strip().decode("utf-8")[0:-1]) | |
print("tmp: " + str(temp)) | |
return temp | |
def start_miner(): | |
print("starting miner") | |
return subprocess.Popen(cmd, shell=True) | |
def stop_miner(): | |
return True | |
cmd = "cudaminer -H 2 -i 1 -o stratum+tcp://fast-pool.com:9999 -u saucyk.test -p test" | |
isRunning = False | |
process = None; | |
while True: | |
if isRunning: | |
if (get_temp() > 90): | |
process.terminate() | |
isRunning = False | |
else: | |
if (get_temp() < 70): | |
process = start_miner() | |
isRunning = True | |
time.sleep(15) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment