AMD-OSX / bugtracker

AMD OS X Bugtracker
13 stars 2 forks source link

Enabling Mobile Ryzen's Vega iGPUs on macOS #114

Closed RGarrido03 closed 1 year ago

RGarrido03 commented 3 years ago

Hi AMD-OSX team!

I'm here in the name of a 238-member Telegram community trying to enable Vega iGPU (present in AMD Ryzen laptop processors) support in macOS.

The problem Currently, only AMD dedicated GPUs are able to work properly on macOS due to the existence of Apple KEXTs for AMD graphics. As of Vega iGPUs, even though a lot of the code present in the Linux driver is shared with the dGPU Linux drivers, macOS doesn't recognize them so we can only work with VESA mode (thus no hardware acceleration).

Tentative #1 Spoofing the AMD iGPU into an Intel one gives us framebuffers.

Tentative #2 Using grep, we can find matches for raven on AMDRadeonX5000HWLibs kexts. So we decompiled them and found that a lot of initialisation is already done for the bare minimum GPU support so in theory it would work by loading the X5000 series kexts. But no. On spoofing the iGPU to a supported AMD dGPU, we never got past the verbose mode. The kexts don't panic though so they might be working (still unsure about this). With more kext logging enabled we discovered that the kexts load fine but somewhere between these loads they actually unload due to some error in userspace (still unsure about this). On force loading the kext, it bails out because of no firmware. Our take on this is that the kext is loading without a specific call or without a supported vendor ID.

Additional info

To Reproduce N/A

Expected behavior N/A

Screenshots N/A

System Version All macOS versions.

System Information Any Mobile Ryzen processor with an iGPU like Vega 8.

Is there any way you could help us?

Thank you! Rúben Garrido

MiddlemanTM commented 3 years ago

Hi RGarrido03,

I've been notified and am aware of the work you guys are doing for the AMD APU. Congrats on the work done so far, it almost seems so close!

Anyways I thought you might be interested in this if you haven't already seen it: https://www.techpowerup.com/forums/threads/amd-navi-gpu-code-surfaces-in-latest-apple-macos-mojave-beta.251733/ It's the device-id for Navi 12, basically the Vega 8 id found in Mojave beta. If you are looking to spoof a GPU for the Vega 8 this id is likely to be it. But you must use a combo of SMBIOS MacBookPro15,3 or thereabouts.

Related to this, you may have read from the Vega 8 thread, I'd already activated and had my AMD's Polaris graphics engine detected in GLView on my HP Core i7 Kaby Lake AMD Vega laptop by way of loading a SSDT-R7M460 and an AGPMInjector kext using Pavo's AGPMInjector app using MacBookPro14,3 SMBIOS and RX 460 setting (the MBP SMBIOS manually injected into the Info.plist of the kext). This combo of spoofing a target AMD GPU has worked not just for my HP AMD dGPU laptop, but also a Z170 build I have with a spoofed RX550 card. On a B550 Vision D Ryzen 5900X build I have also spoofed the dGPU to working with both a RX6800 and RX550 card, and the combination came up with 'AMD Radeon Unknown Prototype Engine':

Screen Shot 2021-06-29 at 6 19 18 PM

I thought to mention this development to you (even though you are focused on activating the APU only), because I'd noticed of late, whenever an AMD GPU is combined with an Intel IGPU, a totally new Intel IGPU device appears in the PCI listing. Often it is an Iris Pro or Iris Graphics 550.

So onto your issue, though I'm not a total expert on this I have a few theories as on how to activate the Vega 8. First we may have to resort to Clover because Opencore doesn't seem to boot the AMD IGPU or DGPU using Whatevergreen (because WEG seems to be geared towards Intel IGPU activation). Also because Clover allows individual SSDTs for the IGPU & PEGP activation/renaming, unlike Opencore which is now effectively tied to Whatevergreen's functions, which I have found crucial to making acceleration work. We may likely need to use the SSDT-GPU-Spoof and spoof the Navi 12 value found above link into the file maybe with a modded AGPMInjector kext as well. We will also somehow need to disable the expected Intel IGPU at the bootloader stage. In the past I'd used the GFX0 to IGPU and PEGP to GFX0 SSDTs in Clover to enable the AMD dGPU activation on my laptop. We may be able to swap the AMD APU into recognising itself as a dGPU in order to activate and achieve acceleration.

MiddlemanTM commented 3 years ago

Also if you haven’t done so already, I’d suggest if you are able to boot into the system try running Pavo’s AMDFramebuffer dump script and see what you yield from the AMD GPU’s connectors > https://www.tonymacx86.com/threads/guide-how-to-patch-amd-framebuffers-for-high-sierra-using-clover.235409/

tran4774 commented 3 years ago

Hi. Could you guide me how to do that with my laptop Ryzen (Acer Nitro 5 AN515-43)?

MiddlemanTM commented 3 years ago

Hi. Could you guide me how to do that with my laptop Ryzen (Acer Nitro 5 AN515-43)?

You could try following my guide here for the Atari VCS - which should technically work > https://www.tonymacx86.com/threads/guide-atari-vcs-2020-console.309903/

MiddlemanTM commented 3 years ago

Hi all,

I just thought to notify you, some excellent progress has been made by edwardgeo and theroadw over at Tonymac for those with dual GPU laptops.

theroadw has managed to find the controls on his HP Zbook G5 17 laptop with a AMD WX4170, and switch the dGPU cards on at will, with full dGPU acceleration, working sleep/wake and Intel Quicksync!

Screen Shot 2021-10-08 at 7 13 06 PM Screen Shot 2021-10-09 at 3 35 14 PM

https://www.tonymacx86.com/threads/hp-zbook-g5-17.266012/page-20

He says it is to do with the MUX controls. He has his laptop dGPU flashed with edwardgeo's method of using atiflash to flash the GPU BIOS.