Contribute
Register

AMD WX4170 dGPU on ZBook G5 17 Laptop

Joined
Jul 21, 2011
Messages
226
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
I've finally hit a wall after 100's of hours trying to make this work.

This machine is probably the best hack laptop I've ever made. Battery, Sleep, Keyboard shortcuts, power management, native nvram, speaker, microphone, headphones, usb, thunderbolt, touchpad w/5 finger gestures, external displays, wifi, LAN, SD Card, bluetooth, nvme and sata drives, and IGPU with apple firmware loaded, hdmi with audio, dvi, thunderbolt video, DRM, GVA, filevault.
Basically the works!

Here's the catch...
Under High Sierra and Mojave I have a dual GPU system, the dGPU (AMD WX-1470) works and I've tested (2x 4k external displays) and if I disable the IGPU with whatevergreen bootflag igfxgl=1, I can force the dGPU to handle all the metal and opengl stuff even on the internal display, and DRM works, h264 hardware acceleration encoding, while the igpu handles h265, etc... a Dream basically.

Now for Catalina (and Big Sur)
Something changed... The same Open Core configuration stalls just as the display switches to apple logo and the progress bar gets to about 70%, then nothing....
I can run the installer, and no problem.
I can boot Catalina and Big Sur with bootflag -radvesa and everything is great, all of the above minus the AMD dGPU work fine.
So something in the AMD drivers is not working, and it doesn't matter if I use Hybrid or Discrete mode, OSX 10.15+ just refuses to work with the dGPU.
(In discrete mode I get a black screen and nothing changes that. pikera, vit9696, radeon deinit, etc...) only -radvesa works, but obviously no acceleration.

Today while doing some tests, I saw a line in the boot log that may be relevant, as I've never seen this in Mojave, and it happened on a stalled boot from Catalina.
lilu.jpg

If Lilu can't patch AMDSupport, then nothing will work past that point...?

With the flag -radvesa using IORegistryExplorer I can see the GFX0 device and the AMD9500 Controller kext loaded, so the device is there and fine, but I guess the AMDRadeonX4000_AMDBaffinGraphicsAccelerator could be causing trouble?

I tried different fake id's, and ROM's on the AMD card, and one actually booted, but the display connectors and sense ID's were wrong so basically the OS/drivers did not load. As soon as I edited the connectors or injected an edited framebuffer with connectors that would work, then Catalina boot would Kernel Panic or stall again.

I also tried different SMBioses but that didn't change any of my previous results.

There's not a lot of documentation regarding how the AMD patching works with Whatevergreen and especially for dual GPU unicorns like this laptop.

My current workaround is to have 2 hard drives with 2 Open Core efi's, One for Mojave with dual GPU's and one with radvesa for Catalina and I switch them at boot. But I really want to have dGPU on Catalina.

I appreciate any expert help with this.

Thank you!
 
Last edited:
Joined
Jul 21, 2011
Messages
226
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
Ive also tried patching the AGDP kext directly and nothing.
Could it be something in the VBIOS ROM that is 32bit only?
The card should work, as I know this same model is being used in older imac's to make them work with newer OS's.
Or could it be T2 related?

@Gigamaxx @Pavo

Please any ideas?

Thanks!
 
Last edited:
Joined
Jul 21, 2011
Messages
226
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
After some tests, I flashed the "imac compatible" rom to my card and it managed to boot loading the AMD kexts, now the connectors are all wrong and so I had no way of testing if it was actually working, OpenGL test worked and It seemed to be doing something in Activity monitor, but I tried patching the outputs in the ROM and then I get the same stall as with my normal ROM, so... not sure it's the device-id being read directly from the ROM or something like that.
I managed to get a bunch of logs using this "bootable" ROM, and hoe someone can help me figure this out.

Screen Shot 2021-03-22 at 11.25.28 PM.png


Screen Shot 2021-03-22 at 11.25.15 PM.png


Screen Shot 2021-03-22 at 11.23.11 PM.png
Screen Shot 2021-03-22 at 11.24.08 PM.png


Screen Shot 2021-03-05 at 7.04.31 PM.png
Screen Shot 2021-03-05 at 7.04.58 PM.png
 

Attachments

  • Logs.zip
    5 MB · Views: 10
  • LOGS-CATA.txt
    125.3 KB · Views: 28
Joined
Jul 21, 2011
Messages
226
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
Update:

I've been testing with 3 different VROM's
-4170 from a ZBook G4 - Afflek
-4150 from a ZBook G3 - Vaughn
-4150 (modified for use in iMac) - Pegatron

The 4150 iMac is identical to a HP 4150 ROM on Techpowerup except for the connectors

Screen Shot 2021-04-22 at 1.29.54 PM.png


This iMac (GOP) rom will not post in discrete mode, but it will boot catalina in hybrid mode, except it has no display outputs working.
If I modify the connectors to match the outputs of my 4170 and "work", then I get KP on all versions of OSX.
So this rom is not compatible with my card configuration, it will do the math but won't work as a display adapter.

Screen Shot 2021-04-22 at 1.32.56 PM.png


Using either of the 4150 and 4170 ROMs from Zbooks (Vaughn or Afflek), I can make them work in High Sierra and Mojave, but both stall on Catalina / Big Sur Boot.

This makes me think the problem is not in the ROM or outputs but somewhere else in the Catalina Display chain.
I'll go back to trying different SMBios and may need to inject some other setting.
 
Last edited:
Joined
Mar 29, 2019
Messages
122
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
Wx4150 are almost working. But I lost working configs. As some features are working on one, other on second and so on...


So I will write about it here!

So first things first: to make all ports working, to make edp screen control brightness, to make edp connector to be hotplug on display lid action.


Framebuffer. Step 1
I tried to force load all framebuffers from amd9500controlker. Partially or fully functional was: baladi , salado, OPMFalcon.


Salado and OPMFalcon are the same in pin config. They have different in driver, my opinion. They appear in IOREGISTRY with their names. But the baladi appears with AMD, ATY FRAMEBUFFER. So I think that this one is OSX inject by the default. This framebuffer has mouse lag. And base on 4 DisplayPort and one LVDS. So lvds hotplug is completely may be useful for edp patch.


About code pins:my gpu is flashed by zbook g4 vbios with gop mod from oem hp mxm vbios. The decoder, hotplug and other info are the same with Salado, OPMFALCON framebuffers.


So why OSX reading vbios and switching to the Baladi framebuffer? I will try to patch it and will figure out.

Also planing to collect as match wx4150 vbioses to find workaround.


Framebuffers was patching by clover kext patch, with additional hexcode to prevent wrongdoing.
 
Joined
Mar 29, 2019
Messages
122
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
Sorry for rotations
 

Attachments

  • 1CF79C8C-5089-470A-BF7E-A54FEEEABD5E.jpeg
    1CF79C8C-5089-470A-BF7E-A54FEEEABD5E.jpeg
    3.6 MB · Views: 15
  • 5304E189-0239-4478-86D8-1A8EBB70619D.jpeg
    5304E189-0239-4478-86D8-1A8EBB70619D.jpeg
    2.2 MB · Views: 15
  • FA7669F9-88CB-4198-9C61-5669ED4F825D.jpeg
    FA7669F9-88CB-4198-9C61-5669ED4F825D.jpeg
    1.9 MB · Views: 16
Joined
Mar 29, 2019
Messages
122
Motherboard
H87M-PRO
CPU
i5-4690K
Graphics
HD4600 + GTX 660 TI
Mac
  1. iMac
  2. MacBook Pro
Tried Patch BALADI FRAMEBUFFER, NO SUCCESS


BALADI:

000400000403000000010300000000001204030300000000
000400000403000000010100000000001102010100000000 - EDP
000400000403000000010200000000002103020200000000 - VGA
000400000403000000010400000000002205040400000000
000400000403000000010500000000001000050500000000 - HDMI
000400000403000000010600000000002001060600000000 - DP

HEX SEARCH:
000400000403000000010300000000001204030300000000000400000403000000010100000000001102010100000000000400000403000000010200000000002103020200000000000400000403000000010400000000002205040400000000000400000403000000010500000000001000050500000000000400000403000000010600000000002001060600000000


MY PORTS:
20010101 - DP
10000202 - HDMI
21030303 - VGA
11020404 - EDP


=================MODDING==========

DISABLE NON USED osx txmit
000000000000000000000000000000000000000000000000
000400000403000000010100000000001102010100000000 - EDP
000400000403000000010200000000002103020200000000 - VGA
000000000000000000000000000000000000000000000000
000400000403000000010500000000001000050500000000 - HDMI
000400000403000000010600000000002001060600000000 - DP


eDP (14)
osx txmit = 11
enc = 02
HotPlugID = 04
senseid = 04


SET ENCODERS (THEY ARE THE SAME)
000000000000000000000000000000000000000000000000
000400000403000000010100000000001102010100000000 - EDP
000400000403000000010200000000002103020200000000 - VGA
000000000000000000000000000000000000000000000000
000400000403000000010500000000001000050500000000 - HDMI
000400000403000000010600000000002001060600000000 - DP


SET HOTPLUGS AND SENSE (NOT AS IN VBIOS)
000000000000000000000000000000000000000000000000
000400000403000000010100000000001102010100000000 - EDP
000400000403000000010200000000002103020200000000 - VGA
000000000000000000000000000000000000000000000000
000400000403000000010300000000001000030300000000 - HDMI
000400000403000000010400000000002001040400000000 - DP


SET RESOLUTION (HIGH AND NORMAL)
000000000000000000000000000000000000000000000000
000400000406000000010100000000001102010100000000 - EDP
000400000406000000010200000000002103020200000000 - VGA
000000000000000000000000000000000000000000000000
000400000403000000010300000000001000030300000000 - HDMI
000400000403000000010400000000002001040400000000 - DP


AND COPYING VBIOS SETUP

MY PORTS:
20010101 - DP
10000202 - HDMI
21030303 - VGA
11020404 - EDP

000000000000000000000000000000000000000000000000
000400000406000000010400000000001102040400000000 - EDP
000400000406000000010300000000002103030300000000 - VGA
000000000000000000000000000000000000000000000000
000400000403000000010200000000001000020200000000 - HDMI
000400000403000000010100000000002001010100000000 - DP


OKAY, CHANGE PRIORITY:
000400000403000000010100000000002001010100000000 - DP
000400000403000000010200000000001000020200000000 - HDMI
000400000406000000010300000000002103030300000000 - VGA
000400000406000000010400000000001102040400000000 - EDP
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000





==================TESTING?=====(CLOVER 4 PORTS AMD)===========

FIND:
000400000403000000010300000000001204030300000000000400000403000000010100000000001102010100000000000400000403000000010200000000002103020200000000000400000403000000010400000000002205040400000000000400000403000000010500000000001000050500000000000400000403000000010600000000002001060600000000




DISABLE NON USED osx txmit
000000000000000000000000000000000000000000000000000400000403000000010100000000001102010100000000000400000403000000010200000000002103020200000000000000000000000000000000000000000000000000000000000400000403000000010500000000001000050500000000000400000403000000010600000000002001060600000000

SET ENCODERS (THEY ARE THE SAME)
000000000000000000000000000000000000000000000000000400000403000000010100000000001102010100000000000400000403000000010200000000002103020200000000000000000000000000000000000000000000000000000000000400000403000000010500000000001000050500000000000400000403000000010600000000002001060600000000

SET HOTPLUGS AND SENSE (NOT AS IN VBIOS)
000000000000000000000000000000000000000000000000000400000403000000010100000000001102010100000000000400000403000000010200000000002103020200000000000000000000000000000000000000000000000000000000000400000403000000010300000000001000030300000000000400000403000000010400000000002001040400000000

SET RESOLUTION (HIGH AND NORMAL)
000000000000000000000000000000000000000000000000000400000406000000010100000000001102010100000000000400000406000000010200000000002103020200000000000000000000000000000000000000000000000000000000000400000403000000010300000000001000030300000000000400000403000000010400000000002001040400000000

AND COPYING VBIOS SETUP
000000000000000000000000000000000000000000000000000400000406000000010400000000001102040400000000000400000406000000010300000000002103030300000000000000000000000000000000000000000000000000000000000400000403000000010200000000001000020200000000000400000403000000010100000000002001010100000000

OKAY, CHANGE PRIORITY:
000400000403000000010100000000002001010100000000000400000403000000010200000000001000020200000000000400000406000000010300000000002103030300000000000400000406000000010400000000001102040400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000




==================TESTING?=====(CLOVER PLIST TEST PATCH)===========

ALL WE NEED IS REBOOT MANY TIMES AND TEST



<dict>
<key>Comment</key>
<string>DISABLE NON USED osx txmit</string>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>
AAQAAAQDAAAAAQMAAAAAABIEAwMAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAQAAAQDAAAAAQQAAAAAACIFBAQAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
<key>InfoPlistPatch</key>
<false/>
<key>Name</key>
<string>AMD9500Controller</string>
<key>Replace</key>
<data>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
</dict>
<dict>
<key>Comment</key>
<string>SET ENCODERS (THEY ARE THE SAME)</string>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>
AAQAAAQDAAAAAQMAAAAAABIEAwMAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAQAAAQDAAAAAQQAAAAAACIFBAQAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
<key>InfoPlistPatch</key>
<false/>
<key>Name</key>
<string>AMD9500Controller</string>
<key>Replace</key>
<data>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
</dict>
<dict>
<key>Comment</key>
<string>SET HOTPLUGS AND SENSE (NOT AS IN VBIOS)</string>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>
AAQAAAQDAAAAAQMAAAAAABIEAwMAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAQAAAQDAAAAAQQAAAAAACIFBAQAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
<key>InfoPlistPatch</key>
<false/>
<key>Name</key>
<string>AMD9500Controller</string>
<key>Replace</key>
<data>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQA
AAQDAAAAAQMAAAAAABAAAwMAAAAAAAQAAAQDAAAAAQQA
AAAAACABBAQAAAAA
</data>
</dict>
<dict>
<key>Comment</key>
<string>SET RESOLUTION (HIGH AND NORMAL)</string>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>
AAQAAAQDAAAAAQMAAAAAABIEAwMAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAQAAAQDAAAAAQQAAAAAACIFBAQAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
<key>InfoPlistPatch</key>
<false/>
<key>Name</key>
<string>AMD9500Controller</string>
<key>Replace</key>
<data>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQGAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQGAAAAAQIAAAAAACED
AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQA
AAQDAAAAAQMAAAAAABAAAwMAAAAAAAQAAAQDAAAAAQQA
AAAAACABBAQAAAAA
</data>
</dict>
<dict>
<key>Comment</key>
<string>AND COPYING VBIOS SETUP</string>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>
AAQAAAQDAAAAAQMAAAAAABIEAwMAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAQAAAQDAAAAAQQAAAAAACIFBAQAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
<key>InfoPlistPatch</key>
<false/>
<key>Name</key>
<string>AMD9500Controller</string>
<key>Replace</key>
<data>
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQGAAAA
AQQAAAAAABECBAQAAAAAAAQAAAQGAAAAAQMAAAAAACED
AwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQA
AAQDAAAAAQIAAAAAABAAAgIAAAAAAAQAAAQDAAAAAQEA
AAAAACABAQEAAAAA
</data>
</dict>
<dict>
<key>Comment</key>
<string>OKAY, CHANGE PRIORITY:</string>
<key>Disabled</key>
<true/>
<key>Find</key>
<data>
AAQAAAQDAAAAAQMAAAAAABIEAwMAAAAAAAQAAAQDAAAA
AQEAAAAAABECAQEAAAAAAAQAAAQDAAAAAQIAAAAAACED
AgIAAAAAAAQAAAQDAAAAAQQAAAAAACIFBAQAAAAAAAQA
AAQDAAAAAQUAAAAAABAABQUAAAAAAAQAAAQDAAAAAQYA
AAAAACABBgYAAAAA
</data>
<key>InfoPlistPatch</key>
<false/>
<key>Name</key>
<string>AMD9500Controller</string>
<key>Replace</key>
<data>
AAQAAAQDAAAAAQEAAAAAACABAQEAAAAAAAQAAAQDAAAA
AQIAAAAAABAAAgIAAAAAAAQAAAQGAAAAAQMAAAAAACED
AwMAAAAAAAQAAAQGAAAAAQQAAAAAABECBAQAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAA
</data>
</dict>
 
Joined
Jul 21, 2011
Messages
226
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
Try using Whatevergreen debug version and use flag -wegdbg to find out how the OS is recognizing your connectors, then you can insert a framebuffer if whatevergreen's version doesn't work, and use that info to patch.

For example this is what I did for Palena FB.
Screen Shot 2021-04-23 at 2.26.11 PM.png


The con @ DBG info is the debug info from Whatevergreen, and the last line is the patch I inserted on my config.
It worked but as I explained in another thread, the problem with Palena is stability, after wake from sleep, I could get a screen freeze, and using the default, but only injecting the Palena parameters, I get 100% stability.

Edit: I kept the Palena connector 1 flags as they seem to be related to HDCP on the internal screen.

Also you may need Whatevergreen for other DRM and AGDP patches, so in my experience there's no real need to manually inject a FB.

You can also force Connector Info on Whatevergeen's FB using an SSDT
 
Last edited:
Joined
Jul 21, 2011
Messages
226
Motherboard
Zbook G5 17"
CPU
i7
Graphics
AMD WX-4170
Mac
  1. MacBook Pro
  2. Mac mini
  3. Mac Pro
I compiled the info,
The top is the Palena FB as they live in AMD9500Controller.kext

The middle is Whatevergreens Debug output

The bottom is my patches based on this info.

More Info is in this post:

 
Top