Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not get the GPU MEM usage percent #6

Closed
spenly opened this issue Jun 4, 2018 · 1 comment
Closed

could not get the GPU MEM usage percent #6

spenly opened this issue Jun 4, 2018 · 1 comment

Comments

@spenly
Copy link

spenly commented Jun 4, 2018

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
Copy link
Author

spenly commented Jun 4, 2018

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))

@spenly spenly closed this as completed Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant