|
|
@ -36,12 +36,11 @@ def empty_cache(self):
|
|
|
|
gc.collect()
|
|
|
|
gc.collect()
|
|
|
|
return {"success":True,"message":"GPU is cleared!"}
|
|
|
|
return {"success":True,"message":"GPU is cleared!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_vram(self):
|
|
|
|
def getVRam(self):
|
|
|
|
|
|
|
|
nvmlInit()
|
|
|
|
nvmlInit()
|
|
|
|
h = nvmlDeviceGetHandleByIndex(0)
|
|
|
|
h = nvmlDeviceGetHandleByIndex(0)
|
|
|
|
info = nvmlDeviceGetMemoryInfo(h)
|
|
|
|
info = nvmlDeviceGetMemoryInfo(h)
|
|
|
|
res=[]
|
|
|
|
res = []
|
|
|
|
res.append(f'total: {round(info.total / 1024 / 1024 / 1024, 1)} GB')
|
|
|
|
res.append(f'total: {round(info.total / 1024 / 1024 / 1024, 1)} GB')
|
|
|
|
res.append(f'free : {round(info.free / 1024 / 1024 / 1024, 1)} GB')
|
|
|
|
res.append(f'free : {round(info.free / 1024 / 1024 / 1024, 1)} GB')
|
|
|
|
res.append(f'used : {round(info.used / 1024 / 1024 / 1024, 1)} GB')
|
|
|
|
res.append(f'used : {round(info.used / 1024 / 1024 / 1024, 1)} GB')
|
|
|
|