From 91d9e81c074f3b096ea9d26f0d17c96d1104fd13 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 25 Jul 2021 05:00:52 -0400 Subject: [PATCH] Fix Nvidia memory report where free and used memory were mixed (#499) --- LibreHardwareMonitorLib/Hardware/Gpu/NvidiaGpu.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LibreHardwareMonitorLib/Hardware/Gpu/NvidiaGpu.cs b/LibreHardwareMonitorLib/Hardware/Gpu/NvidiaGpu.cs index 464e80f..b58e818 100644 --- a/LibreHardwareMonitorLib/Hardware/Gpu/NvidiaGpu.cs +++ b/LibreHardwareMonitorLib/Hardware/Gpu/NvidiaGpu.cs @@ -444,17 +444,17 @@ namespace LibreHardwareMonitor.Hardware.Gpu try { - uint current = memoryInformation.CurrentAvailableDedicatedVideoMemoryInkB; + uint free = memoryInformation.CurrentAvailableDedicatedVideoMemoryInkB; uint total = memoryInformation.DedicatedVideoMemoryInkB; _memoryTotal.Value = total / 1024; ActivateSensor(_memoryTotal); - _memoryUsed.Value = current / 1024; - ActivateSensor(_memoryUsed); - - _memoryFree.Value = (total - current) / 1024; + _memoryFree.Value = free / 1024; ActivateSensor(_memoryFree); + + _memoryUsed.Value = (total - free) / 1024; + ActivateSensor(_memoryUsed); } catch (Exception e) when (e is NVIDIAApiException or NVIDIANotSupportedException) { }