Jump to content
Mieze

Tracing back the AMD GPU wakeup issue to its origin

367 posts in this topic

Recommended Posts

apple patches it in another way it no longer needs that just be happy it works

 

 

Sent from my iPhone using Tapatalk

i now enable rx580 with only whatevergreen which renames gpu device to GFX0

Share this post


Link to post
Share on other sites
Advertisement

i now enable rx580 with only whatevergreen which renames gpu device to GFX0

switch to a ssdt for that im sure someone can help you

 

 

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites

switch to a ssdt for that im sure someone can help you

 

 

Sent from my iPhone using Tapatalk

 i find no problems to use whatevergreen... :D

Share this post


Link to post
Share on other sites

i find no problems to use whatevergreen... :D

we dont need weg anymore thats the whole point.... lol

 

 

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites
On 10/23/2017 at 10:04 PM, Slice said:

@Mieze

It's fantastic work!

Confirm working with my Radeon 6450 in Sierra.

I just made this patch as SSDT

SSDT-AMD.aml.zip

 

My Asus P5Q-Pro MB doesn't have integrated GPU, I have a Radeon HD 6870. Clover inserts device GFX0 and Gibba FB at the device path as shown by ioreg.

 

Accordingly, I have modified the SSDT-AMD.aml as in the snippet below (best guess after gathering information from several related threads). After making this change I forced sleep from the Apple menu. The machine seemed to have gone to sleep but immediately woke up (which is likely a separate issue). Important thing is that the display came back up which suggested that SSDT seems to be working.

 

However, when the machine went to sleep on its own after 30mins of inactivity, it did not come back on. Fans etc were running, but no display. I hit some keys and plugged/unplugged a USB drive, but no response. Could not even ssh into the machine from another machine, so had to do a hard reboot.

 

My question is if my SSDT edit is correct, or should the device path be _SB_.PCI0.P0P2.PEGP, or something else? Any pointers no the machine being unresponsive after auto sleep are much appreciated!

 

DefinitionBlock ("", "SSDT", 2, "Apple", "Radeon", 0x00003000)
{
    External (_SB_.PCI0.P0P2.GFX0, DeviceObj)    // (from opcode)

    Scope (\_SB.PCI0.P0P2.GFX0)
    {
        OperationRegion (PCIB, PCI_Config, Zero, 0x0100)
        Field (PCIB, AnyAcc, NoLock, Preserve)
        {
            Offset (0x10), 
            BAR0,   32, 
            BAR1,   32, 
            BAR2,   64, 
            BAR4,   32, 
            BAR5,   32
        }

 

 

IOReg Gibba.png

Edited by firefox-bin

Share this post


Link to post
Share on other sites

@Mieze

Would you please provide instructions on how to dump BARS, the  GPUs control register space, and how to change them.

This is my problem:
 

https://www.insanelymac.com/forum/topic/334965-amd-firepro-w4100-high-cinebench-r15-opengl-if-first-run-under-windows/


I believe that your generic method would be helpful in resolving my problem. The intention is to compare the Gpu's registers (BARs etc) between a soft Windows reboot, and a cold High Sierra boot. Then to patch the DSDT.

I've read the thread and am surprised that no one has inquired about the tools that you have used.

Thank you.
 

Share this post


Link to post
Share on other sites

It may be different tools.

RW-Everything in Windows.

RadeonDump in macOS.

Or somehow ACPI debugging.

You also may write your own kext for macOS to dump PCI and MMIO registers into IOLog in macOS.

You may modify Clover sources to dump PCI and MMIO registers into boot.log before any OS.

Share this post


Link to post
Share on other sites

Thank you Slice.

I will examine RadeonDump; it's included in DarwinDumper.

I know that this is off-topic.

At the moment I am using Windows 10 as a glorified graphics microcode loader (GuC). Is there anyway to capture the microcode that is loaded by Windows for the AMD Firepro W4100; then use Clover or macOS to write the microcode to the W4100?

The loading of the microcode is the key to unlocking the full 3D performance of the W4100.

Share this post


Link to post
Share on other sites

Since I replaced my my R9 270X with an RX570 a half year ago, I noticed that this strange kernel message was showing up after wakeup from sleep:

kernel: AppleHDAHDMI_DPDriver::setPowerState(0xdf0b895bf4bcbbf9, 0 -> 1) timed out after 10134 ms
kernel: AppleHDAHDMI_DPDriver::setPowerState(0xdf0b895bf4bcbbf9, 0 -> 1) timed out after 10134 ms

Although it doesn't seem to do much harm to the system, DisplayPort audio used to work well anyway, I'm curious like all cats ;) and decided to investigate the issue. As I'm using system definition iMac18,3 it was the most obvious step to take a look at the IOReg dump of an original Apple machine of that type and compared it with mine. Checking device HDEF, I noticed that the iMac18,3 doesn't have the "hda-gfx" property on that device anymore but instead of it a "No-hda-gfx" property so that I decided to edit my HDEF's method _DSM in order to adopt this change and it made the error message after wakeup disappear.

            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                           
                    })
                }

                Return (Package (0x06)
                {
                    "No-hda-gfx", 
                    Buffer (0x08)
                    {
                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
                    }, 

                    "layout-id", 
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                         
                    }, 

                    "PinConfigurations", 
                    Buffer (Zero) {}
                })
            }

Mieze

Edited by Mieze

Share this post


Link to post
Share on other sites
On 8/1/2018 at 10:10 AM, Slice said:

It may be different tools.

RW-Everything in Windows.

RadeonDump in macOS.

Or somehow ACPI debugging.

You also may write your own kext for macOS to dump PCI and MMIO registers into IOLog in macOS.

You may modify Clover sources to dump PCI and MMIO registers into boot.log before any OS.

I just saw your post and wanted to share this piece of code which I used to dump the GPU's register space in order to investigate the wakeup issue. It adds the dump as property GBUF to the GPU's IORegistry entry while the system is booting so that it my be retrieved using IORegistryExplorer later. Have fun!

                Device (PEGP)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                    OperationRegion (PCIB, PCI_Config, Zero, 0x0100)
                    Field (PCIB, AnyAcc, NoLock, Preserve)
                    {
                        Offset (0x04), 
                        CMDR,   16, 
                        Offset (0x10), 
                        BAR0,   32, 
                        BAR1,   32, 
                        BAR2,   64
                    }

                    OperationRegion (GREG, SystemMemory, And (BAR2, 0xFFFFFFFFFFFFFFF0), 0x8000)
                    Field (GREG, AnyAcc, NoLock, Preserve)
                    {
                        Offset (0x681C), 
                        SBS0,   32
                    }

                    OperationRegion (GREF, SystemMemory, And (BAR2, 0xFFFFFFFFFFFFFFF0), 0x00010000)
                    Field (GREF, AnyAcc, NoLock, Preserve)
                    {
                        GSRC,   524288
                    }

                    Name (GBUF, Buffer (0x00010000) {})
                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        Store (Or (CMDR, 0x02), CMDR)
                        Sleep (One)
                        CopyObject (GSRC, GBUF)
                        Store (Package (0x02)
                            {
                                "GBUF", 
                                GBUF
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }

Mieze

Share this post


Link to post
Share on other sites
On 11/13/2018 at 12:11 PM, Mieze said:

Since I replaced my my R9 270X with an RX570 a half year ago, I noticed that this strange kernel message was showing up after wakeup from sleep:


kernel: AppleHDAHDMI_DPDriver::setPowerState(0xdf0b895bf4bcbbf9, 0 -> 1) timed out after 10134 ms
kernel: AppleHDAHDMI_DPDriver::setPowerState(0xdf0b895bf4bcbbf9, 0 -> 1) timed out after 10134 ms

Although it doesn't seem to do much harm to the system, DisplayPort audio used to work well anyway, I'm curious like all cats ;) and decided to investigate the issue. As I'm using system definition iMac18,3 it was the most obvious step to take a look at the IOReg dump of an original Apple machine of that type and compared it with mine. Checking device HDEF, I noticed that the iMac18,3 doesn't have the "hda-gfx" property on that device anymore but instead of it a "No-hda-gfx" property so that I decided to edit my HDEF's method _DSM in order to adopt this change and it made the error message after wakeup disappear.


            Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
            {
                If (LEqual (Arg2, Zero))
                {
                    Return (Buffer (One)
                    {
                         0x03                                           
                    })
                }

                Return (Package (0x06)
                {
                    "No-hda-gfx", 
                    Buffer (0x08)
                    {
                         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
                    }, 

                    "layout-id", 
                    Buffer (0x04)
                    {
                         0x01, 0x00, 0x00, 0x00                         
                    }, 

                    "PinConfigurations", 
                    Buffer (Zero) {}
                })
            }

Mieze

It can be done by clover's config.plist Device->Properties

	<key>PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x1)</key>
	<dict>
		<key>No-hda-gfx</key>
		<data>
		b25ib2FyZC0xAA==
		</data>

Yes?

Share this post


Link to post
Share on other sites
6 hours ago, Slice said:

It can be done by clover's config.plist Device->Properties


	<key>PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x1)</key>
	<dict>
		<key>No-hda-fgx</key>
		<data>
		b25ib2FyZC0xAA==
		</data>

Yes?

 

Typo?   fgx   is  really    no-hda-gfx   ?

Share this post


Link to post
Share on other sites
2 hours ago, Gigamaxx said:

 

Typo?   fgx   is  really    no-hda-gfx   ?

Of course it's a typo and it should read "No-hda-gfx" but apart from that it can be injected in the same way as other properties.

 

Mieze

Share this post


Link to post
Share on other sites
1 hour ago, Mieze said:

Of course it's a typo and it should read "No-hda-gfx" but apart from that it can be injected in the same way as other properties.

 

Mieze

 

In case someone copies and pastes it.   

Share this post


Link to post
Share on other sites
7 hours ago, Slice said:

I edited my post. Sorry for misprint.

Otherwise data should have other value? Or no matter?

 

Sorry for pointing it out, thanks for correcting.  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By vin047
      I have a Kingston HyperX Predator PCIE-SSD (model: SHPM2280P2H) matched with an X58 motherboard (legacy bios). The card has a Marvell 88SS9293 controller with an Option ROM which allows it to be detected on my motherboard as a bootable drive - listed as "IDE: Kingston SHPM". As my BIOS is non-UEFI, I assume the Option ROM presents it in IDE mode instead of AHCI.
       
      I use Clover legacy with BiosBlockIO to get around this, and it works well - Clover detects my drive and allows me to install macOS onto it and use it as a boot drive. macOS detects the drive correctly as a SATA AHCI drive. I guess Clover correctly detects (configures?) the Option ROM into AHCI mode and presents it as such to macOS - getting full speed read Read/Write performance. All is well.
       
      Except waking from sleep. When waking from sleep, depending on clover config options + dsdt, I either get an immediate reboot or hang on black screen that requires hard reset. I eventually realised that nothing after entering sleep mode is recorded in the logs, its completely empty until next boot up. This makes me think that on resume from sleep, macOS isn't seeing the drive anymore (hence can't even write to logs). My assumption here is that the Option ROM is presenting/configuring the card in IDE mode, which is not what macOS is expecting.
       
      This post describes the problem: 
       
      and also has a solution: in dsdt, simply write the correct values to 0x40, 0x41, 0x42 (which must be the BAR0 register?) to configure Option ROM to use AHCI mode. But I have no idea what address BAR0 is on the Marvell 88SS9293 - there appears to be no documentation whatsoever on this controller available online!
       
      I managed to dump the ROM using Linux sysfs, but don't have the skills to disassemble/decipher the binary to find the correct addresses. Anyone with such experience able to help?? I've attached the ROM dump and lspci output.
       
      Thanks in advance!
      rom.bin
      lspci_output.txt
    • By vin047
      Hi, have an old Asrock X58 Deluxe motherboard with an i7-920 Nehalem CPU (yes old board ) + AMD RX460 . As per the title, i've managed to get Mojave installed and running with Speed Step working too!
       
      Final issue i'm having is with sleep - it sleeps fine and even responds to keyboard/mouse event, but instead of waking up to the desktop it restarts and loads from BIOS boot screen. When finally booted into macos, it restores as if restored from unexpected shutdown (though no error is shown).
       
      I've tried for days to get it working, sometimes depending on clover config changes, I can get it to wake up without reboot, but it just remains at a black screen and is unresponsive. 
       
      I have no custom DSDT, i've tried writing one but don't know really know what i'm looking for? Currently relying on clover patches. I've uploaded my original DSDT (dumped from Clover, F4 option) + current config. Anyone have any ideas?
      dsdt original.zip
      config.plist.zip
    • By AppleVegas
      Hello! I was trying to install hackintosh a while ago and today I decided to install it today.
      I am able to boot it, I installed OS but have problems with iGPU. It has only 4mb vram.
      I did almost everything, I installed whatevergreen, used special clover config, but nothing. I've only got it to recognize my igpu.
       
      I have a laptop with this specs:
      Laptop brand name: Lenovo G50-80
      iGPU: Intel HD Graphics 5500 -- Only shows 4mb of vram
      CPU: Intel Core i5-5200U 2.20GHz
      dGPU: AMD Radeon R5 M230 or AMD Radeon HD 8500m (it has two brand names lol) -- will be really glad if you tell me how to launch it in High Sierra with my iGPU, now I can't even load OS when I have discrete GPU enabled
      RAM: 6GB ddr3
      Bluetooth: Qualcomm Atheros QCA61x4 -- On the way to enable it
      Wi-Fi: Qualcomm Atheros AR956x -- Managed to enable it
       
      P.S: In the windows I can see that my iGPU has Dedicated Video Memory: 128MB
       
      Any help? I think you are only my savers

    • By karthiksh1989
      can somebody walkthrough with the mojave installation guide?
      i have a mac high sierra 13.6 version on my macbook pro and want to install mojave on my desktop
      Exact config is Gigabyte gaming wifi 7 motherboard amy ryzen 7 2nd gen 2700X processor Gigabyte G1 8GB grapgic card VEGA 64
      running 2 nvme Samsung 256gb cards and 1 intel 180gb ssd internal and 1tb WD HDD, with 64 GB 3200Mhz Ram
       
      https://wa.me/919611736534 (whatsapp)
×