macs-fan-control icon indicating copy to clipboard operation
macs-fan-control copied to clipboard

Adding Radeon GPU Temperatures

Open startergo opened this issue 2 years ago • 10 comments

Maybe you can incorporate these sensors: https://github.com/aluveitie/RadeonSensor

[2022-05-26 18:14:15:444] [thread 8670] [TempSensorProvider.cpp#68] TemperatureSensorProvider::loadAvailableSensors
[2022-05-26 18:14:15:445] [thread 8670] [Service.cpp#62] getSMCKeysCount: 2046820352 122
[2022-05-26 18:14:15:446] [thread 8670] [Service.cpp#564] Locating temperature SMC keys
[2022-05-26 18:14:15:446] [thread 8670] [Service.cpp#579] Ignore binary search
[2022-05-26 18:14:15:456] [thread 8670] [Service.cpp#610] 39 keys found
[2022-05-26 18:14:15:457] [thread 8670] [Provider_mac.mm#268] discoverGPUs started
[2022-05-26 18:14:15:468] [thread 8670] [Provider_mac.mm#351] addGPU AMD Radeon RX 6900 XT with MTLDevice
[2022-05-26 18:14:15:468] [thread 8670] [Provider_mac.mm#22] Device hold AMD Radeon RX 6900 XT
[2022-05-26 18:14:15:471] [thread 8670] [Provider_mac.mm#351] addGPU AMD Radeon PRO W6600 with MTLDevice
[2022-05-26 18:14:15:471] [thread 8670] [Provider_mac.mm#22] Device hold AMD Radeon PRO W6600
[2022-05-26 18:14:15:471] [thread 8670] [Provider_mac_watcher.mm#82] eGPUWatcher started
[2022-05-26 18:14:15:471] [thread 8670] [TempSensorGPU.cpp#92] Discrete GPU: GPU AMD Radeon RX 6900 XT, matching SMC - yes
[2022-05-26 18:14:15:471] [thread 8670] [TempSensorGPU.cpp#92] Discrete GPU: GPU AMD Radeon PRO W6600, matching SMC - yes


[2022-05-26 18:14:15:497] [thread 8670] [TempSensorProvider.cpp#132] InitialLoadThread: number of supported GPU sensors: 2

image

startergo avatar May 26 '22 22:05 startergo

I don't mind, any chance for a sample code how to query those GPU list and T values? I don't own a hackintosh.

kleuter avatar May 30 '22 10:05 kleuter

All you need is 2 Kexts. One of them is installed inside the other one. So install this kext in /L/E and see if you can read the temperatures of AMD GPU on a real Mac in MFC. SIP probably has to be disabled as the kexts are not signed. image VirtualSMC.kext.zip

The source code for the RadeonSensorSMC.kext is in my first post. https://github.com/Andrej-Antipov/Kext-Install-Utility/blob/master/KextLEinstaller.zip

startergo avatar Jun 01 '22 21:06 startergo

Related: https://www.apriorit.com/dev-blog/430-macos-kext-development

kleuter avatar Jun 14 '22 15:06 kleuter

Some thoughts about this possible feature.

This is obviosly limited to

  • Intel macs using Thunderbolt eGPU
  • Classic Mac Pro (5,1)
  • Mac Pro 2019
  • Hackintosh

A custom kext is an issue here - special code signing from Apple is required.

Still not sure if it would be worth efforts.

kleuter avatar Jun 27 '22 13:06 kleuter

FYI. It's reporting egpu temp without any custom kext. I don't know when it happened exactly from. but I checked this today after update to ventura.

shot

elasim avatar Oct 31 '22 06:10 elasim

Ventura shows it. But not earlier macOS.

startergo avatar Oct 31 '22 09:10 startergo

Could you please run this command and post the output?

ioreg -l | grep '"PerformanceStatistics"' | sed -E "s/,/\\n/g;s/\"//g" | grep -E "(temp|power|Device Utilization|Fan|speed|GPU Activity)"

kleuter avatar Nov 10 '22 13:11 kleuter

❯ ioreg -l | grep '"PerformanceStatistics"' | sed -E "s/,/\\n/g;s/\"//g" | grep -E "(temp|power|Device Utilization|Fan|speed|GPU Activity)"
Device Utilization %=4
Fan Speed(%)=0
GPU Activity(%)=0
Fan Speed(RPM)=0
Device Utilization %=0
Fan Speed(%)=0
GPU Activity(%)=0
Fan Speed(RPM)=0
GPU Activity(%)=22
Fan Speed(%)=20
Device Utilization %=8
Fan Speed(RPM)=689
GPU Activity(%)=23
Fan Speed(%)=20
Device Utilization %=1
Fan Speed(RPM)=689
Device Utilization % at cur p-state=22
Device Utilization %=6

elasim avatar Nov 11 '22 15:11 elasim

ioreg -l | grep '"PerformanceStatistics"' | sed -E "s/,/\\n/g;s/\"//g" | grep -E "(temp|power|Device Utilization|Fan|speed|GPU Activity)"
Device Utilization %=0
Fan Speed(%)=25
GPU Activity(%)=0
Fan Speed(RPM)=1443
Device Utilization %=0
Fan Speed(%)=25
GPU Activity(%)=0
Fan Speed(RPM)=1443
GPU Activity(%)=0
Fan Speed(%)=24
Device Utilization %=0
Fan Speed(RPM)=1200
GPU Activity(%)=0
Fan Speed(%)=24
Device Utilization %=0
Fan Speed(RPM)=1200
x299@x299s-iMac-Pro ~ % 

Radeon temperature shows now. At least on hackintosh in Ventura: image

Edit: Added statistics for troubleshooting

iMacPro1,1_tech_info.zip

startergo avatar Dec 29 '22 14:12 startergo

I can confirm it's working in Ventura

kleuter avatar Sep 15 '23 14:09 kleuter