mirror of
https://github.com/Death916/minestart.git
synced 2026-04-10 03:33:43 -07:00
check gpu usage
This commit is contained in:
parent
37293136e5
commit
1c98d7f4f8
1 changed files with 22 additions and 3 deletions
25
minestart.py
25
minestart.py
|
|
@ -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()
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue