Hi guys,
I was looking at the WhateverGreen code and wanted to know more about the GuC or Apple Firmware which is loaded with iGPU, when passing the option igfxfw=2. This loads the firmware and makes it behave like a real Mac.
Without this option, when I play very high bitrate video in VLC, jellyfish-400-mbps-4k-uhd-hevc-10bit.mkv (which can be downloaded here: jell.yfish.us), it stutters, and I was taking a close look at dGPU and iGPU performance in Intel Power Gadget and Activity Monitor GPU window. I found that if I don't load the Apple Firmware, the iGPU freq touches the max and dGPU freq doesn't at all, it stays around 5-10%. Because of this reason, that video cripples the iGPU, and it starts to skip frames a lot. Now, I was wonder how is it possible, with such a powerful hardware, it shouldn't happen. So, when I passed igfxfw=2, I looked at the kernel logs, which can be seen below, and confirmed that Apple Firmware is loaded, it changed from "Graphics accelerator is using scheduler: Host Preemptive" mode, to ""Graphics accelerator is using scheduler: Apple Firmware".
It looks like when Apple Firmware is used, macOS has better idea of internals of iGPU and it can decide that only iGPU is not capable enough and kicks the dGPU. Which is what I see in the activity monitor gpu window, it reaches at least 30-40% easily when playing video and comes to 2-5% when it ends.
You guys can also try that. Look for "Graphics accelerator is using scheduler:" or "Begin Gfx firmware load process" in kernel logs. And also "accelDidLoadGuC", in second command, if not found it wasn't loaded.
You would also need a very high bitrate video which completely chokes the iGPU. Only then you can see that dGPU is in effect. Moreover, it turns out that, since Comet Lake (10900K) is just Coffee Lake refresh, we don't quite need the Coffee Lake platform-id. Comet Lake platform-id just works fine, which is 0x9BC5 or 0x95C8 (if 10500K). You can confirm it from ark.intel.
I tested both the platform-id and and saw they behave exactly the same. In fact, in code, they are basically same, as they fall under same category, so the GuC will behave exactly the same.
Moreover, I tested iMovie with it, and time a 4K render, and it continued to work with both of the platform-ids.
Kernel Logs:
Code:
dsingh@Ds-Mac ~ % log show --last=boot|grep -i AppleIntelKBLGraphics
2021-01-10 10:31:59.763066+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Ring Size: 32 KB
2021-01-10 10:31:59.763067+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Ring Size: 32 KB
2021-01-10 10:31:59.763085+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics Scheduler Preemption Enabled!
2021-01-10 10:31:59.763086+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics Scheduler Preemption Enabled!
2021-01-10 10:31:59.763087+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Setting preemptionDelayIntervalUS to 400 microseconds
2021-01-10 10:31:59.763089+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Setting preemptionDelayIntervalUS to 400 microseconds
2021-01-10 10:31:59.763090+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Setting preemptionTimerIntervalUS to 2000 microseconds
2021-01-10 10:31:59.763091+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Setting preemptionTimerIntervalUS to 2000 microseconds
2021-01-10 10:31:59.763092+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Will NOT fallback to host-side scheduling if graphics firmware fails to load
2021-01-10 10:31:59.763093+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Will NOT fallback to host-side scheduling if graphics firmware fails to load
2021-01-10 10:31:59.763094+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Tail Coalescing Enabled.
2021-01-10 10:31:59.763095+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Tail Coalescing Enabled.
2021-01-10 10:31:59.763096+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Page Fault Handling Enabled.
2021-01-10 10:31:59.763097+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Page Fault Handling Enabled.
2021-01-10 10:31:59.763097+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Single Channel Index Disabled
2021-01-10 10:31:59.763098+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Single Channel Index Disabled
2021-01-10 10:31:59.763099+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Channel Wait For Complete Disabled
2021-01-10 10:31:59.763100+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler Channel Wait For Complete Disabled
2021-01-10 10:31:59.763101+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler: Process CSB using HWS.
2021-01-10 10:31:59.763102+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler: Process CSB using HWS.
2021-01-10 10:31:59.763103+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler: PM notify enabled
2021-01-10 10:31:59.763104+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Scheduler: PM notify enabled
2021-01-10 10:31:59.763110+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Selected Apple Firmware Scheduler
2021-01-10 10:31:59.763112+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Selected Apple Firmware Scheduler
2021-01-10 10:31:59.765739+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics Address: PPGTT, Separate Address Space
2021-01-10 10:31:59.765741+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics Address: PPGTT, Separate Address Space
2021-01-10 10:31:59.765742+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] MultiForceWake Enabled: Using 3D Driver
2021-01-10 10:31:59.765743+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] MultiForceWake Enabled: Using 3D Driver
2021-01-10 10:31:59.765743+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Render Compression Enabled.
2021-01-10 10:31:59.765744+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Render Compression Enabled.
2021-01-10 10:31:59.765745+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Render Compression for IOSurface is Enabled.
2021-01-10 10:31:59.765746+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Render Compression for IOSurface is Enabled.
2021-01-10 10:31:59.771285+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Begin Gfx firmware load process
2021-01-10 10:31:59.771287+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Begin Gfx firmware load process
2021-01-10 10:31:59.771287+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] ForceWake Multithread = 0x30002
2021-01-10 10:31:59.771289+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] ForceWake Multithread = 0x30002
2021-01-10 10:31:59.771290+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] CONFIG0 (0xD00) = 0x8000000e
2021-01-10 10:31:59.771291+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] CONFIG0 (0xD00) = 0x8000000e
2021-01-10 10:31:59.771292+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] GT_THREAD_STATUS = 0x400b0000
2021-01-10 10:31:59.771293+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] GT_THREAD_STATUS = 0x400b0000
2021-01-10 10:31:59.771294+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Doing retry #0
2021-01-10 10:31:59.771295+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Doing retry #0
2021-01-10 10:31:59.805250+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics Firmware Version: 2.18.2.0
2021-01-10 10:31:59.805252+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics Firmware Version: 2.18.2.0
2021-01-10 10:31:59.807983+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics accelerator is using scheduler: Apple Firmware
2021-01-10 10:31:59.807985+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelKBLGraphics) [IGPU] Graphics accelerator is using scheduler: Apple Firmware
2021-01-10 10:32:00.980775+0000 0x6f6 Default 0x0 99 0 kernelmanagerd: Received kext load notification: com.apple.driver.AppleIntelKBLGraphics
Code:
dsingh@Ds-Mac ~ % log show --last=boot|grep -i AppleIntelCFLGraphicsFramebuffer
2021-01-10 10:31:59.196808+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) Entry to probe function
2021-01-10 10:31:59.196811+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) PlatformID found: 9bc50003
2021-01-10 10:31:59.196864+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] In FB driver start
2021-01-10 10:31:59.197269+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR ] Boot pipe could not be found
2021-01-10 10:31:59.262539+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][INFO ] initForPM - fGPUIsAwake init to 1
2021-01-10 10:31:59.262774+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get GPU caps
2021-01-10 10:31:59.657711+0000 0x6ec Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get GPU caps
2021-01-10 10:31:59.657717+0000 0x6ec Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get GPU caps
2021-01-10 10:31:59.657718+0000 0x6ec Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get port caps
2021-01-10 10:31:59.771202+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][INFO ] accelWillLoadGuC: initializing...
2021-01-10 10:31:59.805253+0000 0x661 Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][INFO ] accelDidLoadGuC
2021-01-10 10:32:00.980705+0000 0x6f6 Default 0x0 99 0 kernelmanagerd: Received kext load notification: com.apple.driver.AppleIntelCFLGraphicsFramebuffer
2021-01-10 10:32:02.089336+0000 0x34f Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get GPU caps
2021-01-10 10:32:02.096087+0000 0x34f Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get GPU caps
2021-01-10 10:32:02.100125+0000 0x34f Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get GPU caps
2021-01-10 10:32:02.104280+0000 0x34f Default 0x0 0 0 kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG ][DISPLAY ] [AGDC] Get GPU caps