check gpu usage

This commit is contained in:
Death916 2020-02-10 21:52:25 -08:00
parent 37293136e5
commit 1c98d7f4f8

View file

@ -1,9 +1,28 @@
"""" restart miner when gpu is low usage and kill miner if already running
"""
import GPUtil
import psutil
import GPUtil as gpu
import time
def isavailable():
card = gpu.getGPUs()
isAvailable = gpu.getAvailability(card, maxLoad=.6)
if isAvailable == [1]:
print("can mine")
print(time.ctime())
time.sleep(1)
if isAvailable == [0]:
print("cant mine")
print(time.ctime())
time.sleep(1)
return isAvailable
while True:
isavailable()