could not get the GPU MEM usage percent
spenly opened this issue · comments
spenly commented
we could see an almost 100% for GPU MEM usage, but tested the code, and could only get '0'.
My test code:
from py3nvml.py3nvml import *
nvmlInit()
handle = nvmlDeviceGetHandleByIndex(0)
result = nvmlDeviceGetUtilizationRates(handle)
print(result.memory) # 0
spenly commented
sorry, i saw the solutions in the index page.
sample code:
info = nvmlDeviceGetMemoryInfo(handle)
print("Total memory: {}".format(info.total))
will print:
Total memory: 5636292608
print("Free memory: {}".format(info.free))
will print:
Free memory: 5578420224
print("Used memory: ".format(info.used))