SilverAzide / Gadgets

Gadgets for Rainmeter
Other
365 stars 12 forks source link

Gadget not displaying temps for 2nd CPU #107

Closed candre23 closed 4 months ago

candre23 commented 4 months ago

I've got HWinfo set up to pass all the relevant values and I have them mapped in the hwinfo.inc file. CPU0 is displaying temps correctly, but all temps display as "0C" for CPU1. I've reloaded the gadget, rebooted the machine several times, and verified that the temps are reading correctly in hwinfo itself. The only other weird thing is that the core numbers for CPU1 don't start at 1. They pick up where CPU0's cores leave off. Is this correct behavior, or part of the issue I'm having?

Relevant section of the hwinfo index:

68    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core Temperatures              38 °C
54    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 0                         38 °C
55    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 1                         39 °C
56    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 2                         37 °C
57    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 3                         38 °C
58    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 4                         37 °C
59    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 5                         38 °C
60    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 6                         38 °C
61    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 7                         37 °C
62    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 8                         38 °C
63    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 9                         38 °C
64    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 10                        39 °C
65    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 11                        36 °C
66    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 12                        38 °C
67    CPU [#1]: Intel Xeon E5-2695 v3: DTS     Core 13                        39 °C

Relevant section of the mapping file:

; CPU #1 core temperature (degrees)
HWiNFO_CPU1_DTS_Core0Temp=54
HWiNFO_CPU1_DTS_Core1Temp=55
HWiNFO_CPU1_DTS_Core2Temp=56
HWiNFO_CPU1_DTS_Core3Temp=57
HWiNFO_CPU1_DTS_Core4Temp=58
HWiNFO_CPU1_DTS_Core5Temp=59
HWiNFO_CPU1_DTS_Core6Temp=60
HWiNFO_CPU1_DTS_Core7Temp=61
HWiNFO_CPU1_DTS_Core8Temp=62
HWiNFO_CPU1_DTS_Core9Temp=63
HWiNFO_CPU1_DTS_Core10Temp=64
HWiNFO_CPU1_DTS_Core11Temp=65
HWiNFO_CPU1_DTS_Core12Temp=66
HWiNFO_CPU1_DTS_Core13Temp=67

What I'm seeing:

image

SilverAzide commented 4 months ago

Hello @candre23! Very cool setup! 👍

So, first of all, the core numbering is by design, so you are all good there. I suppose one could argue that on a dual-CPU machine each CPU should start at 1, but that's a different issue.

Regarding the temps not displaying, I was able to duplicate your scenario and I think this might be a bug. Try the following:

  1. Navigate to your Gadgets\@Resources folder and open the file CpuMeter.lua with Notepad++ or your preferred editor.
  2. Go to lines 528-529:
        -- get the 0-based physical core index from the logical core map table
        nCoreIndex = tCoreMap[nCoreIndex + 1]
  3. Change line 529 to this:
        nCoreIndex = tCoreMap[(nCoreIndex % nLogicalCoresPerSkin) + 1]
  4. Save the file and refresh the CPU Meter.

I think this should resolve the error. Let me know how it goes. I'll fix this is the next release.

candre23 commented 4 months ago

Yep, that fixed it. Temps are displaying correctly for both CPUs now. Thanks!

image

SilverAzide commented 4 months ago

Awesome! Thanks a bunch. That fix isn't actually correct, by the way, but it was the simplest thing that I could do with one line of code. The proper fix will be in the next release, so keep an eye out. :-)

P.S.: Very cool screenshot! That's a keeper! :D