From d7a7ccd1bc913fb1276da82caeb5c57010cfc9fb Mon Sep 17 00:00:00 2001 From: DarthDestroyer Date: Sun, 6 Dec 2015 17:20:03 +0100 Subject: [PATCH] VRAM used / free / total as Value? #753 --- Hardware/Nvidia/NvidiaGPU.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Hardware/Nvidia/NvidiaGPU.cs b/Hardware/Nvidia/NvidiaGPU.cs index 8d387b3..0acaf6c 100644 --- a/Hardware/Nvidia/NvidiaGPU.cs +++ b/Hardware/Nvidia/NvidiaGPU.cs @@ -26,6 +26,9 @@ namespace OpenHardwareMonitor.Hardware.Nvidia { private readonly Sensor[] loads; private readonly Sensor control; private readonly Sensor memoryLoad; + private readonly Sensor memoryUsed; + private readonly Sensor memoryFree; + private readonly Sensor memoryAvail; private readonly Control fanControl; public NvidiaGPU(int adapterIndex, NvPhysicalGpuHandle handle, @@ -75,7 +78,9 @@ namespace OpenHardwareMonitor.Hardware.Nvidia { loads[1] = new Sensor("GPU Memory Controller", 1, SensorType.Load, this, settings); loads[2] = new Sensor("GPU Video Engine", 2, SensorType.Load, this, settings); memoryLoad = new Sensor("GPU Memory", 3, SensorType.Load, this, settings); - + memoryFree = new Sensor("GPU Memory Free", 1, SensorType.Data, this, settings); + memoryUsed = new Sensor("GPU Memory Used", 2, SensorType.Data, this, settings); + memoryAvail = new Sensor("GPU Memory Total", 3, SensorType.Data, this, settings); control = new Sensor("GPU Fan", 0, SensorType.Control, this, settings); NvGPUCoolerSettings coolerSettings = GetCoolerSettings(); @@ -204,7 +209,13 @@ namespace OpenHardwareMonitor.Hardware.Nvidia { uint totalMemory = memoryInfo.Values[0]; uint freeMemory = memoryInfo.Values[4]; float usedMemory = Math.Max(totalMemory - freeMemory, 0); + memoryFree.Value = (float)freeMemory/ 1048576; + memoryAvail.Value = (float)totalMemory/ 1048576; + memoryUsed.Value = usedMemory/ 1048576; memoryLoad.Value = 100f * usedMemory / totalMemory; + ActivateSensor(memoryAvail); + ActivateSensor(memoryUsed); + ActivateSensor(memoryFree); ActivateSensor(memoryLoad); } }