Contribute
Register

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

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,247
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
As pointed out by MAC_OS before, I tried following this guide but ACPI files are different and there's no _OFF method (at least, no _OFF method which is not surrounded by PowerResource macro), so I cannot find ACPI path in this way. I also tried using WhateverGreen and -wegnoegpu flag but no success.
Here is my system report (used automatic tool).
What should I do now?
Thanks in advance :mrgreen:

Your profile has no laptop hardware details. Please fix as per FAQ:
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/
 
Joined
Dec 16, 2016
Messages
128
Motherboard
Msi z270 pro carbon
CPU
i7 7700k
Graphics
RX 580 + GTX 1080
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
Mobile Phone
  1. 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/...-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:
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 },
            "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:
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/

I tried to follow your guide in order to disable the nvida placed on second slot that cause sleep problem but used in windows 10 .
Unfortunately i cannot found the right ssdt with _Off metod .
Can u please help me to create the file to disable the gtx
 

Attachments

  • debug_28056.zip
    3.4 MB · Views: 64

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,247
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
I tried to follow your guide in order to disable the nvida placed on second slot that cause sleep problem but used in windows 10 .
Unfortunately i cannot found the right ssdt with _Off metod .
Can u please help me to create the file to disable the gtx

_OFF applicable only to laptops (this guide is in the laptop forums).
According to ioreg (IOACPIPlane), your Nvidia device is at _SB.PCI0.PEG1.PEGP.
 
Joined
Dec 16, 2016
Messages
128
Motherboard
Msi z270 pro carbon
CPU
i7 7700k
Graphics
RX 580 + GTX 1080
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
Mobile Phone
  1. Android
I solve the problem , i disable successful the Nvidia
 
Joined
Dec 16, 2016
Messages
128
Motherboard
Msi z270 pro carbon
CPU
i7 7700k
Graphics
RX 580 + GTX 1080
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
Mobile Phone
  1. Android
I add 3 entry in devise /add properties and inject invidia , work like a charm
 

Attachments

  • Untitled.png
    Untitled.png
    1.5 MB · Views: 281

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,247
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
I add 3 entry in devise /add properties and inject invidia , work like a charm

Yes, that method is also linked from post #1.
And is the method used by my guide config plist files.
 
Joined
Dec 16, 2016
Messages
128
Motherboard
Msi z270 pro carbon
CPU
i7 7700k
Graphics
RX 580 + GTX 1080
Mac
  1. iMac
  2. MacBook Pro
  3. Mac mini
Mobile Phone
  1. Android
Yes, that method is also linked from post #1.
And is the method used by my guide config plist files.

Yes , now i need to solve last problem , my external drive when the mac is going to sleep and i resume the mac is loosing speed i need to unplug ad plug again which is very annoying because i use that drive as storage for my photo editing
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
188,247
Motherboard
Intel DH67BL
CPU
i7-2600K
Graphics
HD 3000
Mac
  1. MacBook Air
Mobile Phone
  1. iOS
Yes , now i need to solve last problem , my external drive when the mac is going to sleep and i resume the mac is loosing speed i need to unplug ad plug again which is very annoying because i use that drive as storage for my photo editing

Off-topic.
 
Joined
May 4, 2016
Messages
10
Motherboard
Gigabyte Aorus Z490 Xtreme
CPU
i9-10900K
Graphics
Radeon VII
Mac
  1. iMac
  2. MacBook Pro
Mobile Phone
  1. iOS
Hi, I have an hacekentosh with gtx 1080ti. i wana updted to mojavea so i am thinking aboy geting amd gpu as scoderry wille keeping the 1080ti for windows. I followed your guide in order to disable the nvida but used in windows 10 . i found -off method ssdt which is"SSDT-2-PegSsdt.am" how ever i cannot found the right code .
Can u please help me to create the file to disable the gtx
 

Attachments

  • origin.zip
    65.7 KB · Views: 82
Top