mirror of
https://github.com/nicolargo/glances.git
synced 2026-03-14 12:00:14 -04:00
Force float on GPU memory
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user