mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-30 05:47:38 +00:00
VRAM used / free / total as Value? #753
This commit is contained in:
parent
1fa4a31ac0
commit
d7a7ccd1bc
@ -26,6 +26,9 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
|||||||
private readonly Sensor[] loads;
|
private readonly Sensor[] loads;
|
||||||
private readonly Sensor control;
|
private readonly Sensor control;
|
||||||
private readonly Sensor memoryLoad;
|
private readonly Sensor memoryLoad;
|
||||||
|
private readonly Sensor memoryUsed;
|
||||||
|
private readonly Sensor memoryFree;
|
||||||
|
private readonly Sensor memoryAvail;
|
||||||
private readonly Control fanControl;
|
private readonly Control fanControl;
|
||||||
|
|
||||||
public NvidiaGPU(int adapterIndex, NvPhysicalGpuHandle handle,
|
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[1] = new Sensor("GPU Memory Controller", 1, SensorType.Load, this, settings);
|
||||||
loads[2] = new Sensor("GPU Video Engine", 2, 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);
|
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);
|
control = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);
|
||||||
|
|
||||||
NvGPUCoolerSettings coolerSettings = GetCoolerSettings();
|
NvGPUCoolerSettings coolerSettings = GetCoolerSettings();
|
||||||
@ -204,7 +209,13 @@ namespace OpenHardwareMonitor.Hardware.Nvidia {
|
|||||||
uint totalMemory = memoryInfo.Values[0];
|
uint totalMemory = memoryInfo.Values[0];
|
||||||
uint freeMemory = memoryInfo.Values[4];
|
uint freeMemory = memoryInfo.Values[4];
|
||||||
float usedMemory = Math.Max(totalMemory - freeMemory, 0);
|
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;
|
memoryLoad.Value = 100f * usedMemory / totalMemory;
|
||||||
|
ActivateSensor(memoryAvail);
|
||||||
|
ActivateSensor(memoryUsed);
|
||||||
|
ActivateSensor(memoryFree);
|
||||||
ActivateSensor(memoryLoad);
|
ActivateSensor(memoryLoad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user