if you have multi GPU in a system, you can choose what GPU to use on model start

This commit is contained in:
iperov 2019-01-10 19:22:54 +04:00
parent 48d0123f0b
commit bf5282f7ec
4 changed files with 32 additions and 8 deletions

View file

@ -109,6 +109,17 @@ class devicelib:
pass
return result
@staticmethod
def getAllDevicesIdxsWithNamesList ():
result = []
try:
nvmlInit()
result = [ (i, nvmlDeviceGetName(nvmlDeviceGetHandleByIndex(i)).decode() ) for i in range(0, nvmlDeviceGetCount() ) ]
nvmlShutdown()
except:
pass
return result
@staticmethod
def getDeviceVRAMFree (idx):
result = 0