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

zxc2689963

Active member
AMD OS X Member
Joined
Feb 27, 2022
Messages
135

@zxc2689963, I tried your EFI, it boots fine to the Big Sur Installer. The problem is, during the installation, it always panics at minute 16. Did you witness that?​



Do you have a list of your Bios settings?
What type of disk and wireless card are you using, there may be disk problems, check here to see if it is in the compatibility list...https://dortania.github.io/OpenCore-Install-Guide/

I had to replace the Hynix PC711 that came with my laptop


BIOS Settings turn off safe boot. Close the AMD PSP
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
What type of disk and wireless card are you using, there may be disk problems, check here to see if it is in the compatibility list...https://dortania.github.io/OpenCore-Install-Guide/

I had to replace the Hynix PC711 that came with my laptop


BIOS Settings turn off safe boot. Close the AMD PSP
ah, gotcha. I have the stock wifi card. I will swap it with Broadcom m.2 now.

Let me see if it works with that
 
Last edited:

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
What type of disk and wireless card are you using, there may be disk problems, check here to see if it is in the compatibility list...https://dortania.github.io/OpenCore-Install-Guide/

I had to replace the Hynix PC711 that came with my laptop


BIOS Settings turn off safe boot. Close the AMD PSP

What type of disk and wireless card are you using, there may be disk problems, check here to see if it is in the compatibility list...https://dortania.github.io/OpenCore-Install-Guide/

I had to replace the Hynix PC711 that came with my laptop


BIOS Settings turn off safe boot. Close the AMD PSP

Did you replace the NVME drive?

Edit: NVM you got the Evo 970. I have an 860 around, Ill test that
 
Last edited:

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
Mine is 970EvoPlus and SN750, MACOS installed on SN750
Interesting. I have the wester Digital Black SN750 but the installer is temperamental. It only boots sometimes. never booted with the SN750 on my end. Will try again


Edit: the SN750 nvme solved the installation problem. However it got stuck on the 3rd reboot.
 
Last edited:

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
No I don't think so. Reason being is - are you aware the RX6600 is only 'officially' supported under Monterey?
That's likely why you're having trouble with it in Big Sur.

The other issue of course is, some required settings are needed for Monterey booting. Namely they are AppleMCEReporterDisabler.kext (for 12,3+),
AdviseFeatures, DisableLinkeditJettison and ProvideCurrentCPUInfo. You will also need as a boot arg these:
-lilubetaall -no_compat_check amfi_get_out_of_my_way=1 npci=0x2000 agdpmod=pikera
OK, Advise Features was not checked and was missing the first 2 boot flags. (I grabbed the EFI from post #98 to start with). I also changed from the samsung to a couple XPG Gammix SSDS, since I know they work without any issues on several of my other Ryzen boxes to eliminate that variable.

My other concern is which setting would be proper for the Bios Of the Legion 5, I already disabled switchable graphics, set to discrete, had to disable secure boot to boot OC, but there are other settings that could cause issues (attached below). If anyone can advise if any of these settings could pose a problem with what they are set to. (About to try booting into Monterey 12.4 installer with above changes, will post results.)

IMG_0214.jpegIMG_0215.jpegIMG_0216.jpeg
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
What type of disk and wireless card are you using, there may be disk problems, check here to see if it is in the compatibility list...https://dortania.github.io/OpenCore-Install-Guide/

I had to replace the Hynix PC711 that came with my laptop


BIOS Settings turn off safe boot. Close the AMD PSP
Can you share your latest EFI, the earlier one you posted was set to a Imac Pro, but it looks like you changed that to Mac Pro.
 

ccr4700

New member
AMD OS X Member
Joined
Aug 12, 2020
Messages
8
Hi and welcome! Have you added AppleMCEReporterDisabler.kext and enabled AdviseFeatures under PlatformInfo and disabled XHCILimitPort? Those are absolute musts in order to boot Monterey especially 12.3 onwards.

I would also advise adding SMCAMDProcessor to your VirtualSMC.kext build, also possibly enabling ProvideCurrentCPUInfo as well.also remember to have the correct cpuid core settings entered for your AMD kernel patch setup. Also one more thing - npci=0x2000 agdpmod=pikera should be the value used to enable the card since it is a Navi.
Most settings you mentioned are already written if my EFI that I attached in previous post. I think AdviseFeatures is not mandatory, and KP still happens with this enabled. I tested SMCAMDProcessor and AMDRyzenCPUPowerManagement enabled but nothing changed.
And I know agdpmod=pikera needed for Navi23 but the early stage KP is related to CPU not GPU. So I'm testing with less parameters at this point.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
My install hangs at the section below when trying to install Big Sur 11.6.7. It will format the nvme ssd then after first reboot on the ssd it hangs here. I tried removing agdpmod=pikera (which is required for the 6600m to work in Monterey but since it is not supported in Big Sur I left it out since everyone is able to somewhat install big sur without it). Anyone know what could be causing the hang here?

IMG_0218.jpeg
 

Attachments

  • EFI.zip
    11 MB · Views: 4

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
OK, Advise Features was not checked and was missing the first 2 boot flags. (I grabbed the EFI from post #98 to start with). I also changed from the samsung to a couple XPG Gammix SSDS, since I know they work without any issues on several of my other Ryzen boxes to eliminate that variable.

My other concern is which setting would be proper for the Bios Of the Legion 5, I already disabled switchable graphics, set to discrete, had to disable secure boot to boot OC, but there are other settings that could cause issues (attached below). If anyone can advise if any of these settings could pose a problem with what they are set to. (About to try booting into Monterey 12.4 installer with above changes, will post results.)

View attachment 6068View attachment 6069View attachment 6070


Disable AMD V, UMA Frame Buffer set to 4G

Try.

Note: when rebooting, you may have to reboot a lot of times until it hooks and continues the installation. Is a pain in the arse
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Here is a Geekbench 5 with the Ryzen 5800h on Big Sur

Will do a Cinebench r23 next, since we cant do these test on Monterey due to the core limitation

View attachment 6085
I want to ask - do you have RestrictEvents installed?
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
@Jo-Toku

Well first before I forget congratulations! It has certainly been a long wait for all of us to finally get to see AMD IGPUs have macOS running.

Now that you've got this finally running, I want to share a second tip which you may want to play around with and that is...activating the
card through some clever editing of the AMDRadeonX5000 kexts on Big Sur. If you have Monterey on another system check
AMDRadeonX6000.kext, AMDRadeonX6000Framebuffer.kext, and AMDRadeonX6000HWServices.kext under the IOKitPersonalities
line - because that is where the RX6800 Vega20 definitions resides. By turning off SIP and Gatekeeper in Terminal, you could edit them
and copy them over to Big Sur. I booted my RX6600 on Catalina just by adding that to the AMDRadeonX5000 as a test some months ago.
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
@Jo-Toku

Well first before I forget congratulations! It has certainly been a long wait for all of us to finally get to see AMD IGPUs have macOS running.

Now that you've got this finally running, I want to share a second tip which you may want to play around with and that is...activating the
card through some clever editing of the AMDRadeonX5000 kexts on Big Sur. If you have Monterey on another system check
AMDRadeonX6000.kext, AMDRadeonX6000Framebuffer.kext, and AMDRadeonX6000HWServices.kext under the IOKitPersonalities
line - because that is where the RX6800 Vega20 definitions resides. By turning off SIP and Gatekeeper in Terminal, you could edit them
and copy them over to Big Sur. I booted my RX6600 on Catalina just by adding that to the AMDRadeonX5000 as a test some months ago.

I suppose to a low level the IGPU is used? or is it the dedicated rx6600m (not fully)? Not sure since it using 7mb of video ram, just the bare minimum.

I think @zxc2689963 did test this out and mentioned that didnt work. I think it was on page 2 or 3 of this thread. I could give it a try on my free time and see it it does work
 
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.