Just reading through this, what I'm getting out of it sounds like Safe Mode still loads OpenGL natively without Metal even being used, so what would be the flaws of making it so Safe Mode would HAVE to be loaded for debugging purposes on non-native machines? I honestly don't know if what I just said is a complete joke since I'm new in the MacWorld, as I had just acquired and upgraded an old MacBook Pro 2010 and hate to see supported dropped just so suddenly.
You can absolutely do that on any mac, just like setting verbose mode permanent. Just run in terminal:
$ sudo nvram boot-args="-x"
Now, I think the best way to force the OpenGL drivers to load in safe mode (because we haven't yet patched the safe mode OpenGL check out of WindowServer) is the following:
1) Copy all the kexts from High Sierra. If unsure which ones, just ask on this thread, and one of the "specialists" (I guess we'll call them that) will tell you which kexts/bundles/plugins to copy, including myself. This step includes setting the proper file permissions (ownership: root:wheel, mode: 755) + rebuilding PrelinkedKernel to include the new kexts.
2) Boot in safe mode, but ALSO in SINGLE-USER mode. So, sudo nvram boot-args="-x -s"
3) Once you arrive at a SHELL in the text-only boot, kextload the Framebuffer kext FIRST, and then the MAIN/controller kext (not the framebuffer OR accelerator)
Some examples of their filenames:
Sandy Bridge, HD 3000: AppleIntelSNBGraphicsFB.kext (framebuffer), then AppleIntelHD3000Graphics.kext (controller/main kext)
*** Nvidia Tesla Architecture: Geforce.kext/GeforceTesla.kext (basic setup, not either framebuffer or the rest, load both just in case) then NVDAResman.kext/NVDAResmanWeb.kext (framebuffer?) then NVDANV50HalTesla.kext/NVDANV50HalTeslaWeb.kext (if using the web drivers from high sierra + patched out macOS version check:
https://github.com/Benjamin-Dobell/nvidia-update, if we get a web driver update for mojave current guesses include Fermi and up, so not including tesla) I think that the kext is actually called NVDANV50HalTesla.kext since Mavericks.
*** Nvidia Fermi: Geforce.kext, then NVDAResman.kext, then NVDAGF100HalWeb.kext (NOT NATIVE, MUST USE WEB DRIVERS FROM HIGH SIERRA + patched out macOS version check)
***= SEE BOTTOM of this post, help needed + explanation
AMD Evergreen/Terascale 2 (5xxx): AMDLegacySupport.kext (support kext for the next one), then AMDLegacyFramebuffer.kext (framebuffer) then AMD5000Controller.kext (controller kext)
Also load after all those, AMDRadeonX3000.kext, just in case.
5000Controller I believe to control the hardware interaction directly, and that AMDRadeonX3000.kext calls it from the software acceleration. It seems like Apple split the hardware controller and the software controller here, but go figure. Load it anyway just to be safe.
As you can see, the pattern is that it is not the framebuffer kext or accelerator bundle. It is the "controller" or "manager" of the capabilities of the card. The Framebuffer kext (i.e AppleIntelSNBGraphicsFB.kext=HD 3000) is responsible for setting up correct resolution + "CoreImage" I believe, and the Accelerator kexts (i.e AppleIntelHD3000GraphicsGLDriver.bundle, AppleIntelHD3000GraphicsVADriver.bundle=HD3000) are responsible for the individual capabilities of the hardware. The "controller" kext handles all other dependencies, and depends on the Framebuffer kext being loaded. So, the tree of GPU drivers is as follows, for my three examples, each file loading the next one in the chain, or at least allocating it into memory for the GLDriver/VADriver so it can be used by WindowServer):
HD 3000: AppleIntelSNBGraphicsFB.kext --> AppleIntelHD3000Graphics.kext --> AppleIntelHD3000GraphicsGLDriver.bundle/AppleIntelHD3000GraphicsVADriver.bundle
AMD Evergreen/Terascale 2/HD 5xxx: AMDLegacyFramebuffer.kext + AMDLegacySupport.kext* --> AMD5000Controller.kext --> AMDRadeonX3000.kext --> AMDRadeonX3000GLDriver.bundle/AMDRadeonX3000VADriver.bundle
NVDA Tesla: Geforce.kext??/GeforceTesla.kext?? --> NVDAResman.kext --> NVDANV50HalTesla.kext/NVDANV50HalTeslaWeb.kext* --> GeForceTesla.kext* --> GeforceTeslaGLDriver.bundle/GeforceTeslaVADriver.bundle
AMD *= Based on data from
https://www.insanelymac.com/forum/topic/327712-black-screen-amd-radeon-hd5670/
I believe that AMDLegacyFramebuffer.kext loads resources from AMDLegacySupport.kext, and that LegacySupport is NOT a step in the init of the graphics subsystem. I think it acts like a shared library, not directly used to load the next kext. That's why I put a "+" instead of a -->. I am also not sure where the divide between AMDLegacyFramebuffer.kext/AMDLegacySupport.kext and AMDFramebuffer.kext is in terms of GPU support. Someone could please chime in on this. Also note that there is no Support kext for the AMDFramebuffer. Perhaps this LegacyFramebuffer was foreshadowing the demise of our Radeon GPU's?
Also note that AMDRadeonX3000.kext is the second layer controller kext for BOTH 5xxx and 6xxx, so BOTH Terascale 2 and Terascale 3. AMD uses a FOUR kext solution for some reason, just like Nvidia, presumably due to the need to support more models of Graphics Cards that at least share the same ARCH as stock mac ones. AMDRadeonX3000*/AMDRadeonX3000GLDriver handle acceleration setup for both of those architectures.
In fact, the ONLY difference between 5xxx and 6xxx seems that 6xxx loads AMD6000Controller.kext instead. The rest of the kexts ALL STAY THE SAME. Thus, the difference in porting these two architectures will be minimal, nearly identical processes, thus helping us more.
NVIDIA *= the "Hal" kext is for "hardware abstraction layer". Nvidia's architecture seems to feature FOUR kexts instead of three. The HAL loads first presumably to abstract the individual tesla card's technicalities, so a "one size fits all" controller can load, which then loads the graphics accelerators. For Kepler, it seems to be just Geforce.kext. HELP NEEDED ON THIS, URGENT.
*** = URGENT HELP NEEDED FOR NVIDIA. I DO NOT COMPLETELY UNDERSTAND HOW THE DRIVERS LOAD AND IN WHAT ORDER. THIS IS CRUCIAL...
sorry for the all caps, but we must know the nvidia driver loading stages for each architecture (tesla, fermi, kepler, etc) so we can properly understand how to proceed to patch Mojave.
TL;DR: Just see the top 1/3 of this post. The rest is just some details I recall on the GPU process of loading the kexts. But, if anyone has help/knowledge on NVIDIA and AMD kexts, please share that