mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-09-01 06:45:12 +00:00
Merge branch 'Nvidia VRAM AddOn'
This commit is contained in:
@@ -50,6 +50,7 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
case SensorType.Level: format = "{0:F1} %"; break;
|
case SensorType.Level: format = "{0:F1} %"; break;
|
||||||
case SensorType.Power: format = "{0:F1} W"; break;
|
case SensorType.Power: format = "{0:F1} W"; break;
|
||||||
case SensorType.Data: format = "{0:F1} GB"; break;
|
case SensorType.Data: format = "{0:F1} GB"; break;
|
||||||
|
case SensorType.SmallData: format = "{0:F1} MB"; break;
|
||||||
case SensorType.Factor: format = "{0:F3}"; break;
|
case SensorType.Factor: format = "{0:F3}"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -61,6 +61,10 @@ namespace OpenHardwareMonitor.GUI {
|
|||||||
this.Image = Utilities.EmbeddedResources.GetImage("data.png");
|
this.Image = Utilities.EmbeddedResources.GetImage("data.png");
|
||||||
this.Text = "Data";
|
this.Text = "Data";
|
||||||
break;
|
break;
|
||||||
|
case SensorType.SmallData :
|
||||||
|
this.Image = Utilities.EmbeddedResources.GetImage("data.png");
|
||||||
|
this.Text = "Data";
|
||||||
|
break;
|
||||||
case SensorType.Factor:
|
case SensorType.Factor:
|
||||||
this.Image = Utilities.EmbeddedResources.GetImage("factor.png");
|
this.Image = Utilities.EmbeddedResources.GetImage("factor.png");
|
||||||
this.Text = "Factors";
|
this.Text = "Factors";
|
||||||
|
@@ -26,6 +26,7 @@ namespace OpenHardwareMonitor.Hardware {
|
|||||||
Factor, // 1
|
Factor, // 1
|
||||||
Power, // W
|
Power, // W
|
||||||
Data, // GB = 2^30 Bytes
|
Data, // GB = 2^30 Bytes
|
||||||
|
SmallData, // MB = 2^20 Bytes
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct SensorValue {
|
public struct SensorValue {
|
||||||
|
@@ -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.SmallData, this, settings);
|
||||||
|
memoryUsed = new Sensor("GPU Memory Used", 2, SensorType.SmallData, this, settings);
|
||||||
|
memoryAvail = new Sensor("GPU Memory Total", 3, SensorType.SmallData, 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();
|
||||||
@@ -205,7 +210,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/ 1024;
|
||||||
|
memoryAvail.Value = (float)totalMemory/ 1024;
|
||||||
|
memoryUsed.Value = usedMemory/ 1024;
|
||||||
memoryLoad.Value = 100f * usedMemory / totalMemory;
|
memoryLoad.Value = 100f * usedMemory / totalMemory;
|
||||||
|
ActivateSensor(memoryAvail);
|
||||||
|
ActivateSensor(memoryUsed);
|
||||||
|
ActivateSensor(memoryFree);
|
||||||
ActivateSensor(memoryLoad);
|
ActivateSensor(memoryLoad);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user