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 mikmavros
      Thanks for accepting
      I recently installed Sierra  and I encounter the following problem ... When I restart or I start up my machine return to BIOS. If anyone knows and can any help be valuable Thank you very much. (When I boot from a Capitan disk in the same machine all  is running well.) Both discs with Clover in Legacy mode.
      gigabyte z68x-ud5-b3 F8
      I7 2600K
      GT 620 ( την βλέπει κανονικά χωρίς Web drivers)
      16 GB ddr3 1600 


    • By DiddyKong
      Fully optimizing DSDT & SSDT for OS X Sierra POST INSTALL on a Dell345MT with a i7 - 920(first gen) 
       
      I have scoured the web, went to insanelymac chat on discord, no one replies to me but will reply to others, idk if my question is too advanced or too easy. 
       
      I know how this forum feels about 3rd party software, but that was just a crutch, I'm 100% vanilla now which is why I'm now posting for help because I eliminated the possibility having to do with 3rd party. Anyways, with that said I just have a couple things I want to be sure of.
       
      I used a n---bistro to get a App Store copy of Sierra, as I didn't know there were other ways of getting it now from a windows10 machine. anyways, I was able to build a vanilla usb. I couldn't figure the EFI out on my vanilla Sierra-usb, but the EFI on the usb-ni---bistro I had would boot my pre-install and post-install. so I was able to install Sierra. After a few days of figuring out how to remake a EFI and config, I broke my EFI.
       
      So back to my windows10 SSD and I found BootDiskUtility, and that made a EFI usb with the newest version of clover(r4895). So then swapped SSDs back to my OS X, plugged in the BDU-usb, after trial and error I got back into my Sierra. Now with the newest version of clover and no traces of ni---bistro anymore. Then copied the BDU-usb to my SSD EFI and was able to boot without a usb again!! YAY.
       
      Then starting working on fixing my web drivers for my gtx 1050 2gb. Installed the os update so i'm at 10.12.6, pulled my hair out figuring out the web drivers, eventually got them installed and the cuda fixed.
       
      Now all 3 of my screens work, yet windows can't sit 'between' screens, I just simply haven't looked for that fix yet as I want the sys itself running like a top first.
      My screen saver works, I don't get stuck in screensaver, I did once before, I believe lilu.kext and whatevergreen.kext fixed that.
      Now with all that I felt it was time to give my config.plist a diet cos it was bloated, I generated a config copied the clover settings check for check instead of coping text cos I'm trying to shrink it.
      Config.plist boots my system with DSDT-1FE7B5D7
       
      So that last thing on the list of optimizing I feel would be a 100% correct DSDT and SSDT cos then I could use a blank config.plist with my patched DSDT & SSDT correct
       
      but with the patching part that I think I understand how to do it now, but when I extract with F4 every file has RSDT in front of it, I have one that says RSDP.aml and RSDT.aml
      so would I just erase the RSDT from the beginning of each file then go from their, which would then leave me with a DSDT.aml and 17 SSDTs
       
      so if thats correct I would then decompile with iasl patch and compile and put the patched files into EFI/CLOVER/ACPI/Patched/
       
      also how do I know if everything is patched correctly? like if my CPU is fully working and not just sorta working that way when I start running software like photoshop, unity, 10 chrome tabs, my hackintosh doesn't crash
       
      Thanks to anyone that can help me out, I've been working on my system for about two weeks and this is basically the wall I finally can't seem to figure out how to pass

    • 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

×