3

Im trying to get the CPU Voltage but without any success. I tried the OpenMonitorHardware but it seems like that there is no voltage sensor

public float GetCpuVoltage() {
        Computer computer = new Computer(){ CPUEnabled = true };
        computer.Open();
        foreach(IHardware hardware in computer.Hardware) {
            hardware.Update();
            if(hardware.HardwareType == HardwareType.CPU) {
                foreach(ISensor sensor in hardware.Sensors) {
                    if(sensor.SensorType == SensorType.Voltage) {
                        return (float)sensor.Value;
                    }
                }
            }
        }
        computer.Close();
}

The If statement will never be true since it only finds the Temperature, Power and Clock speed sensor.

Another try with Win32_Processor and Win32_Mainboard and pertty much every single Win32_XXX that could include it was unsuccessfull. There it either had no value or the documentation was wrong/old and the values you can pass in are false and put out an error. The closest i got with this was with this code here

foreach(ManagementBaseObject core in new ManagementObjectSearcher("Select * from Win32_Processor").Get()) {
    var voltage = core["CurrentVoltage"];
}

The value i get is "10" which doesnt even make sense. I first thought it might be rounded so 1,357 might be rounded down to one but its not its a solid 10 no matter what i try.

After hours of trying and googeling i have no idea what to try anymore i even tried to download the source code from Open Hardware Monitor since in their programm it works but its too complicated for me to fully point down the origin and how they got the value.

If anyone needs i own a I5-8600k an Asus Z390 TUF GAMING-Plus and the Super IO Controller is the Nuvoton NCT6798D which should contain the information i need.

Please forgive any typing mistakes and thanks for helping in advance

Crylia
  • 41
  • 9
  • Read the notes about CurrentVoltage in [Win32_Processor](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-processor). Maybe `10` will make more sense. – Jimi May 09 '20 at 01:23
  • @Jimi So the voltage reading i get is just the multiplier? – Crylia May 09 '20 at 01:28
  • It's a masked value that you have to *unmask* :) – Jimi May 09 '20 at 01:30
  • Are you trying to run this in Windows ? I tried to run it in a Mac, and i don't think the "OpenHardwareMonitorLibrary" it's not compatible. I tried it's equivalent .NET Core version, and it erred out in the computer.Open() statement. If this is specific to windows platform do you mind adding that to the question. – Soundararajan May 09 '20 at 01:30
  • @Soundararajan Yes im running this on Windows, sorry should've added it. – Crylia May 09 '20 at 01:31
  • See also [Win32_VoltageProbe](https://learn.microsoft.com/en-us/windows/win32/cimwin32prov/win32-voltageprobe) – Jimi May 09 '20 at 01:33
  • @Jimi Should've mention it. It does absolutely nothing, you can basically get no information from it. – Crylia May 09 '20 at 01:51
  • 1
    I think you are dealing with too many variables. 1) Whether your board report the voltage data to MSBIOS. 2) Whether you are using the right WMI Object. Use a proven tool like https://openhardwaremonitor.org/ to find out if the voltage is reported at all. If it does then from it's github, find out how to get data. WMI / WIn32 Native etc. And the next step is to use the same to figure it out. Did you also tried the debugging / monitoring tools from Intel for your board (https://downloadcenter.intel.com/product/134896/Intel-Core-i5-9600K-Processor-9M-Cache-up-to-4-60-GHz-) . – Soundararajan May 09 '20 at 02:10
  • 1
    @Soundararajan As you can see in the code above i am using openhardwaremonitor and i dont have success with it, as stated above i t seems to not have/find the voltage probe. If i use the programm you can download from them than i can see the value but i cant seem to find a way to get it to work for myself. As stated above i tried to look into the source code but its too complicated for me to find my way to the acutal value, also there is close to no comments or explanation. I tried to debugg for several hours trying to go trough every single value the openhardwaremonitor reported back to me – Crylia May 09 '20 at 02:15
  • In your C# project properties, can you change your platform target to x64 and try. If not already done. In my WIndows VM, this does show that the WMI server is connected to the requested class, but the data is not reported. – Soundararajan May 09 '20 at 02:29
  • @Soundararajan If i have done that, what exactly should i try? The CurrentVoltage still reports 10 and the other values that i tried still dont work – Crylia May 09 '20 at 02:39

0 Answers0