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...

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
I haven't seen any white noise, but I can also tell you I managed to install both Mojave and Catalina on the Atari VCS which uses an AMD APU with a Vega64 chip.
I made a guide for it here > https://www.tonymacx86.com/threads/guide-atari-vcs-2020-console.309903/

I think you should have a look at it because it is a more compatible setup for AMD based laptops, particularly if you want to get the graphics working.

I haven't updated it yet with the new no-gfx-spoof method as that was a recent addition from Opencore. But I think it should work.
OK, I will read it and give it a test
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
I haven't seen any white noise, but I can also tell you I managed to install both Mojave and Catalina on the Atari VCS which uses an AMD APU with a Vega64 chip.
I made a guide for it here > https://www.tonymacx86.com/threads/guide-atari-vcs-2020-console.309903/

I think you should have a look at it because it is a more compatible setup for AMD based laptops, particularly if you want to get the graphics working.

I haven't updated it yet with the new no-gfx-spoof method as that was a recent addition from Opencore. But I think it should work.
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.
 

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:

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
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.
Right. If you do swap the RX6600 remember to change the setting to agdpmod=pikera and to put in the device-id FF730000 under the PCIRoot path plus model name. It won’t need the no-gfx-spoof but for Monterey 12.3+ device-id may need removing if it fails to boot with PCIRoot path and model name present.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Is zxc2689963's post #98 still the route to go to install Big Sur first on the Legion 5 or is there a revised EFI? Or is there a way to install Monterey without installing Big Sur first? My Intel Wireless comes today along with 64GB ddr 3200 so I am going to attempt to get past the IONvme errors once I get them installed here shortly. (So far with 2 XPG Gammix Blade 512GB SSD's and the oem Realtek wireless it hangs on or around IONvme every time during first reboot of installing Big Sur, I tried restarting at least 30 times with no luck getting past it)
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Is zxc2689963's post #98 still the route to go to install Big Sur first on the Legion 5 or is there a revised EFI? Or is there a way to install Monterey without installing Big Sur first? My Intel Wireless comes today along with 64GB ddr 3200 so I am going to attempt to get past the IONvme errors once I get them installed here shortly. (So far with 2 XPG Gammix Blade 512GB SSD's and the oem Realtek wireless it hangs on or around IONvme every time during first reboot of installing Big Sur, I tried restarting at least 30 times with no luck getting past it)
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:

Screen Shot 2022-06-13 at 11.22.11 PM.png

For the WiFi you could try updating it to the latest Alpha 2.2.0 Airportitlwm.kext for Monterey.
 

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:

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
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
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:
Screen Shot 2022-06-14 at 12.21.28 AM.png
If the trackpad doesn't work, enable the VoodooPS2Trackpad.kext as well.
 

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
Also, what is the most updated EFI for Monterey right now?
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
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?

View attachment 6106
I got it installed without the NVMEfix, howevere i had to do a lot of reboots and re-tries. With the fix did go all smooth?
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
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?

View attachment 6106
For Monterey, I replaced the efi with the Monterey provided. then update to Monterey and it that should be it.

I used Hackintool to access the efi and replace, done
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I got it installed without the NVMEfix, howevere i had to do a lot of reboots and re-tries. With the fix did go all smooth?
It would not go past the ionvme without the nvmefix.kext on mine after the first reboot and when it starts extracting on the ssd. I believe it was because of the type of ssd's I am using. I have the nvme kext on all my other desktops that are running the same ssd (XPG Gammix) so that is probably why those went without hitches. I am now a couple reboots into the Monterey upgrade. It would kernel panic if I tried to do the upgrade with the Big Sur EFI, I had to boot Big Sur with the Monterey EFI to get it to take the upgrade without a kernel panic.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
For Monterey, I replaced the efi with the Monterey provided. then update to Monterey and it that should be it.

I used Hackintool to access the efi and replace, done
Does your touchpad work with the last EFI you posted?
 

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
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
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.

View attachment 6107
Funny, My fenvi m.2 wireless didnt work but the BL did work. BTW, I use the Apple magic trackpad anyway and is great. the 165hz of the display is butter smooth when flipping through desktop spaces. Also is very usable even when only one CPU. core,
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Funny, My fenvi m.2 wireless didnt work but the BL did work. BTW, I use the Apple magic trackpad anyway and is great. the 165hz of the display is butter smooth when flipping through desktop spaces. Also is very usable even when only one CPU. core,
It also seems that the usb ports drop out in Monterey. No longer have access to them. I am going to make usb port mapping and see if that helps with that part. I have a feeling that is why the wifi works but not the BT.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
No it doesn't, is dead like a fish :cry:
Follow my post here on how to enable the trackpad drivers: https://forum.amd-osx.com/index.php...monterey-kernel-panic.2725/page-11#post-19344

The drivers/kexts must be placed and enabled in the order they are shown, otherwise they won't work.
It also seems that the usb ports drop out in Monterey. No longer have access to them. I am going to make usb port mapping and see if that helps with that part. I have a feeling that is why the wifi works but not the BT.
Great stuff and congrats! Looks like it's really coming together. The next part now should be easy. You'll need to map out the ports and check the BT card if it is a Broadcom supported/unsupported and/or Intel. If so the procedure to install the BT kexts will be different.

If Broadcom, BrcmFirmware, BrcmPatchRAM3.kext, BrcmFirmwareData.kext and Bluetoolfixup.kext will be needed. If Intel then only IntelBluetoothfirmware and Bluetoolfixup is needed.

So earlier I'd gone ahead and built what I thinks should work for Monterey 12.4 for the Legion 5. Inside the EFI contains the XHC files for a B550 (I've lifted it literally from the build) which may work for you under both ACPI section and Kernel kexts. But in the build I have added new SSDT-CPURs specifically for the Legion 5 5800H which should help with the system chip recognition.

To do the ports you both could add and enable a SSDT-UIAC to your mix. You also need SSDT-EC-USB-LAPTOP enabled and USBInjectall enabled, and SSDT-UIAC plus XHCI-unsupported.kext . You may also need a SSDT-USBW for USB waking if wake/hiberation is an issue. You'll need to run USBMap script and enable the internal USB 2.0 ports as well as USB 3.0/USB 3.1 but keeping the number under 15 ports.
 

Attachments

  • EFI.zip
    34.1 MB · Views: 35

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Follow my post here on how to enable the trackpad drivers: https://forum.amd-osx.com/index.php...monterey-kernel-panic.2725/page-11#post-19344

The drivers/kexts must be placed and enabled in the order they are shown, otherwise they won't work.

Great stuff and congrats! Looks like it's really coming together. The next part now should be easy. You'll need to map out the ports and check the BT card if it is a Broadcom supported/unsupported and/or Intel. If so the procedure to install the BT kexts will be different.

If Broadcom, BrcmFirmware, BrcmPatchRAM3.kext, BrcmFirmwareData.kext and Bluetoolfixup.kext will be needed. If Intel then only IntelBluetoothfirmware and Bluetoolfixup is needed.

So earlier I'd gone ahead and built what I thinks should work for Monterey 12.4 for the Legion 5. Inside the EFI contains the XHC files for a B550 (I've lifted it literally from the build) which may work for you under both ACPI section and Kernel kexts. But in the build I have added new SSDT-CPURs specifically for the Legion 5 5800H which should help with the system chip recognition.

To do the ports you both could add and enable a SSDT-UIAC to your mix. You also need SSDT-EC-USB-LAPTOP enabled and USBInjectall enabled, and SSDT-UIAC plus XHCI-unsupported.kext . You may also need a SSDT-USBW for USB waking if wake/hiberation is an issue. You'll need to run USBMap script and enable the internal USB 2.0 ports as well as USB 3.0/USB 3.1 but keeping the number under 15 ports.
I tried doing the the USB port mapping but not with your supplied efi. When I boot with utportmap it hangs at something about activating the kext. I think it might be because of incorrect acpi patches so I will try what you suggested above tomorrow. I made a couple changes such as making both nvme controllers and nic set to built in and once I figure out how to get all USB ports mapped correctly I will post an efi. (Hopefully with the trackpad working as well) then maybe we all can tackle the cpus=1 quark.
 
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.