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

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
like in Big Sur. only mice and similar devices work, but the system refuses to read any usb disks
Same here, in big sur, no graphics support, but all CPUS work and USB, but once in Monterey only will boot with CPUS=1 flag and no usb port is working.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
The realtek is the correct kext, it works on my efi.

Here is my ioreg dump...
Hi OG Nerd,

So I checked the file and i looks like there's something wrong. I can't seem to open it with IOReg. Could you please export it again but as is without any extensions whatsoever? As I think it is affecting how it is read, thanks.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Okay, so working with @lev12345's IOReg in the meantime I came across this:

Screen Shot 2022-06-21 at 6.29.08 AM.png

The one on the left is lev12345's and the right is from my B550 Vision D. This line is showing the XHC allocation. You'll notice on the right there's a key called driver-child-bundle and it directly refers to Apple's USBCHXCIPCI driver. It's not present in the left one.

Screen Shot 2022-06-21 at 6.29.47 AM.png

More comparisons - here GenericUSBXHCI is doing the allocation. On mine I don't have this since I don't use it.


Screen Shot 2022-06-21 at 6.30.53 AM.png

On lev12345's here under GPP0 nothing has been allocated - but has on my one. However it has somehow gone to GP18 on his.

As to the USB drives not working, I am thinking you may need something like CtlnaAHCIPort.kext added in your kernel.

I am still checking out the files so will let you know if I find anything more about the cpus setting.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
I have more findings. Check these out:

Screen Shot 2022-06-21 at 6.49.52 AM.png

Here we are looking at the AppleACPICPU and to check if each core has been recognised by the system. Notice the one key that says IOCPUState shows uninitialized. That doesn't show up on mine.

Screen Shot 2022-06-21 at 6.50.14 AM.png

Then we have AMDRyzenCPUPowerManagement. Here the UserClient is showing on mine but not on yours.

Screen Shot 2022-06-21 at 6.51.39 AM.png

Next there's AppleEFIRuntime. Here everything is the same except on my one is shows IOMatchedAtBoot is True.

Perhaps the issue is related to an SMBIOS setting? I am after all using iMac20,1 on my one and my build has CustomSMBIOSGuid turned off.

One thing I also noticed between the systems is that the AMD Ryzen's use the i386 kernel and Intel based ones have the x86_64 kernel.

Aside from that, I also noticed that under my Device Property tree, I have quite a few devices added.

About the XHCI-unsupported addition, sorry that was an error (from another EFI I mistakenly read).
 
Last edited:

OG Nerd

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

So I checked the file and i looks like there's something wrong. I can't seem to open it with IOReg. Could you please export it again but as is without any extensions whatsoever? As I think it is affecting how it is read, thanks.
So, just the bare min. Extensions enabled in config.plastic Or is there a setting in ioreg to dissble Kexts? Also, maybe I am doing the ioreg dump incorrectly, can you please confirm the proper way to do a dump?
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
So, just the bare min. Extensions enabled in config.plastic Or is there a setting in ioreg to dissble Kexts? Also, maybe I am doing the ioreg dump incorrectly, can you please confirm the proper way to do a dump?
Well all you have to do is with your system IOReg open just go to File > Save a Copy As and then save the file onto desktop. It should not have anything on the end ie. TXT nor have any icons attached (should just show a blank page as icon)
 

lev12354

Member
AMD OS X Member
Joined
Jun 14, 2021
Messages
62
I have more findings. Check these out:

View attachment 6231

Here we are looking at the AppleACPICPU and to check if each core has been recognised by the system. Notice the one key that says IOCPUState shows uninitialized. That doesn't show up on mine.

View attachment 6232

Then we have AMDRyzenCPUPowerManagement. Here the UserClient is showing on mine but not on yours.

View attachment 6233

Next there's AppleEFIRuntime. Here everything is the same except on my one is shows IOMatchedAtBoot is True.

Perhaps the issue is related to an SMBIOS setting? I am after all using iMac20,1 on my one and my build has CustomSMBIOSGuid turned off.

One thing I also noticed between the systems is that the AMD Ryzen's use the i386 kernel and Intel based ones have the x86_64 kernel.

Aside from that, I also noticed that under my Device Property tree, I have quite a few devices added.

About the XHCI-unsupported addition, sorry that was an error (from another EFI I mistakenly read).
I understand correctly that in addition to graphics, the processor itself is also wound up incorrectly?
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
I understand correctly that in addition to graphics, the processor itself is also wound up incorrectly?
Yes, from what I've gathered so far. There's something in the new 5800H chip which has somehow been preventing the chips from being utilised properly (compared to the 5800X/5900X chips in say the B550 motherboard setup). The machines so far have to boot with cpus=1 on, but is not needed for 5800X/5900X setups. We are currently working out why that is.

That said, one thing I've been meaning to ask you all is - could you try to boot the system without SSDT-CPUR and SMCAMDProcessor enabled? I ask because another system I looked at the other day DIDN'T require them both and yet somehow initiated a 5950X that was in the system (I think it was a X470 chipset).
 

lev12354

Member
AMD OS X Member
Joined
Jun 14, 2021
Messages
62
Yes, from what I've gathered so far. There's something in the new 5800H chip which has somehow been preventing the chips from being utilised properly (compared to the 5800X/5900X chips in say the B550 motherboard setup). The machines so far have to boot with cpus=1 on, but is not needed for 5800X/5900X setups. We are currently working out why that is.

That said, one thing I've been meaning to ask you all is - could you try to boot the system without SSDT-CPUR and SMCAMDProcessor enabled? I ask because another system I looked at the other day DIDN'T require them both and yet somehow initiated a 5950X that was in the system (I think it was a X470 chipset).
Loading stops at given value
 

Attachments

  • IMG_20220621_175434.jpg
    IMG_20220621_175434.jpg
    2.9 MB · Views: 15

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Loading stops at given value
Okay in that case try to also disable cpus=1 in the boot-arg as well as RadeonSensor.kext. I think it's dependent on one of the AMD kexts which is why that pops up.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
Right. I think I know what the problem is now...

Try this. Put everything back - enable cpus=1, enable SMCAMDProcessor, RadeonSensor and SSDT-CPUR.aml.
But replace your SSDT-CPUR in the ACPI folder with this file here and see if it works (unzip it first). It may
work without cpus=1
 

Attachments

  • SSDT-CPUR.aml.zip
    892 bytes · Views: 2

lev12354

Member
AMD OS X Member
Joined
Jun 14, 2021
Messages
62
Right. I think I know what the problem is now...

Try this. Put everything back - enable cpus=1, enable SMCAMDProcessor, RadeonSensor and SSDT-CPUR.aml.
But replace your SSDT-CPUR in the ACPI folder with this file here and see if it works (unzip it first). It may
work without cpus=1
It loads into the system installer without cpus=1, but does not want to into the previously installed system. Panic photo on system boot without cpus=1.
 

Attachments

  • IMG_20220621_205945.jpg
    IMG_20220621_205945.jpg
    3.7 MB · Views: 11

lev12354

Member
AMD OS X Member
Joined
Jun 14, 2021
Messages
62
It loads into the system installer without cpus=1, but does not want to into the previously installed system. Panic photo on system boot without cpus=1.
it is also strange that without the cpus=1 argument, it loads big sur into the installer, but not into the monterey installer
 

lev12354

Member
AMD OS X Member
Joined
Jun 14, 2021
Messages
62
Right. I think I know what the problem is now...

Try this. Put everything back - enable cpus=1, enable SMCAMDProcessor, RadeonSensor and SSDT-CPUR.aml.
But replace your SSDT-CPUR in the ACPI folder with this file here and see if it works (unzip it first). It may
work without cpus=1
with argument cpus=1 loads into the system
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
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.