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
Legion 5 only stays at cpus=1, one CPU core runs Monterey, other AMD laptops don't know if they support TSC_ADJUST, tried loading RX6600M in BigSur modified driver, but failed, so far no one drives RX6600 in BigSur, Or send pictures to show
Have you tried to use the lilucpu setting in your config? You could probably try something like lilucpu=8 or lilucpu=10 to get your system to boot. Technically I don't think it's needed but who knows.

In addition to TSC_Adjust there's CpuTSCSync.

But I do think in order to get it to work, in addition you'd need some form of PEGP to GFX0 patch in the ACPI section as well. The Atari VCS build I made has shown the possibility of booting macOS using an AMD APU. As the RX6600 is fully supported in macOS Monterey it should be quite simple to achieve once the correct settings have been figured out.
You could also try wegtree=1 command to force the card online.
 

ccr4700

New member
AMD OS X Member
Joined
Aug 12, 2020
Messages
8
Hi. I bought a ROG Zephyrus G14 2022 (GA402RJ) and now struggling with similar KPs.
I'm trying to boot Monterey 12.4 with OpenCore 0.8.0.

GA402 has Navi23 dGPU with MUX switch and replaceable M.2 2230 WiFi slot so I thought it will be best Hackintosh laptop in 2022.

But I encountered the same KP that @Allen623329 faced. Also, not only Monterey but also Big Sur and before cannot be booted.

My GA402 conditions are:
  • DSDT does not have Processors so SSDT-CPUR.aml needed
  • BIOS options are very poor so I can't modify options like Above 4G Decoding
  • DevirtualiseMmio is needed to avoid stucking at [EB|#LOG:EXITBS:START]
  • tsc_adjust doesn't seem to be enabled (checked on Ubuntu LiveCD)
Bash:
$ lscpu | grep tsc
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca

What I tried but didn't work:
  • SetupVirtualMap Enable/Disable
  • MmioWhitelist
  • AmdTscSync.kext
  • npci=0x2000 add/remove
  • disable SSDT-16-AmdTable.aml to solve AE_ALREADY_EXISTS ACPI Exception
  • MacPro7,1 / MacBookPro16,1 smbios
  • use SSDT-PLUG-ALT.aml instead of SSDT-CPUR.aml
  • cpus=1

I tried @zxc2689963's EFI (with DevirtualiseMmio) and my own but both not worked.

At least I want to boot Monterey with cpus=1 or Big Sur to further testing. Any ideas?

 

Attachments

  • EFI.zip
    3.9 MB · Views: 8
  • origin-ga402.zip
    127.9 KB · Views: 1
Last edited:

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Hi. I bought a ROG Zephyrus G14 2022 (GA402RJ) and now struggling with similar KPs.
I'm trying to boot Monterey 12.4 with OpenCore 0.8.0.

GA402 has Navi23 dGPU with MUX switch and replaceable M.2 2230 WiFi slot so I thought it will be best Hackintosh laptop in 2022.

But I encountered the same KP that @Allen623329 faced. Also, not only Monterey but also Big Sur and before cannot be booted.

My GA402 conditions are:
  • DSDT does not have Processors so SSDT-CPUR.aml needed
  • BIOS options are very poor so I can't modify options like Above 4G Decoding
  • DevirtualiseMmio is needed to avoid stucking at [EB|#LOG:EXITBS:START]
  • tsc_adjust doesn't seem to be enabled (checked on Ubuntu LiveCD)
What I tried but didn't work:
  • SetupVirtualMap Enable/Disable
  • MmioWhitelist
  • AmdTscSync.kext
  • npci=0x2000 add/remove
  • disable SSDT-16-AmdTable.aml to solve AE_ALREADY_EXISTS ACPI Exception
  • MacPro7,1 / MacBookPro16,1 smbios
  • use SSDT-PLUG-ALT.aml instead of SSDT-CPUR.aml
  • cpus=1

I tried @zxc2689963's EFI (with DevirtualiseMmio) and my own but both not worked.

At least I want to boot Monterey with cpus=1 or Big Sur to further testing. Any ideas?

Have you tried mimicking zxc2689963’s EFI? Then go from there?
 

ccr4700

New member
AMD OS X Member
Joined
Aug 12, 2020
Messages
8
Have you tried mimicking zxc2689963’s EFI? Then go from there?
I used @zxc2689963's EFI from here:

And I created my own with OpenCore Install Guide.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Hi. I bought a ROG Zephyrus G14 2022 (GA402RJ) and now struggling with similar KPs.
I'm trying to boot Monterey 12.4 with OpenCore 0.8.0.

GA402 has Navi23 dGPU with MUX switch and replaceable M.2 2230 WiFi slot so I thought it will be best Hackintosh laptop in 2022.

But I encountered the same KP that @Allen623329 faced. Also, not only Monterey but also Big Sur and before cannot be booted.

My GA402 conditions are:
  • DSDT does not have Processors so SSDT-CPUR.aml needed
  • BIOS options are very poor so I can't modify options like Above 4G Decoding
  • DevirtualiseMmio is needed to avoid stucking at [EB|#LOG:EXITBS:START]
  • tsc_adjust doesn't seem to be enabled (checked on Ubuntu LiveCD)
Bash:
$ lscpu | grep tsc
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca

What I tried but didn't work:
  • SetupVirtualMap Enable/Disable
  • MmioWhitelist
  • AmdTscSync.kext
  • npci=0x2000 add/remove
  • disable SSDT-16-AmdTable.aml to solve AE_ALREADY_EXISTS ACPI Exception
  • MacPro7,1 / MacBookPro16,1 smbios
  • use SSDT-PLUG-ALT.aml instead of SSDT-CPUR.aml
  • cpus=1

I tried @zxc2689963's EFI (with DevirtualiseMmio) and my own but both not worked.

At least I want to boot Monterey with cpus=1 or Big Sur to further testing. Any ideas?

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.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Last edited:

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I changed nothing. I used the EFI posted on #98.

But the installation froze in the middle. I will try resume today
How did the install of Big Sur go
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Froze in the middle. then I went back to work. Ill try again later
Mine freezes at ionvme… gunna swap out the Samsung ssd with Xpg tomorrow and try. Mine also don’t have Intel Wi-Fi, it has Realtek… don’t know if that could be causing any issues on my end but will attack it tomorrow.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Tried again and froze with 15 minutes remaining
I know people with Samsung SSDs have had weird issues so I’m curious if that has anything to do with it.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Mine freezes at ionvme… gunna swap out the Samsung ssd with Xpg tomorrow and try. Mine also don’t have Intel Wi-Fi, it has Realtek… don’t know if that could be causing any issues on my end but will attack it tomorrow.
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
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234
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
The Legion 5 can install Big Sur. Actually that is the only known path to install Monterey which is via updating from Big Sur. At least until another method is discovered
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
234

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