Created
August 15, 2021 18:21
-
-
Save peazz/843f6c7692a5b9ad87d0c6f0cfcbf737 to your computer and use it in GitHub Desktop.
OHM Step 6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Targets AMD & Nvidia GPUS | |
if (hardware.HardwareType == HardwareType.GpuAti || hardware.HardwareType == HardwareType.GpuNvidia) | |
{ | |
// only fire the update when found | |
hardware.Update(); | |
// loop through the data | |
foreach (var sensor in hardware.Sensors) | |
if (sensor.SensorType == SensorType.Temperature && sensor.Name.Contains("GPU Core")) | |
{ | |
// store | |
gpuTemp = sensor.Value.GetValueOrDefault(); | |
// print to console | |
System.Diagnostics.Debug.WriteLine("gpuTemp: " + sensor.Value.GetValueOrDefault()); | |
} | |
else if (sensor.SensorType == SensorType.Load && sensor.Name.Contains("GPU Core")) | |
{ | |
// store | |
gpuUsage = sensor.Value.GetValueOrDefault(); | |
// print to console | |
System.Diagnostics.Debug.WriteLine("gpuUsage: " + sensor.Value.GetValueOrDefault()); | |
} | |
else if (sensor.SensorType == SensorType.Clock && sensor.Name.Contains("GPU Core")) | |
{ | |
// store | |
gpuCoreFrequency = sensor.Value.GetValueOrDefault(); | |
// print to console | |
System.Diagnostics.Debug.WriteLine("gpuCoreFrequency: " + sensor.Value.GetValueOrDefault()); | |
} | |
else if (sensor.SensorType == SensorType.Clock && sensor.Name.Contains("GPU Memory")) | |
{ | |
// store | |
gpuMemoryFrequency = sensor.Value.GetValueOrDefault(); | |
// print to console | |
System.Diagnostics.Debug.WriteLine("gpuMemoryFrequency: " + sensor.Value.GetValueOrDefault()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment