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

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
I am not sure using GenericUSBXHCI.kext is the best solution for your USB ports. It was suspect and a bit of a fudge when it was used on Intel systems with Yosemite and older. It was dropped (for a good reason) when the USB changes were implemented by Apple with the release of El Capitan.

The laptop uses XHC0 and XHC1 USB controllers. The later may clash with the Apple USB controller. Both might be better served with a ACPI rename patch to change them to names that won't clash with the Apple USB controllers.
  1. Using the Windows USBToolBox script to map the USB ports would be one solution.
  2. The alternative is to install an early version of Big Sur, 11.0.1 or Similar, where the XHCIPortLimit quirk works and map the USB ports in macOS.
  3. The Big Sur options is I think a better option of the two but probably means more work, downloading and installing an early version of Big Sur.
  4. Once someone has created a standard USBMap.kext or whatever, the kext should be capable of setting the USB ports for any identical laptop systems.

Doesn't the RX 6600M dGPU require the agdpmod=pikera boot arg? It is not shown as being used/present in the screen image in post #381.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I have had a look at your IOReg and would comment as follows:
  1. Can I ask why you are using a SMBIOS for a MacPro7,1 and not the SMBIOS for a MacBookPro16,4?
  2. Are you not using WhateverGreen.kext because it doesn't match with the ACPI path for the dGPU?
    1. The ACPI path for the RX 6600m is not normal, as it uses the name VGA, not PEGP, GFX0 which we would normally expect.
    2. IOACPIPlane:/_SB/PCI0@0/GPP0@10001/SWUS@0/SWDS@0/VGA@0 this translates to ( /_SB/PCI0/GPP0/SWUS/SWDS/VGA).
    3. Having a three character name is not normal, VGA0 would be more understandable, as every other part is 4 characters.
    4. Maybe adding an ACPI rename patch - change VGA_ to GFX0 - in to the config.plist would help the system match with WhateverGreen.kext?
  3. The CPU is showing the first thread connected to PR00, using AMDRyzenCPUPowerManagement kext attached, along with SMCAMDProcessor.kext.
  4. The next 15 threads all show the IOCPUState as uninitialised, whereas the first thread says it is running. Is this solely due to the cpus=1 boot argument?
  5. What is different in the IOReg when you are running Big Sur on this system, without the cpus=1 boot arg?
1. Middleman Suggested using MacBookPro Symbios as well, however, I was under the impression since it is a Ryzen CPU that it needed the MacPro one. (I did try it per Middlemans suggestions and it would hang at the nvme controller driver. (It was one of my previous posts)

2. Whenever I tried enabling whatevergreen, it would just boot to blank screen in Monterey. Even with AGDPMOD=PIKERA. (I will try to the rename patch once I get the symbios issue corrected)

3. I don't know what you are suggesting here, are you saying I should disable the AMDRyzenCPUPowerManagement Kext?

5. That is a good question, I would need to reinstall big sur to see. I do have a second SSD installed, is a IOReg equivalent available for windows that would be of any help?
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I am not sure using GenericUSBXHCI.kext is the best solution for your USB ports. It was suspect and a bit of a fudge when it was used on Intel systems with Yosemite and older. It was dropped (for a good reason) when the USB changes were implemented by Apple with the release of El Capitan.

The laptop uses XHC0 and XHC1 USB controllers. The later may clash with the Apple USB controller. Both might be better served with a ACPI rename patch to change them to names that won't clash with the Apple USB controllers.
  1. Using the Windows USBToolBox script to map the USB ports would be one solution.
  2. The alternative is to install an early version of Big Sur, 11.0.1 or Similar, where the XHCIPortLimit quirk works and map the USB ports in macOS.
  3. The Big Sur options is I think a better option of the two but probably means more work, downloading and installing an early version of Big Sur.
  4. Once someone has created a standard USBMap.kext or whatever, the kext should be capable of setting the USB ports for any identical laptop systems.

Doesn't the RX 6600M dGPU require the agdpmod=pikera boot arg? It is not shown as being used/present in the screen image in post #381.
I did a USBToolbox map from Windows 11, which it should be in the efi I posted, it seems not to work with the genericUSBXHCI.kext and no other kext that we have tried, (we as in what myself, middleman and a few others suggested)

What would be the best option? I can reinstall an earlier version of big sur and map ports from there?

On the RX 6600M, it boots up without the Pikera arg. with it, I cannot remember if it booted. But it is working wthout it, acceleration and all.
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
Installing an early version of macOS Big Sur would be the best option. As you can use Hackintool & your IOReg to map the ports. You can also use the XhciPortLimit quirk in OpenCore.

I wouldn't worry about the agdpmod=pikera boot arg, if it works without it. However, if you rename the VGA controller to GFX0, then you may need to include it. Actually as it works this may be a red herring, and not need changing. But you will only know when you have tried using the rename patch.

This is what the Rename patch should look like:

Screenshot 2022-06-22 at 21.33.05.png VGA_ to GFX0 rename patch, as shown in ProperTree plist editor.

The SMBIOS is definitely strange. I think using a MBP SMBIOS would be best. The MacBookPro16,4 uses an 8-core 16-thread CPU, so should be a reasonable match.

No, I am not suggesting your remove the AMDRyzenCPUPowerManagement kext. That was just me making an observation that the first CPU thread was using the correct inputs.
 

Edhawk

Guru
Guru
Joined
May 2, 2020
Messages
2,249
Can you post a copy of your current EFI, so I can see exactly what you are using.
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
Can you post a copy of your current EFI, so I can see exactly what you are using.
Yes, this is the EFI I am currently using.... I also included the EFI we used to install big sur. (I did not do the port mappings with it, but I will try the suggestions that you suggested. Do you think I should change the symbios to the MBP 16,4 when I reinstall Big Sur?
 

Attachments

  • EFI.zip
    23.6 MB · Views: 14
  • Big Sur.zip
    29.8 MB · Views: 16

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
1. Middleman Suggested using MacBookPro Symbios as well, however, I was under the impression since it is a Ryzen CPU that it needed the MacPro one. (I did try it per Middlemans suggestions and it would hang at the nvme controller driver. (It was one of my previous posts)

Yes MacbookPro would be good to test as @Edhawk has suggested. But did you ever test it with iMacPro1,1? Try it with the new SSDT-CPUR because I think it will solve your issue.

As to your NVME issue, see if NVMEFix.kext or NVMexpressDXE.efi installed under EFI/OC/Drivers would solve your boot problem.
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
230
I also use this laptop. I read all content you had sent. So, the premise is my laptop must use Radeon Gpu if I want to install Hackintosh?
My Laptop use 3050TI, if there have some solution I can use ? Or maybe I should give up to try to install Hackintosh
If you have Nvidia, you may have thunderbolt, you could attach an external GPU and try use an amd card to boot Mac OS (maybe). If not, you will be stuck with no graphics acceleration.
 

Shaneee

The AMD Guy
Staff member
Administrator
Joined
Mar 13, 2020
Messages
2,142
@lev12354 Can you share the EFI that you booted Big Sur using the patches I uploaded without cpus=1 for @OG Nerd to test please. There must be a different settings somewhere between the configs that allowed yours to boot.
 

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
@lev12354 Can you share the EFI that you booted Big Sur using the patches I uploaded without cpus=1 for @OG Nerd to test please. There must be a different settings somewhere between the configs that allowed yours to boot.
@Shaneee I can confirm it was the updated SSDT-CPUR I gave @lev12345 that booted his Big Sur. The one I gave him was set for 6 cores by mistake (I forgot he has a 5800H). I since gave him a corrected one set for 8 cores. It is these two files.
 

Attachments

  • SSDT-CPUR-6cores.aml.zip
    836 bytes · Views: 3
  • SSDT-CPUR.aml.zip
    813 bytes · Views: 4

lyx

New member
AMD OS X Member
Joined
Jun 21, 2022
Messages
10
If you have Nvidia, you may have thunderbolt, you could attach an external GPU and try use an amd card to boot Mac OS (maybe). If not, you will be stuck with no graphics acceleration.
This might be a good idea, but as I know, Legion laptop haven't any thunderbolt interface......
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
I won’t be back in front of the laptop until Friday, we are moving furniture around at home and laptop is at work so will try efi and suggested fixes friday
 

OG Nerd

Knows Enough To Get In Trouble
Donator
AMD OS X Member
Joined
Dec 7, 2021
Messages
284
This might be a good idea, but as I know, Legion laptop haven't any thunderbolt interface......
Yeah, the usb c is usb 3.2 gen 2
 

Jo-Toku

Donator
Donator
AMD OS X Member
Joined
Dec 29, 2021
Messages
230
I have been stuck working on a TV show and had no time to do anything. Maybe next week i'll have some free time to play with the Legion
 

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
@lyx,

Just don’t forget to replace the PlatformInfo UUID, ROM and serials on the config.plist to newly generated ones using GenSMBIOS and SSDTPRgen because those belong to lev12345’s system.
 

lev12354

Member
AMD OS X Member
Joined
Jun 14, 2021
Messages
62
@lev12354 Can you share the EFI that you booted Big Sur using the patches I uploaded without cpus=1 for @OG Nerd to test please. There must be a different settings somewhere between the configs that allowed yours to boot.
@Middleman I understand correctly that the graphics cannot be started, and therefore at this moment we are finishing setting up my laptop?
 

Attachments

  • EFI.zip
    23.3 MB · Views: 5

Middleman

Active member
AMD OS X Member
Joined
Jan 29, 2021
Messages
723
@Middleman I understand correctly that the graphics cannot be started, and therefore at this moment we are finishing setting up my laptop?
Yes for now unfortunately. If you can boot up with 8 cores, that is as good as it gets.
 

lev12354

Member
AMD OS X Member
Joined
Jun 14, 2021
Messages
62
Yes for now unfortunately. If you can boot up with 8 cores, that is as good as it gets.
It's sad, but I'll wait for your suggestions, but for now, I'll still read and search on the Internet, maybe I'll find what I need to properly start the laptop in Mac OS. Thank you for your hard work! See you soon
 
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.