AMD Rayon R7 5800H Install Monterey kernel Panic

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Hello everyone, the Monterey kernel panic problem has been solved for AMD R7 5800H notebook installation. It is a great thing that the CPU can now run on 8 cores. Thank you guys very much.Thank them for discovering the problem and providing kernel patches @ExtremeX@Visual

Brand: Lenovo
Model: Legion 5 6th Gen
CPU: AMD Ryzen 7 5800h
GPU: AMD Radeon RX 6600m 8GB ( Separate GPU mode)
HDD: Samsung SSD 970 EVO Plus 1TB (1000 GB, PCI-E 3.0 x4)
WDS500G3X0C-00SJG0 (500 GB, PCI-E 3.0 x4)
Network: RealTek Semiconductor RTL8168/8111 PCI-E Gigabit Ethernet NIC
Intel(R) Wi-Fi 6E AX210 160MHz
Ram: x2 8GB 3200mhz ddr4
Display: 15.6 1080p 165HZ

Updated October 5, 2023
Problems solved:
1. You do not need to disable XHCI
2. The microphone problem is rectified
3. Monitor brightness can be adjusted, only in Ventura

Unresolved issues:
Failure to wake from sleep

 

Attachments

  • EFI-2023-10-5.zip
    40 MB · Views: 156
Last edited:
Solution
Panic from Monterey 12.6
View attachment 7258
Thanks. I looked at the sched_prim.c file in the XNU Kernel source code (nice of Apple to let us know exactly where to search) and found that it's related to the TSC (Time Stamp Counter) Syncronization of the CPU cores. The section of the code which gives the panic is: https://github.com/apple-oss-distributions/xnu/blob/xnu-8020.140.41/osfmk/kern/sched_prim.c#L2836
Unfortunately Apple didn't update the XNU Source Code for macOS 12.6 yet, but I still managed to find the place where it calls the panic.
Image 1 is the code of XNU that panics if the time between cores does not match (not syncronized properly).

As seen when comparing the Big Sur and Monterey code (Image 2), Big Sur...

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
RX6600 is not supported in Big Sur. The drivers for the RX 6600 series of cards were only added to Monterey 12.2, if I recall correctly.
Yes that's correct. But zxc2689963 said he managed to install and boot into it, which is why I am a bit curious.

As for the driver, actually it was already present in 12 Beta. I know because I tested it on my Asrock RX6600 with Z590 Rocket Lake build.
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
No, I tried 5800H patch and it didn't work.
Added the crucial voodootscSyncamd-16cores.kext, successfully installed and started Big Sur,Tried many way...still can't start the Monterey.

that's a pity
 

Attachments

  • 微信图片_20220429172049.jpg
    微信图片_20220429172049.jpg
    151.4 KB · Views: 60
  • 微信图片_20220429172055.jpg
    微信图片_20220429172055.jpg
    208.1 KB · Views: 60

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
"Yes indeed! As proof, in addition I also have an Atari VCS Ryzen 1606G with Vega 3 Graphics which I managed to get working.
It can do DRM and audio in Big Sur. You have to start with OC 0.6.5 installing and running Mojave using AMD kernel patches, and SSDT-GFX0.aml along with boot-args shikigva=40 shikigva=Mac7BA5B2D9E42DDD94.
Try radpg=15 if the above doesn’t work. Also add in your GPU device properties in OC. Add in npci=2000 if you have Above 4G Decoding disabled (plus other usual hackintosh-compatible settings). That should allow your APU to run."

Do you think this could work for Vega 8 under Big Sur for the Legion 5 until a proper fix for Montery can be found?
It's possible although I think Vega 8 requires a bit more than that. The VCS was able to work but only under VESA mode (and no acceleration) because the Picasso chipset doesn't have Metal support. That said, the Vega 8 team over at Github said they've made some discoveries and will be releasing a solution or guide very soon.
So we have to see.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
"So I made two discoveries recently with regards to hardware acceleration. Not sure if some of you know but what I found that's interesting is both AMD and Intel kexts in macOS /S/L/E I found share the same IOMatchCategory values under the kexts which is IOAcceleration. Unique to Intel is the IntelAccelerator IOClass which can be found in the AppleIntelSKLGraphics and AppleIntelICLGraphics kexts. I am quite sure with the info we've found so far it is possible to create a SSDT or even kext driver of sorts. We just need to figure out how to designate the AMD Vega properly as an internal IGPU.

Secondly (on a fairly related note of injecting AMD codes for acceleration), I managed to recently successfully boot up a RX6600 card in a Z590 system under Catalina. As we know the RX6600 isn't supported until Monterey, but I managed to fill in the required gaps in the Apple AMD kexts (AMDRadeonX6000Controller and AMDFramebuffer) by adding a Navi 23 class and the RX6600 device-id. I was totally amazed it booted up. This means it is totally possible to add the Vega 8 for acceleration.


Damn, If the below can work, would be Awesome!

"Alright, that's good going - it might work for my Atari VCS. And thanks for the explanation about the IOAcceleration.

With regards to the RX6600 Catalina solution, well this is what I did:


  1. Made an external USB SSD install of Catalina. Disabled SIP from Recovery mode and Gatekeeper for both Monterey and Catalina (from separate installs).
  2. Made a copy of the following Catalina kext files onto Catalina Desktop, plus from Monterey Beta in separate folder:
    AMDRadeonX6000.kext
    AMDRadeonX6000Framebuffer.kext
    AMDRadeonX6000HWServices.kext
  3. Reading the equivalent Monterey files, edited the Info.plist of Catalina kext files by transferring over missing sections of the AMD Info.plist (cutting and pasting) in the kexts, with particular regards to the Navi23 IOKitPersonality details and then added the FF731002 device-id to the end of it under IOPCIMatch. Saved the edited Info.plists.
  4. Copied the files over into S/L/E, renabled Gatekeeper and SIP and then rebooted with RX6600."

Wait...Could this also work on the Legion 5 maybe? The Desktop RX 6600 is the same card as the 6600m.🤔🧐
It might...but it's not a dGPU card unlike my setup above. I would have reservations trying Catalina on the Legion 5 laptop however.

If you want to test it, try using Big Sur 11.4 instead. That should have more of the parameters enabled for RX series cards
without your having to mess around with the Info.plist. Mine were tested working with this (albeit under VESA).
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
It's a good idea if you can drive RX6600m in BigSur. Can you provide KEXT of Monterey RX6600? I can't extract it without Monterey, so I want to try your method. I have saved ioreg in BigSur system. Recently, I am dealing with the problem that BigSur needs to restart several times to successfully enter the system, so I can only start in thin configuration.
 

Attachments

  • Legion 5.zip
    568 KB · Views: 34

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,149
@Shaneee, Poster zxc2689963 managed to get to Monterey although only with one CPU. Anything you think could be the culprit, or potential way to solve it?

Any input will be of great help!(y)


Try with this EFI for your system without cpus=1. After some research there's a replacement for VoodooTSCSync.kext which seems to fix systems not booting without the boot arg. I've included it in this EFI to test.
 

Attachments

  • EFI.zip
    4 MB · Views: 61

motorbott

New member
AMD OS X Member
Joined
Apr 13, 2022
Messages
13
It's still stuck. It's a pain in the ass
There’s an article on a Chinese forum mentioned about it.

The guy said:

"Support for TSC_ADJUST is a must. Some cpus support TSC and TSC_ADJUST, but it will not work if the BIOS don’t support it. You need an external program to do it. But Cputscsync.kext only deals with clock synchronization, not features between CPU and BIOS. As far as I know, the BIOS of my South China X79 has such problems."

So, first you need to check if your cpu support tsc_adjust and then your bios.
 

motorbott

New member
AMD OS X Member
Joined
Apr 13, 2022
Messages
13
Someone else said his CPU does not support TSC_ADJUST, but it can also install and use Monterey normally.
The solution is to delete unnecessary CPU descriptions in DSDT and use voodootscsync.kext.

He also said do not use the new cputscsync.kext, this will cause a kernel panic. Cputscsync.kext is usable when version is earlier than V1.0.3.
I’m not sure what should be deleted, just did some translations. Hope it would help.
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
It looks like we have to stop there, tSC_ADJUST is not supported, DSDT has no redundant CPU description,maybe OpenCore will make an analog BIOS module and make the hardware support this function.

I will publish my Monterey installation method and EFI, although there are still many problems. Hopefully, more people will join into improve it, If it succeeds, it could be the most powerful Hackintosh laptop since Apple switched to ARM architecture.
 

Attachments

  • 截屏2022-05-10 12.png
    截屏2022-05-10 12.png
    139.3 KB · Views: 29

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,149
@zxc2689963 Can you boot the system and open MacIASL and go to File -> New from ACPI and select CPUSSDT and send a screenshot please.

Screenshot 2022-05-10 at 21.06.50.png
 

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,149
Disable the EC SSDT and try again.
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
This is the EFI I booted to Monterey, which can only be used for booting the system, not for installation, and requires configuration modifications to install: Genericusbxhci. kext cancelled, cpus=1 cancelled, voodootscsyncamd-16cores.kext selected. This can be used to install BigSur
 

Attachments

  • EFI-Monterey.zip
    23.3 MB · Views: 39

alexjaixd

New member
AMD OS X Member
Joined
May 9, 2022
Messages
9
May I join in for discussions and possibly further development? Since we're now kinda stuck on driving all 8 cores under Monterey. But under Big Sur, all 8 cores are recognised. Why not now focus on trying Jo-Toku's suggestion to drive 6600M under Big Sur or Catalina and see if this works?
"So I made two discoveries recently with regards to hardware acceleration. Not sure if some of you know but what I found that's interesting is both AMD and Intel kexts in macOS /S/L/E I found share the same IOMatchCategory values under the kexts which is IOAcceleration. Unique to Intel is the IntelAccelerator IOClass which can be found in the AppleIntelSKLGraphics and AppleIntelICLGraphics kexts. I am quite sure with the info we've found so far it is possible to create a SSDT or even kext driver of sorts. We just need to figure out how to designate the AMD Vega properly as an internal IGPU.

Secondly (on a fairly related note of injecting AMD codes for acceleration), I managed to recently successfully boot up a RX6600 card in a Z590 system under Catalina. As we know the RX6600 isn't supported until Monterey, but I managed to fill in the required gaps in the Apple AMD kexts (AMDRadeonX6000Controller and AMDFramebuffer) by adding a Navi 23 class and the RX6600 device-id. I was totally amazed it booted up. This means it is totally possible to add the Vega 8 for acceleration.


Damn, If the below can work, would be Awesome!

"Alright, that's good going - it might work for my Atari VCS. And thanks for the explanation about the IOAcceleration.

With regards to the RX6600 Catalina solution, well this is what I did:


  1. Made an external USB SSD install of Catalina. Disabled SIP from Recovery mode and Gatekeeper for both Monterey and Catalina (from separate installs).
  2. Made a copy of the following Catalina kext files onto Catalina Desktop, plus from Monterey Beta in separate folder:
    AMDRadeonX6000.kext
    AMDRadeonX6000Framebuffer.kext
    AMDRadeonX6000HWServices.kext
  3. Reading the equivalent Monterey files, edited the Info.plist of Catalina kext files by transferring over missing sections of the AMD Info.plist (cutting and pasting) in the kexts, with particular regards to the Navi23 IOKitPersonality details and then added the FF731002 device-id to the end of it under IOPCIMatch. Saved the edited Info.plists.
  4. Copied the files over into S/L/E, renabled Gatekeeper and SIP and then rebooted with RX6600."

Wait...Could this also work on the Legion 5 maybe? The Desktop RX 6600 is the same card as the 6600m.🤔🧐
 

alexjaixd

New member
AMD OS X Member
Joined
May 9, 2022
Messages
9
It's a good idea if you can drive RX6600m in BigSur. Can you provide KEXT of Monterey RX6600? I can't extract it without Monterey, so I want to try your method. I have saved ioreg in BigSur system. Recently, I am dealing with the problem that BigSur needs to restart several times to successfully enter the system, so I can only start in thin configuration.
These are the 3 Radeon X6000 kexts under Monterey S/L/E
 

Attachments

  • Monterey-Radeon X6000 kexts.zip
    46 MB · Views: 23

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,149
Try this for me then. Remove the CPUR SSDT and EC SSDT and use the last efi I uploaded and as we know it’ll boot with one core try with cpus=2 etc and see if there’s a limit. There seems to be something strange going on with how macOS is seeing the cores even when patched in with the patches.
 
Back
Top Bottom
  AdBlock Detected
Sure, ad-blocking software does a great job at blocking ads, but it also blocks some useful and important features of our website. For the best possible site experience please take a moment to disable your AdBlocker.