I'm trying to get the current utilization of my GPU using openhardwaremonitor I've used SensorType.Load to get the utilization of the CPU but for the GPU it is instead returning the memory usage. I'm not sure exactly what to do
if (hardware.HardwareType == HardwareType.GpuNvidia)
{
hardware.Update();
foreach (var sensors in hardware.Sensors)
{
if (sensors.SensorType == SensorType.Load)
{
tester.Text = sensors.Name + ": " + sensors.Value.GetValueOrDefault();
int gpuLoadInt = Convert.ToInt32(sensors.Value.GetValueOrDefault());
string gpuLoadString = Convert.ToString(Decimal.Round(gpuLoadInt));
gpuLoadGuage.Value = gpuLoadInt;
gpuLoadLabel.Text = gpuLoadString + "%";
}
}
}
The library is a little tricky but once you know a little about it the rest will come out little by little. I did something like this...
You must use this OpenHardwareMonitor class as well, otherwise the data is not updated. You can use it in the same namespace or in another classes file
I'm still learning C# but hope this help