mirror of https://github.com/nicolargo/glances
Force float on GPU memory
parent
184e444dc4
commit
01ff8aa7d5
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue