Jump to content

[Solved] Debugging intermittent sleep problems when using WEG boot-arg igfxfw=2 with HP EliteDesk 800 G4/G5 Mini


deeveedee
 Share

37 posts in this topic

Recommended Posts

It runs fine as main (and single) card with force-online=1 as device property. Also igfxfw=2 and rps-control=1. Freqs and performance seems to be fine.

 

Spoiler

iGPU-main.png.c74286219650b6293123ba215510b08b.png

 

One question. Although I have AAPL,slot-name=Internal@0,2,0 Activity Monitor says it's on Slot 0. Do you have it so?

 

Spoiler

slot-0.png.bd493fd7d127255eb024ad856b07a91d.png

 

EDIT: removing AAPL,slot-name=Internal@0,2,0 it's seen as built in.

 

Spoiler

built-in.png.577a576f905849f156ec5c3b708c18f6.png

 

Edited by miliuco
Link to comment
Share on other sites

@miliuco The use of boot-arg or DeviceProperty is a personal preference - both achieve the same (as long as we're using the correct argument/property).  If you want to make sure that the WEG readme is accurate (I've become paranoid and like to double-check), you can also search WEG source code for your answer.  As you have indicated, boot-arg igfxonln is equivalent to DeviceProperty force-online based on inspection of WEG source WhateverGreen/kern_igfx.cpp:

        if (PE_parse_boot_argn("igfxonln", &forceOnline, sizeof(forceOnline))) {
                enabled = forceOnline != 0;
                DBGLOG("weg", "force online overriden by boot-argument %u", forceOnline);
        } else if (WIOKit::getOSDataValue(info->videoBuiltin, "force-online", forceOnline)) {
                enabled = forceOnline != 0;
                DBGLOG("weg", "force online overriden by device property %u", forceOnline);
        }

The WEG source first tries method PE_parse_boot_argn to parse boot-args to find igfxonln.  If boot-arg igfxonln is not found, then it tries WIOKit::getOSDataValue(info->videoBuiltin, ...) to parse graphics DeviceProperties to search for force-online.

Edited by deeveedee
  • Like 1
Link to comment
Share on other sites

@miliuco I do not use any AAPL,slot-name properties in my EFI.  I am using SMBIOS MacMini8,1 for my rig and a real MacMini8,1 IORegistry does not include property AAPL,slot-name for iGPU.  The only appearance of AAPL,slot-name property in a real MacMini8,1 IORegistry is for Thunderbolt and my rig does not have Thunderbolt ports.

 

I finished my testing of the igfxfw=2 and igfxrpsc=1 (rps-control=1) here and have concluded that HP EliteDesk 800 G4 / G5 Mini owners should be using only igfxfw=2 without igfxrpsc=1.  It would be helpful for other HP EliteDesk 800 G4 / G5 Mini owners to test.  To test this, test combinations of boot-args igfxfw=2 and igfxrpsc=1 during repeated sleep/wake cycles as I have done here.

Edited by deeveedee
  • Like 3
Link to comment
Share on other sites

@miliuco, You found another example of "not so well documented" option of WEG. I don't think you need the "force-online" property if your iGPU is not used as the main display GPU. If no monitor is connected to your iGPU ports or better yet, if your GPU is an "offline" GPU, this option is not needed as it forces all the ports in your framebuffer to be on.

The confusion is deepened by MacOS's definition of online Vs. offline GPUs. Many of MacOS functions like the AppleGVA actually are looking to send tasks to the offline GPU. An iMac is expected to have at least 1 offline and 1 online GPU, and forcing the iGPU online is done by the "enable-metal" property. I am highly suspicious that this is also something which has been confused because my observation is that metal is enabled on the iGPU even without this patch and it actually does something different than what its named indicates.

Also the "AAPL,slot-name" is only used if you want your device to show up under the PCI tab of the system information. As @deeveedee noted, real macs don't show the GPUs there, at least not in recent versions of MacOS so it is yet another cosmetic and frivolous option which could be useful for troubleshooting if you want to look at some properties but not under normal production situation. 

@5T33Z0 recently posted his work on enabling the GPU tab of activity monitor Reddit/Github which poked my interest. On a real mac, it appears that this tab only appears if one has multiple dGPUs on MacPros and requires on my rig to both use "enable-metal" property and the "AAPL, slot-name". Again, none of these actually are needed and may actually disable normal functions of an iMac SMBIOS which expects one online and one offline GPU and does not display the GPUs neither in the PCI tab of the system properties nor show a GPU tab in the activity monitor.

 

On my production setup, I don't even have any boot-arg remaining and the only device property I am injecting for my iGPU is igfxfw=2

image.png.578c2ed63fe259765d06dd15aa1e2271.png

image.png.b0840e3cc76af41c2c7e0e6df88482a0.png

Edited by rafale77
  • Like 2
Link to comment
Share on other sites

Guest 5T33Z0

@rafale77 Not really my work or discovery, I only summerized everything and condensed it into a guide.

 

enable-metal is needed in macOS Ventura to get metal 3 working on the iPGU (especially helpful if your dGPU doesn't support Metal 3)

I needed force-online when my GPU was dead and I had to use the iGPU on my hack using iMac20,2. Otherwise the display wouldn't turn on after waking from sleep/hibernation. I wouldn't use it in combination with an empty framebuffer,though.

igfxfw=2  puts the iPGU inheadless mode, but you don't get metal 3 and the GPU Tab in Ventura.

Edited by 5T33Z0
Link to comment
Share on other sites

Guest 5T33Z0

So, after doing some tests, this is the most minimal set of iGPU properties required to get 1) headless  2) metal 3 and GPU Tab working in macOS Ventura (as explained in the guide, you need properties for the GPU too, of course):

 

1741327528_Bildschirmfoto2022-07-08um17_52_23.png.5dba5d3ed3fce6479e539c4675f0924f.png

 

Which results in this:

 

1781373386_Bildschirmfoto2022-07-08um17_57_02.thumb.png.731119f72c7c701a5984020646cb2732.png

 

For the name of the GPU to be dispplayed correctly you would need to add the the device-id as well:

 

50534011_Bildschirmfoto2022-07-08um18_04_15.thumb.png.265c6db2b0ff4c40bf3c73e7f62e211a.png

 

Edited by 5T33Z0
Link to comment
Share on other sites

This was the post I came across last year after learning about rps-control. Even though my system does not need it, I kept it in my config just so that I know alternative options is there.  From my testing. there is really no performance hit by using one or the other or both at the same time.  I also had prefer igfxfw=2 and never experienced frequency being stuck at maximum until yesterday while testing under platform-id 07009B3E(Non-Headless) that is after some heavy video processing, frequency won't back down. 

  • Like 3
Link to comment
Share on other sites

@FirstTimeCustomac So we have reaffirmed Andrey1970's answer to me (when I was tonyx86 before changing my user name to deeveedee) back in December 2021. :)     It appears that we're all in agreemnent about the intended / appropriate uses of igfxfw=2 and igfxrpsc=1.  

 

Hopefully a few people can test the proposed solution here (intended for the HP EliteDesk 800 G4 / G5 Mini booting / running macOS from SATA SSD) which is to add a delay after _PTS to fix the igfxfw=2 sleep problem with slow storage.

  • Like 2
Link to comment
Share on other sites

@rafale77 "... I don't think you need the "force-online" property if your iGPU is not used as the main display GPU. If no monitor is connected to your iGPU ports or better yet, if your GPU is an "offline" GPU, this option is not needed as it forces all the ports in your framebuffer to be on..."

 

Noted. This is something I was thinking but not 100% sure. Removed in headless mode iGPU and kept in main display iGPU.

Link to comment
Share on other sites

Many thanks to all who helped with this solution.  The OC 0.8.2 EFI posted here is working well for me on HP EliteDesk 800 G4 Mini and HP EliteDesk 800 G5 Mini booting from NVMe SSD and booting from SATA SSD, so I have made this EFI my baseline here.  Thank you!

  • Like 1
Link to comment
Share on other sites

On 7/7/2022 at 6:57 AM, deeveedee said:

@miliuco In your post here, you include both igfxfw=2 and rps-control=1.  Should we be setting both boot-args for UHD 630?

 

EDIT: These boot-args are processed in different WhateverGreen source files as shown below.  igfxfw=2 "force loading of Apple GuC firmware" and igfxrpsc=1 "enable RPS control patch (improves IGPU performance)".

WhateverGreen/kern_igfx.cpp

                if (supportsGuCFirmware && getKernelVersion() >= KernelVersion::HighSierra) {
                        if (!PE_parse_boot_argn("igfxfw", &fwLoadMode, sizeof(fwLoadMode)))
                                WIOKit::getOSDataValue<int32_t>(info->videoBuiltin, "igfxfw", fwLoadMode);
                        if (fwLoadMode == FW_AUTO)
                                fwLoadMode = info->firmwareVendor == DeviceInfo::FirmwareVendor::Apple ? FW_APPLE : FW_DISABLE;
                } else {
                        fwLoadMode = FW_APPLE; /* Do nothing, GuC is either unsupported due to low OS or Apple */
                }
WhateverGreen/kern_igfx_pm.cpp

void IGFX::RPSControlPatch::processKernel(KernelPatcher &patcher, DeviceInfo *info) {
        uint32_t rpsc = 0;
        if (PE_parse_boot_argn("igfxrpsc", &rpsc, sizeof(rpsc)) ||
                WIOKit::getOSDataValue(info->videoBuiltin, "rps-control", rpsc)) {
                enabled = rpsc > 0 && available;
                DBGLOG("weg", "RPS control patch overriden (%u) availabile %d", rpsc, available);
        }
}

 

EDIT2: I remember that I had posted what I thought was a WhateverGreen bug here.  This code is unchanged in the latest WhateverGreen.kext/kern_igfx.cpp (above).  Does anyone else think that the else { fwLoadMode = FW_APPLE; } is wrong in kern_igfx.cpp?  @joevt - is this a bug in WhateverGreen.kext?

I haven't looked into or used this WhateverGreen iGPU firmware code so I don't know what the intention of the code is.

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...