Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GPU temperature sensors #18

Merged
merged 3 commits into from
Sep 11, 2023
Merged

Add GPU temperature sensors #18

merged 3 commits into from
Sep 11, 2023

Conversation

enen92
Copy link
Contributor

@enen92 enen92 commented Sep 5, 2023

This adds support for GPU sensors (Kodi uses the old smctemp project to obtain either the CPU or the GPU average temperature - ref: https://github.com/xbmc/xbmc/blob/master/xbmc/platform/darwin/osx/smc.h#L36-L42 and https://github.com/xbmc/xbmc/blob/d025684d226cb88f1169bf6dfcc60d5fe4312b67/xbmc/guilib/guiinfo/SystemGUIInfo.cpp#L97C1-L104).

Implementation is pretty similar to #14 - includes both x86 and M1/M2. SMC registers where obtained from the sensors project as well.
Verified this against the values provided by TGPro:

image image

@joshuataylor your feedback is also appreciated here
Hopefully this one can be considered as well :)

@enen92
Copy link
Contributor Author

enen92 commented Sep 8, 2023

@narugit any strong objections against this?

smctemp.h Outdated Show resolved Hide resolved
main.cc Outdated Show resolved Hide resolved
smctemp.cc Outdated Show resolved Hide resolved
smctemp.cc Outdated Show resolved Hide resolved
smctemp.h Outdated Show resolved Hide resolved
@enen92
Copy link
Contributor Author

enen92 commented Sep 9, 2023

Just tested on my old x86 mac:

➜  smctemp git:(gpu) system_profiler SPSoftwareDataType SPHardwareDataType
Software:

    System Software Overview:

      System Version: macOS 11.5.2 (20G95)
      Kernel Version: Darwin 20.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: (redacted)
      User Name: (redacted)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Disabled
      Time since boot: 4 minutes

Hardware:

    Hardware Overview:

      Model Name: MacBook Air
      Model Identifier: MacBookAir7,2
      Processor Name: Dual-Core Intel Core i7
      Processor Speed: 2,2 GHz
      Number of Processors: 1
      Total Number of Cores: 2
      L2 Cache (per Core): 256 KB
      L3 Cache: 4 MB
      Hyper-Threading Technology: Enabled
      Memory: 8 GB
      System Firmware Version: 427.140.8.0.0
      SMC Version (system): 2.27f2
      ...

➜  smctemp git:(gpu) ./smctemp -c
56.2
➜  smctemp git:(gpu) ./smctemp -g
51.0

@narugit
Copy link
Owner

narugit commented Sep 9, 2023

Here is my mac information. In my mac, there is no information about SMC Version (system).

$ system_profiler SPSoftwareDataType SPHardwareDataType
Software:

    System Software Overview:

      System Version: macOS 12.6.3 (21G419)
      Kernel Version: Darwin 21.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: Nac Rook Pro
      User Name: naru (naru)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 10:38

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro15,4
      Processor Name: Quad-Core Intel Core i7
      Processor Speed: 1.7 GHz
      Number of Processors: 1
      Total Number of Cores: 4
      L2 Cache (per Core): 256 KB
      L3 Cache: 8 MB
      Hyper-Threading Technology: Enabled
      Memory: 16 GB
      System Firmware Version: 1916.80.2.0.0 (iBridge: 20.16.3045.0.0,0)
      OS Loader Version: 540.120.3~22
      Serial Number (system): ...
      Hardware UUID: ...
      Provisioning UDID: ...
      Activation Lock Status: Disabled

smctemp.cc Outdated Show resolved Hide resolved
smctemp.cc Outdated Show resolved Hide resolved
Copy link
Owner

@narugit narugit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@narugit narugit merged commit bda5a03 into narugit:main Sep 11, 2023
2 checks passed
@narugit
Copy link
Owner

narugit commented Sep 11, 2023

@enen92
Thank you for your great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants