calasanmarko / TurboMac

Stops CPU throttling on Intel-based Macs
GNU General Public License v3.0
56 stars 7 forks source link

Issues with Catalina / Late 2012 imac #17

Open rfourneret opened 6 months ago

rfourneret commented 6 months ago

Hi, first of all a big thank you for sharing this, i've been looking for this for a while.

The machine is a late 2012 21.5 inch imac with no LCD at all.

So after several tryouts i managed to make it work, the extension seems loaded and the mac is much much faster than it was, but it seems to still be clocked to 1.6ghz instead of 2.7 (it used to be blocked at 800mhz).

I run a geekbench which seems to confirm this as i get 320 for single core test which is around half normal score of this machine.

43 0 0xffffff7f83c11000 0x2000 0x2000 calasanmarko.TurboMac (1.0.0d1) 88EE1257-9232-3E03-854E-6649D1E57964 <5 3>

image

Do you have any idea of what could be causing this and is there any chance of me getting my imac back on full speed ?

Thanks a lot again for what you did :)

rfourneret commented 6 months ago

I upgaded to monterey, installed appropriate version of turboma and its the same

Last login: Wed Dec 27 11:40:54 on console

The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh. For more details, please visit https://support.apple.com/kb/HT208050. iMac:~ tv$ kextstat | grep TurboMac Executing: /usr/bin/kmutil showloaded No variant specified, falling back to release 172 0 0xffffff7f9ac67000 0x1000 0x1000 calasanmarko.TurboMac (1.0.0d1) D364749F-2160-3AE7-8381-7E3CBCF40418 <6 3> iMac:~ tv$

rfourneret commented 6 months ago

Funny thing is that if I start the mac with the following steps, i get my processor on full speed again but the fan get crazy and can't be controlled with mac fans control (like the smc is totally off).

Unplug the power cord (imac) Hold power button for 10ish seconds Plug the power cord back while still holding the power button and keep if for 10 more seconds.

This is the method i used before knowing your program, which still showed reduced speed in intel power gadget but reduced clutter a lot (without this the machine was not usable). I had the fan completly disconnected and it was not heating at all.

In combination with turbomac this makes power gadget read full speed :

image
rfourneret commented 6 months ago

Another thing I notice is that after waking up from sleep the CPU will go to 2,7ghz for a brief moment before going back to 1,6ghz.

Any idea of how to fix this, i'd really like to get this mac normal again.

Capture d’écran 2023-12-28 à 12 36 10

calasanmarko commented 6 months ago

I unfortunately no longer have an Intel Mac, so I can't really test out and push new builds of this extension in the near future. What we can do is examine the values of the relevant MSRs, which you can find in section 2.1 of Volume 4 of the Intel Software Developer's Manual, and tinker with them using VoltageShift until we get a working configuration.

To start with, let's read the value of the 0x1A0 MSR, corresponding to IA32_MISC_ENABLE, to see which capabilities are currently turned on for your processor. Once you install VoltageShift, try running

voltageshift read 0x1a0

And reply with the results, I'll do my best to help you out.

rfourneret commented 6 months ago

hey i just found the solution using voltageshift

image image

I'm gonna do more figuring out and let you know.

rfourneret commented 6 months ago

I unfortunately no longer have an Intel Mac, so I can't really test out and push new builds of this extension in the near future. What we can do is examine the values of the relevant MSRs, which you can find in section 2.1 of Volume 4 of the Intel Software Developer's Manual, and tinker with them using VoltageShift until we get a working configuration.

To start with, let's read the value of the 0x1A0 MSR, corresponding to IA32_MISC_ENABLE, to see which capabilities are currently turned on for your processor. Once you install VoltageShift, try running

voltageshift read 0x1a0

And reply with the results, I'll do my best to help you out.

0x1A0 reads hex 840089

rfourneret commented 6 months ago

So i read my value of 0x1FC, replaced it by same binary but last digit changed to 0 and it gets me full speed in one command

I made a .sh file to run on startup and it does the trick for me, the mac is back on full speed at startup with no intervention :)

It would be a bit of a security issue as i have my password in clear in the file but on this machine i don't really care.

calasanmarko commented 6 months ago

Ah, I see the problem.

https://github.com/calasanmarko/TurboMac/blob/52b87a66c9a32a7ce048346c6104e428bd027456/TurboMac/TurboMac.cpp#L59

The extension actually does turn off this bit, referring to BD_PROCHOT, but I've mistakenly placed it in the if that only executes when the CPU supports SpeedShift (6th gen and above), whereas it should get turned off every time.

It's a very quick fix in code, but I don't have an Intel Mac to rebuild the kext on. I'll get back to you once I borrow someone else's Intel Mac.

rfourneret commented 6 months ago

Yeah that's it. I can live with my voltageshift script in the meantime.

CPU speed seems to go back to 1.6ghz after a long sleep but it's easy to just run the script again if i need power (it's a media player so it's actually fine on 1.6ghz).

I'm availlable to test if you manage to compile the new code.