summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--glances/plugins/glances_gpu.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/glances/plugins/glances_gpu.py b/glances/plugins/glances_gpu.py
index cf588216..9fd1c292 100644
--- a/glances/plugins/glances_gpu.py
+++ b/glances/plugins/glances_gpu.py
@@ -292,7 +292,8 @@ def get_device_name(device_handle):
def get_mem(device_handle):
"""Get GPU device memory consumption in percent."""
try:
- return pynvml.nvmlDeviceGetUtilizationRates(device_handle).memory
+ memory_info = pynvml.nvmlDeviceGetMemoryInfo(device_handle)
+ return memory_info.used * 100.0 / memory_info.total
except pynvml.NVMLError:
return None