Force float on GPU memory

pull/989/head
nicolargo 2016-12-26 09:39:42 +01:00
parent 184e444dc4
commit 01ff8aa7d5
1 changed files with 2 additions and 2 deletions

View File

@ -210,13 +210,13 @@ class Plugin(GlancesPlugin):
try:
return pynvml.nvmlDeviceGetName(device_handle)
except pynvml.NVMlError:
return "NVIDIA GPU"
return "NVIDIA"
def get_mem(self, device_handle):
"""Get GPU device memory consumption in percent"""
try:
memory_info = pynvml.nvmlDeviceGetMemoryInfo(device_handle)
return memory_info.used * 100 / memory_info.total
return memory_info.used * 100.0 / memory_info.total
except pynvml.NVMLError:
return None