Closed peteha closed 4 years ago
The issue happens in GPUInfo
framework (/System/Library/PrivateFrameworks/GPUInfo.framework/Versions/A/GPUInfo
). get_gpu_EFIATYROM(__GPUWranglerGPU*, __CFDictionary*)
function (__Z17get_gpu_EFIATYROMP16__GPUWranglerGPUP14__CFDictionary
) is accessing ATY,Rom#
property, which seems to be present but of different type. Basically the code looks as follows:
CFDataRef theData = (CFDataRef)GPUWranglerGPUCopyProperty(a1, 0LL, "ATY,Rom#");
if (theData != NULL) {
/* other code */
const char *str = (const char *)CFDataGetBytePtr(theData);
size_t strLen = strlen(str); ///< crash here, str is 0x7c8
/* other code */
}
The problem is that ATY,Rom#
has CFStringRef type, and thus CFDataGetBytePtr
returns some trash (0x7c8
), which therefore crashes the whole thing.
The reason ATY,Rom#
is set as data is because AMDRadeonX6000Framebuffer.kext
in AMDRadeonX6000_AmdRadeonController::reportControllerProperties()
function (__ZN34AMDRadeonX6000_AmdRadeonController26reportControllerPropertiesEv
) actually sets it as a string when not present:
if (fProvider->getProperty_1("ATY,Rom#") == NULL) {
const char *romName = vbiosHandler->getRomName();
if (romName == NULL)
romName = "NOT-DETECTED-???";
/* virtual bool setProperty(const char * aKey, const char * aString); */
fProvider->setProperty("ATY,Rom#", romName);
}
The string will not be present when a GPU without Apple EFI ROM is used and thus this code will be in use. Filed FB7694132.
As a temporary measure add the following kernel patch in OpenCore:
Find: 41 54 59 2C 52 6F 6D 23 00
Replace: 41 4D 44 2C 52 6F 6D 23 00
Identifier: com.apple.kext.AMDRadeonX6000Framebuffer
Count: 1
I'm very new to this so sorry for a stupid question, but using ProperTree does this patch need to be written as data? What should I put for Mask and ReplaceMask?
@peteha Were you successful in applying this patch? If so ... can you just paste that patch from config.plist maybe? Thank you!
I tried applying this patch:
But it didn't help me. Getting the same Thread 0 Crashed
at get_gpu_EFIATYROM(__GPUWranglerGPU*, __CFDictionary*) + 665
-> _platform_strlen + 18
@vit9696 sorry for @'ing you, but maybe you can help? :)
Try injecting ATY,Rom#
via DeviceProperties with any value in this case.
@vit9696 thanks a LOT! This has worked :)
Hey guys I'm having the same issue with my 5700XT. @yurique how did you get the correct PciRoot(....
for your GPU? Am not sure how to get this value from Windows. Is this the right spot to be looking or am I totally off? Thanks!
Yes, that's the thing, just slightly awkwardly named, there are no commas between bytes in PCI, the separator is # instead of /, and the case is wrong. Windows always does things its own way I guess. It seems you have the following path:
PciRoot(0x0)/Pci(0x3,0x1)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0)
I am not quite sure it points to the right device (e.g. the last Pci may be extra), and whether the byte order is correct in the second node (could be Pci(0x1,0x3) instead).
It is much easier to boot to macOS recovery and just run gfxutil to be honest.
@rutgerfarry I used the OpenCore Configurator
for this.
It automatically added some properties, but put some weird character into the model
value - OpenCore booted just fine, but ProperTree was not happy about it (I removed the symbol in text editor).
Thanks @vit9696 and @yurique! I'd been trying so many different fixes, but this is the one that actually ended up working. Would love to further understand what is happening here and perhaps add it to the Opencore Desktop Guide to help others having this issue... or would a fix like this be added to Whatevergreen in the future?
@yurique or @rutgerfarry how did you get the AAPL, slot name value? I don't have a working hackintosh to run OpenCore Configurator on it :/
@blazvizjak I used OpenCore configurator, and it populated those three properties automatically when I selected the graphics card from the list of devices (AAPL,slot_name
, device_type
and model
). I only added ATY,Rom#
manually.
OK since I can't runt OpenCore configurator on hackintosh machine I've booted to macOS recovery and ran gfxutil and copied value for GFX0 which was: PciRoot(0x0)/Pci(0x3,0x1)/Pci(0x0,0x0)/Pci(0x0,0x0)/Pci(0x0,0x0) and "deducted" AAPL,slot-name to be: Internal@0,3,1/0,0/0,0/0 which seemed to do the trick.
Sorry for posting on a closed thread but I am just ordering the pieces for my Hackintosh and currently the MSI AMD Radeon RX 5700 XT Mech might be the only card small enough to fit in the itx case I have selected.
So, I basically wonder:
Thanks for any input, still learning here and trying to get the specs right 😄
@johanlantz from what I understand:
AMDRadeonX6000Framebuffer.kext
(I saw in OpenCore logs that kext patching failed while booting installer), but when you boot system from hard drive it does load and patch;
3.2 installer will crash in the end if you don't inject ATY,Rom#
.To be honest I use config with both kext patch and injecting ATY,Rom#
and everything works fine
@mateossh Thank you so much for the answer. My parts are on the way and I had to select the exact same card as you have due to space reasons in the case.
I am just beginning to learn about opencore so this will be my first Hackintosh project.
So, I take it that with the fixes described here you got your installation working.
Do you mind if I ask you about your impressions of the MSI XT 5700 Mech otherwise in macOS? Does it work as you expected?
Stuck on the same issue here (very first ryzentosh with MSI RX 5700 MECH). Btw can anyone help me on how can I found [ ATY,Rom# ] on windows platform?
This is not a support forum! Locked.
Z390 - ASUS-Z390F i9 9900k 5700XT OC 0.5.8 Latest - Lilu 1.4.4 and Whatevergreen - 1.3.9
When clean install using 5700XT installer fails with crash. Installer Log 6-May-2020.txt
Removed pikera mod and used RX580 worked perfectly.
After install switched out RX580 to 5700XT and re-added pikera. Runs fine.