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: 158
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

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
@zxc2689963, I noticed on your config you filed the the device property of the RX6600m. What does this do?

View attachment 6102

Was this to avoid the white noise when getting to the installer screen?

Reason I ask:
In have 3 laptops with 2X with RX580's and 1X with Vega 56. and none allow me to enter the installer page after Mojave. From Catalina to Monterey I get white noise instead of the installer page. I dont have that issue with High Sierra and Mojave. I noticed that the GPU device property differs from your config. Now, have you ever witnessed the white noise and if so, how did you solve it?
@Jo-Toku
Actually that should be quite easy to fix. I have a RX550 set up for my B550 here >


In addition to the device-id I use the setting no-gfx-spoof set to 01000000 using Type: Data. This allows any AMD card with similar specs to be used. It also needs the boot-arg npci=0x2000 agdpmod=ignore (this is for RX580 cards). This could work for Vega64 too.

On laptops you may also need the PEGP to GFX0 ACPI patch.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I have a Hackintosh desktop with the Vision D Z590, RX580/ RX 6900(I swap them). Will check "PEGP to GFX0 ACPI " because that desktop hack havent been an issue. It has been mainly an issue specifically under laptops.
Agreed, I have a couple desktops with RX 570’s & 580’s & none have that acpi. So that must be motherboard specific or laptop issue maybe, but good to know in case I come across that.
 
Last edited:

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Let me have a look. I have a working build for Monterey 12.4 I am currently still working on which is actually working not only for my Ryzen 5900X setup
but also my Atari VCS with the Ryzen 1606G. I'll try and get it for you soon.

In the meantime if you want, you can try this. Install NVMEFix.kext in your Kernel, and also add this to your config under NVRAM:

View attachment 6104

For the WiFi you could try updating it to the latest Alpha 2.2.0 Airportitlwm.kext for Monterey.
Thank you.... On another note.... the Big Sur USB installer seems to not like any of the back ports, it would not boot into the installer even, as soon as I stuck in in the right side USB, boots up to the installer. (Hoping to get past the first reboot now, will post my success or failure shortly)

UPDATE: I got past the first time reboot of Big Sur installer! Something I did notice is that the trackpad does not work with the EFI from post #98, but I will fix that if I get Big Sur installed. (26 mins remaining lol) I have never been so dam excited to install an OS before that I plan on upgrading immediately lol
 
Last edited:

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
That's brilliant! That sounds like the NVMEFix kext is doing its job.
Just need to see if it gets to the installer... :)

As for the trackpad, the fix is actually this using the VoodooInput & PS2 kexts and no SSDT-GPIO installed. The kexts need to be in this order:
View attachment 6105
If the trackpad doesn't work, enable the VoodooPS2Trackpad.kext as well.
OK, the nvmefix.kext got me into the installation and Big Sur Install successfully! As for the voodoo kexts. When I installed them and rebooted and reset nvram, it causes a kernal panic so I removed them for now. As for upgrading to Monterey, do we start the upgrade from the apple menu and use the EFI for Monterey on the next reboot or do we update the EFI then boot into Big Sur and start the upgrade?

IMG_0219.jpeg
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
OK, I got to Monterey with Jo-Tuku's EFI, However I do not have touchpad and the bluetooth is not working, but the Wireless is. Going to work on the bluetooth right not.

IMG_0220.jpeg
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
The last efi you supplied (with suggested settings) produced a kernel panic at boot, so I reverted back to the old efi, I am trying the RyzenUSBFix now. Will post update
Right. I am thinking maybe because it is missing the cpus=1 setting? I didn't add that unfortunately.

That's the reason why I included SSDT-CPUR and SSDT-CPUR-5800H-2. Reason being is the ones marked 5800H should be technically correct because they do follow the settings based on the actual DSDT output - so if it crashes again you'll have to change the kernel quirks to the ones that work with your other Monterey build. Technically it shouldn't because I had based the main EFI settings on both of my working Monterey 12.4 builds.

However I would also be interested to know what that earlier kernel panic was about.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
It might be a long shot but try the old GenericUSBXHCI kext.
I already tried that, I think it’s on the efi middleman supplied as well.

Right. I am thinking maybe because it is missing the cpus=1 setting? I didn't add that unfortunately.

That's the reason why I included SSDT-CPUR and SSDT-CPUR-5800H-2. Reason being is the ones marked 5800H should be technically correct because they do follow the settings based on the actual DSDT output - so if it crashes again you'll have to change the kernel quirks to the ones that work with your other Monterey build. Technically it shouldn't because I had based the main EFI settings on both of my working Monterey 12.4 builds.

However I would also be interested to know what that earlier kernel panic was about.
Ahhh…. That was something I didn’t even check, I will retry the efi with cpus=1 tomorrow!
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
As for THE USB port mapping, I have customized the USB interface in system 10.15.7. What we need to solve is the kernel Panic caused by the installation of Monterey system in AMD notebook CPU. I know that there are several other AMD notebook CPUS that have such a situation.
 

Attachments

  • USBPorts-10.15.7.zip
    2.4 KB · Views: 4

ExtremeXT

Donator
Donator
Joined
Aug 7, 2022
Messages
843
Alright, I already see an issue. Your VirtualSMC is in the wrong place. VirtualSMC is a primary OC kext so must be loaded after Lilu and Whatevergreen and AppleALC.
Then underneath VirtualSMC we load AMDRyzenCPUPowerManagement and SMCAMDProcessor.kext in that order.

If it also helps, this kext list is from OGNerd's working Legion 5 build afaik. You'll notice he added GenericUSBXHCI.kext as well to the build. However he had put UTBMap up top which I don't agree with. It usually must come after VirtualSMC:

View attachment 7253
This is wrong. VirtualSMC IS in fact critical to booting, but it doesn't HAVE to be loaded BEFORE the kexts that DON'T require it. The kext list order was done by ProperTree's OC Clean Snapshot function which checks all prerequisites of all the kexts and generates a CORRECT and CLEAN order.

Also, we are now trying to fix the non-monotonic time AppleACPIPlatform, not the issue when using cpus=1.

- ExtremeXT
 

zty199

New member
AMD OS X Member
Joined
Apr 15, 2022
Messages
20
@Shaneee Thanks for your input. I'm pretty sure it would fix it since that's where it panics, but I'm guessing that it's not worth the time.

On another note, this seems like what we need! (Image)

@zty199 Please try this EFI.

@craighazan Do you also have this laptop? If so can you test it?

- ExtremeXT
Seems to be the same panic with TSC_sync_margin=0
587C9A41B16852E4D159F0DDC8F63264.jpg
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Okay that's good to hear (because yours is the first known AMD CPU & IGPU I've encountered that works). If you've managed to install Big Sur on this and it's working that is extremely good news for the community.

Okay onto setting up the Monterey - have you created a custom USB map kext yet? It is vital that you do. You need to ideally create from within Big Sur.
Use the following USBMap script from here and once you've created it and reduced your USB port map down to less than 15 ports, disable your USBInjectAll and XHCIPortLimit setting to try to boot into Monterey.


If anything else try to also make sure agdpmod=pikera is enabled in the NVRAM boot-arg (to enable the RX6600M).
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
On a separate note, I had a quick look at your EFI, and find it totally odd you'd even managed to boot Big Sur! I noticed you hadn't even enabled SMCAMDProcessor.kext and a
whole load of other important kexts like AppleALC, Whatevergreen, SMCSuperIO, or AMDRyzenCPUPowerManagement. You also don't have the device properties set for the RX6600, which should be these:

Screen Shot 2022-04-11 at 1.39.59 PM.png
 

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Yes, my OC configuration KEXT is all selected. You can enter the Big Sur installation screen. But most cases stop at the following code. You can only force the restart to try more times. Also, the Big Sur installation screen is slow to respond. The mouse can only move slowly. The graphics card has no driver. Therefore, the installation fails.



 

Attachments

  • EFI.zip
    6.2 MB · Views: 49

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Yes, my OC configuration KEXT is all selected. You can enter the Big Sur installation screen. But most cases stop at the following code. You can only force the restart to try more times. Also, the Big Sur installation screen is slow to respond. The mouse can only move slowly. The graphics card has no driver. Therefore, the installation fails.



Okay I've looked at it and done some changes. One of the biggest was adding some missing ACPIs plus adding some USB kexts and SMCBatteryManager.

During install it is best to use USBInjectAll but switching on XHCIPortLimit to enabled (for Big Sur) - and then switch over to USBMap but turn off XHCIPortLimit once you manage to boot into the system to install Monterey as Monterey needs this.

Anyways give it a try.
 

Attachments

  • EFI.zip
    28.8 MB · Views: 83

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135
Okay I've looked at it and done some changes. One of the biggest was adding some missing ACPIs plus adding some USB kexts and SMCBatteryManager.

During install it is best to use USBInjectAll but switching on XHCIPortLimit to enabled (for Big Sur) - and then switch over to USBMap but turn off XHCIPortLimit once you manage to boot into the system to install Monterey as Monterey needs this.

Anyways give it a try.
Thank you for your answer, I tried to stop at [EB LOG:EXITBS]

I want to solve the problem of installing Monterey. The test started the Big Sur installation, but failed to start Monterey.

kernel panic: AppleACPIPlatform





Installation mode: Hard disk Create 1 GB EFI partition. The com.apple.recovery.boot and OC files are placed on the hard drive EFI. Start the installation on a hard disk. Troubleshoot USB port faults. Of course I customized usbmap.kext.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Thank you for your answer, I tried to stop at [EB LOG:EXITBS]

I want to solve the problem of installing Monterey. The test started the Big Sur installation, but failed to start Monterey.

kernel panic: AppleACPIPlatform





Installation mode: Hard disk Create 1 GB EFI partition. The com.apple.recovery.boot and OC files are placed on the hard drive EFI. Start the installation on a hard disk. Troubleshoot USB port faults. Of course I customized usbmap.kext.
Did you try the latest EFI I uploaded in the last post? That has a special kernel patch for Monterey, which you must use in conjunction with the USBMap.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Did you try the latest EFI I uploaded in the last post? That has a special kernel patch for Monterey, which you must use in conjunction with the USBMap.
Oh in addition, you must also add AppleMCEReporterDisable.kext. That's for the latest 12.3 bug.
 
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.