Contribute
Register

[FIX] "Window Server Service only ran for 0 seconds" with dual-GPU

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,415
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Overview

If you have a dual-GPU (Intel+Nvidia or Intel+AMD Radeon), you may have trouble reaching the macOS High Sierra installer. It is a new bug in the system somewhere that stalls boot if the VESA drivers try to connect to the secondary (discrete) graphics device.

There are essentially three methods you might employ to avoid this:
- disable the card in BIOS (but not all laptop BIOS implementations provide such an option)
- disable the card in in ACPI as per this guide: https://www.tonymacx86.com/threads/guide-disabling-discrete-graphics-in-dual-gpu-laptops.163772/
OR
- inject a few properties on the graphics device that prevent the base VESA drivers from loading

It is the third/last method mentioned that this guide will cover.

Background information: https://www.tonymacx86.com/threads/need-help-disabling-nvidia-on-haswell-intel-4600hd.231800/#post-1582114

Note: If you're using the plists from the Clover laptop guide (https://www.tonymacx86.com/threads/guide-booting-the-os-x-installer-on-laptops-with-clover.148093/), you will probably not need to implement the SSDT-DiscreteSpoof.aml as described in this guide. The plists in that guide already use config.plist/AddProperties to inject the required spoofing properties on both the AMD and Nvidia devices (if they exist). Of course, the config.plist technique relies on Clover recognizing the discrete device correctly, which does not always work, so if that is your case, continue to follow this guide.


Determine ACPI path

In order to inject the needed properties using an add-on SSDT, you must first determine the ACPI path of the device. If you have an ioreg (from a working Sierra install, for example), you can determine the path from that ioreg (if someone has such an ioreg, please attach it, for an example in this post).

But you can also determine it by looking at extracted ACPI files.

The process:
- use Clover F4 to extract native ACPI files to ACPI/origin
- disassemble the files
- search for a method named _OFF
- examine the resulting files to determine the ACPI path

For this guide, we will use the files from the discrete disable guide: https://www.tonymacx86.com/threads/guide-disabling-discrete-graphics-in-dual-gpu-laptops.163772/

Download the attachment so you can follow along.

First, we disassemble all the files (see ACPI patching guide for more information on iasl and disassembly):
Code:
iasl -dl DSDT.aml SSDT*.aml
Next, we search for Method definitions with method name _OFF:
Code:
grep -l Method.*_OFF *.dsl
For these set of files, we have this result:
Code:
SSDT-10.dsl
SSDT-11.dsl
Now we know what files to look at to find the _OFF method. Because once we find the _OFF method, it is easy to see the ACPI path that the _OFF method resides.

Opening SSDT-10.dsl, we find the _OFF method there is in a PowerResource macro, therefore is not the one we want:
Code:
        PowerResource (PC05, 0x00, 0x0000)
        {
            Name (_STA, One)  // _STA: Status
            Method (_ON, 0, Serialized)  // _ON_: Power On
            {
...
            }

            Method (_OFF, 0, Serialized)  // _OFF: Power Off
Looking at SSDT-11.dsl, we find the _OFF method we want:
Code:
        Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
            If (LEqual (CTXT, Zero))
            {
                \_SB.PCI0.LPCB.EC0.SPIN (0x96, Zero)
                If (LNotEqual (GPRF, One))
                {
                    Store (VGAR, VGAB)
                }

                Store (One, CTXT)
            }

            SGOF ()
        }
If you click within the method, you will see the MaciASL status bar shows the ACPI path:
Screen Shot 2017-09-28 at 6.02.02 AM.png


This corresponds to the code in the file that defines this method in that scope:
Code:
    Scope (\_SB.PCI0.RP05.PEGP)
    {
...
        Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
...
So, now we have the path: _SB.PCI0.RP05.PEGP, it is time to create the SSDT that matches.


Creating the spoof SSDT

The original code provided in the reference post:
Code:
// save as SSDT-DiscreteSpoof.aml
DefinitionBlock ("", "SSDT", 2, "hack", "spoof", 0)
{
    Method(_SB.PCI0.PEG0.PEGP._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return (Package()
        {
            "name", Buffer() { "#display" },
            "IOName", "#display",
            "class-code", Buffer() { 0xFF, 0xFF, 0xFF, 0xFF },
        })
    }
}
But our path is different, so:
Code:
// save as SSDT-DiscreteSpoof.aml
DefinitionBlock ("", "SSDT", 2, "hack", "spoof", 0)
{
    Method(_SB.PCI0.RP05.PEGP._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return (Package()
        {
            "name", Buffer() { "#display" },
            "IOName", "#display",
            "class-code", Buffer() { 0xFF, 0xFF, 0xFF, 0xFF },
            "vendor-id", Buffer() { 0xFF, 0xFF, 0,  0 },
            "device-id", Buffer() { 0xFF, 0xFF, 0, 0 },
        })
    }
}
//EOF
To create the SSDT-DiscreteSpoof.aml, run MaciASL, select File->New, paste the code into the resulting window, choose File->Save As, set format: ACPI Machine Language Binary, give the file name as SSDT-DiscreteSpoof.aml, and save to somewhere you know how to find (such as the desktop).

Then place that file at EFI/Clover/ACPI/patched/SSDT-DiscreteSpoof.aml.


Other considerations

This method uses a _DSM method in an SSDT to inject the properties. If your native ACPI has an existing _DSM method at that path, you will need to rename it, because otherwise the native _DSM conflicts with the _DSM the SSDT is adding. Typically, this is done by entering a _DSM->XDSM patch in your config.plist/ACPI/DSDT/Patches. This patch is provided in all my guide plists, but is disabled.

This is how it looks in Xcode once it is enabled:
Screen Shot 2017-09-28 at 6.12.26 AM.png


Also, if you're using SortedOrder in your config.plist (not likely for a Clover setup for the installer), you will need to be certain to add SSDT-DiscreteSpoof.aml to it. If SortedOrder is specified, Clover only loads the SSDTs specified in it. If it is not listed, it will not load even though present in ACPI/patched.


Problem Reporting

Read FAQ, "Problem Reporting". Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
 
Last edited:
Joined
Sep 9, 2011
Messages
873
Motherboard
HP 250 G5 (81EF) Clover UEFI
CPU
Intel Core i3 5005U
Graphics
Intel HD 5500 (1366x768)
Mobile Phone
Android
Overview

If you have a dual-GPU (Intel+Nvidia or Intel+AMD Radeon), you may have trouble reaching the macOS High Sierra installer. It is a new bug in the system somewhere that stalls boot if the VESA drivers try to connect to the secondary (discrete) graphics device.

There are essentially three methods you might employ to avoid this:
- disable the card in BIOS (but not all laptop BIOS implementations provide such an option)
- disable the card in in ACPI as per this guide: https://www.tonymacx86.com/threads/guide-disabling-discrete-graphics-in-dual-gpu-laptops.163772/
OR
- inject a few properties on the graphics device that prevent the base VESA drivers from loading

It is the third/last method mentioned that this guide will cover.

Background information: https://www.tonymacx86.com/threads/need-help-disabling-nvidia-on-haswell-intel-4600hd.231800/#post-1582114


Determine ACPI path

In order to inject the needed properties using an add-on SSDT, you must first determine the ACPI path of the device. If you have an ioreg (from a working Sierra install, for example), you can determine the path from that ioreg (if someone has such an ioreg, please attach it, for an example in this post).

But you can also determine it by looking at extracted ACPI files.

The process:
- use Clover F4 to extract native ACPI files to ACPI/origin
- disassemble the files
- search for a method named _OFF
- examine the resulting files to determine the ACPI path

For this guide, we will use the files from the discrete disable guide: https://www.tonymacx86.com/threads/guide-disabling-discrete-graphics-in-dual-gpu-laptops.163772/

Download the attachment so you can follow along.

First, we disassemble all the files (see ACPI patching guide for more information on iasl and disassembly):
Code:
iasl -dl DSDT.aml SSDT*.aml
Next, we search for Method definitions with method name _OFF:
Code:
grep -l Method.*_OFF *.dsl
For these set of files, we have this result:
Code:
SSDT-10.dsl
SSDT-11.dsl
Now we know what files to look at to find the _OFF method. Because once we find the _OFF method, it is easy to see the ACPI path that the _OFF method resides.

Opening SSDT-10.dsl, we find the _OFF method there is in a PowerResource macro, therefore is not the one we want:
Code:
        PowerResource (PC05, 0x00, 0x0000)
        {
            Name (_STA, One)  // _STA: Status
            Method (_ON, 0, Serialized)  // _ON_: Power On
            {
...
            }

            Method (_OFF, 0, Serialized)  // _OFF: Power Off
Looking at SSDT-11.dsl, we find the _OFF method we want:
Code:
        Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
            If (LEqual (CTXT, Zero))
            {
                \_SB.PCI0.LPCB.EC0.SPIN (0x96, Zero)
                If (LNotEqual (GPRF, One))
                {
                    Store (VGAR, VGAB)
                }

                Store (One, CTXT)
            }

            SGOF ()
        }
If you click within the method, you will see the MaciASL status bar shows the ACPI path:
View attachment 281456

This corresponds to the code in the file that defines this method in that scope:
Code:
    Scope (\_SB.PCI0.RP05.PEGP)
    {
...
        Method (_OFF, 0, Serialized)  // _OFF: Power Off
        {
...
So, now we have the path: _SB.PCI0.RP05.PEGP, it is time to create the SSDT that matches.


Creating the spoof SSDT

The original code provided in the reference post:
Code:
// save as SSDT-DiscreteSpoof.aml
DefinitionBlock ("", "SSDT", 2, "hack", "spoof", 0)
{
    Method(_SB.PCI0.PEG0.PEGP._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return (Package()
        {
            "name", Buffer() { "#display" },
            "IOName", "#display",
            "class-code", Buffer() { 0xFF, 0xFF, 0xFF, 0xFF },
        })
    }
}
But our path is different, so:
Code:
// save as SSDT-DiscreteSpoof.aml
DefinitionBlock ("", "SSDT", 2, "hack", "spoof", 0)
{
    Method(_SB.PCI0.RP05.PEGP._DSM, 4)
    {
        If (!Arg2) { Return (Buffer() { 0x03 } ) }
        Return (Package()
        {
            "name", Buffer() { "#display" },
            "IOName", "#display",
            "class-code", Buffer() { 0xFF, 0xFF, 0xFF, 0xFF },
        })
    }
}
To create the SSDT-DiscreteSpoof.aml, run MaciASL, select File->New, paste the code into the resulting window, choose File->Save As, set format: ACPI Machine Language Binary, give the file name as SSDT-DiscreteSpoof.aml, and save to somewhere you know how to find (such as the desktop).

Then place that file at EFI/Clover/ACPI/patched/SSDT-DiscreteSpoof.aml.


Other considerations

This method uses a _DSM method in an SSDT to inject the properties. If your native ACPI has an existing _DSM method at that path, you will need to rename it, because otherwise the native _DSM conflicts with the _DSM the SSDT is adding. Typically, this is done by entering a _DSM->XDSM patch in your config.plist/ACPI/DSDT/Patches. This patch is provided in all my guide plists, but is disabled.

This is how it looks in Xcode once it is enabled:
View attachment 281459

Also, if you're using SortedOrder in your config.plist (not likely for a Clover setup for the installer), you will need to be certain to add SSDT-DiscreteSpoof.aml to it. If SortedOrder is specified, Clover only loads the SSDTs specified in it. If it is not listed, it will not load even though present in ACPI/patched.


Problem Reporting

Read FAQ, "Problem Reporting". Carefully. Attach all requested files/output.
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
Nice guide! I'm sure this will help many people. But I'm just wondering, can you just delete the Nvidia/AMD kexts and boot into the installer? Similar to the procedure for booting the installer on 1st gen Intel graphics.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,415
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Nice guide! I'm sure this will help many people. But I'm just wondering, can you just delete the Nvidia/AMD kexts and boot into the installer? Similar to the procedure for booting the installer on 1st gen Intel graphics.
You would need to delete IONDRVSupport.kext.
But deleting kexts when using createinstallmedia is difficult as they are buried in a DMG.
You would have to use the BaseBinaries clone method and I don't think those procedures work with High Sierra ATM.
 
Joined
Sep 9, 2011
Messages
873
Motherboard
HP 250 G5 (81EF) Clover UEFI
CPU
Intel Core i3 5005U
Graphics
Intel HD 5500 (1366x768)
Mobile Phone
Android
You would need to delete IONDRVSupport.kext.
But deleting kexts when using createinstallmedia is difficult as they are buried in a DMG.
You would have to use the BaseBinaries clone method and I don't think those procedures work with High Sierra ATM.
AFAIK, the Unibeast method makes the /S/L/E directory accesible. So it should be possible.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,415
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
AFAIK, the Unibeast method makes the /S/L/E directory accesible. So it should be possible.
I don't use Unibeast, so I cannot confirm.
 
Joined
Jun 8, 2017
Messages
11
Motherboard
HP ENVY 13 d010nr(Clover)
CPU
i5-6200U
Graphics
HD520 3200x1800
Mac
MacBook Air, MacBook Pro
Classic Mac
iMac
Mobile Phone
iOS
Opening SSDT-10.dsl, we find the _OFF method there is in a PowerResource macro
Opening all dsdt and ssdt files with method name _OFF, I find every _OFF method there is in a PowerResource macro.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,415
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Opening all dsdt and ssdt files with method name _OFF, I find every _OFF method there is in a PowerResource macro.
You neglected to attach your files.
 
Joined
Jun 8, 2017
Messages
11
Motherboard
HP ENVY 13 d010nr(Clover)
CPU
i5-6200U
Graphics
HD520 3200x1800
Mac
MacBook Air, MacBook Pro
Classic Mac
iMac
Mobile Phone
iOS
You neglected to attach your files.
DELL Vostro 5460-R2748TB
Motherboard: Intel Sunrise Point H110
CPU: i7-7700T
Graphics Coprocessor: HD630 & Nvidia Geforce 930MX
Soundcard: Realtek ALC668
Wireless: Intel® Dual Band Wireless-AC 3165
Bluetooth: Intel Wireless Bluetooth®
Others: Webcam2 USB3.0
now :Clover 4075 & macOS Sierra 10.12.5 16F73
GPT/UEFI
I use ubuntu to get the dsdt and ssdt files.
 

Attachments

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,415
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
DELL Vostro 5460-R2748TB
Motherboard: Intel Sunrise Point H110
CPU: i7-7700T
Graphics Coprocessor: HD630 & Nvidia Geforce 930MX
Soundcard: Realtek ALC668
Wireless: Intel® Dual Band Wireless-AC 3165
Bluetooth: Intel Wireless Bluetooth®
Others: Webcam2 USB3.0
now :Clover 4075 & macOS Sierra 10.12.5 16F73
GPT/UEFI
I use ubuntu to get the dsdt and ssdt files.
This is not an extract from Clover F4 (you should really follow the guide as written).
What hardware do you have?
Why is your profile not filled out as per FAQ?
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
 
Top