summaryrefslogtreecommitdiffstats
path: root/glances/plugins/glances_gpu.py
diff options
context:
space:
mode:
authorNicolas Hennion <nicolas@nicolargo.com>2020-02-16 11:25:16 +0100
committerGitHub <noreply@github.com>2020-02-16 11:25:16 +0100
commit0cdf91ba53aecd8322134484e73ecd5bb0daa9f0 (patch)
tree976bc46b384a84c533fe80009b8b82b42109283a /glances/plugins/glances_gpu.py
parent3e5ec443cea6edfd705622b4c90da2783ff8bc35 (diff)
parent97916d2126eb575d37ad8ed7eccaaa30f9c65f4f (diff)
Merge pull request #1599 from fcalvet/develop
Specify precision to seconds for influxDB output
Diffstat (limited to 'glances/plugins/glances_gpu.py')
-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