Jump to content
Mieze

Tracing back the AMD GPU wakeup issue to its origin

361 posts in this topic

Recommended Posts

Advertisement

Now all we need is a multi monitor fix for more then 2 monitors 

Share this post


Link to post
Share on other sites

awesome work.

Would this work for an RX 580 in an Egpu?

Yes, it should work with the Polaris GPUs too.

 

PS: It would be helpful if someone with a Polaris GPU could send me a dump of the GPU's PCI config space created with lspci (or RW-everything under Windows, etc.) so that I can verify the Base Address Register layout.

 

Mieze

Share this post


Link to post
Share on other sites

Yes, it should work with the Polaris GPUs too.

 

PS: It would be helpful if someone with a Polaris GPU could send me a dump of the GPU's PCI config space created with lspci (or RW-everything under Windows, etc.) so that I can verify the Base Address Register layout.

 

Mieze

Hello Mieze!

Good work you began!

This dump contains lspci dump and more for Polaris GPU   #35  

 

We have three issues with Radeon drivers in HackOS

1. Bad GPU registers initialisation. Hope you resolved this.

2. Bad connectors in PC Videocard compared to Apple's framebuffer. If we set Inject=NO then Apple's driver calculates connectors by itself. But not enough for multimonitors.

3. Bad AMDRadeonX4000GLDriver.bundle (not for Hack). It can't be patched by Clover because it is loaded from user space. I may propose to create better bundle with name like AMDRadeonX4001GLDriver.bundle and patch the name somewhere it used.

Share this post


Link to post
Share on other sites

Great work, Mieze

Thank you for sharing your findings

The patch works perfectly on Sapphire Radeon RX580 Nitro+!!

I don't even need to disable IGPU in BIOS, disabling CSM and setting the IGPU as a primary display is enough

The 4K screen is connected to the  Radeon card and I can boot with all debug messages shown on the screen+ Apple Logo  :hysterical:

I can go to sleep - and wake up. 

:thumbsup_anim:

Share this post


Link to post
Share on other sites

Yes, it should work with the Polaris GPUs too.

 

PS: It would be helpful if someone with a Polaris GPU could send me a dump of the GPU's PCI config space created with lspci (or RW-everything under Windows, etc.) so that I can verify the Base Address Register layout.

 

Mieze

Tell me how you do it and I can dump it for you on my MP5,1 with RX 480

Hope this helps

DarwinDumper_3.0.3_21.10_21.46.29_MacPro5,1_Apple_X64_Unknown_17A405_henrybrock.zip

Share this post


Link to post
Share on other sites

Tell me how you do it and I can dump it for you on my MP5,1 with RX 480

Hope this helps

Hello Pavo,

 

thank you for your friendly offer and the link but Slice already posted a link to this dump a few days ago.

 

Mieze

Share this post


Link to post
Share on other sites

I make little and cosmetic modification of your patch to add correct name, apply correct framebuffer and load custom rom. 

 

For rx 580

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

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        Store (Package (0x1C)
                            {
                                "AAPL,slot-name", 
                                Buffer (0x07)
                                {
                                    "Slot-4"
                                }, 

                                "@0,name", 
                                Buffer (0x0C)
                                {
                                    "ATY,Orinoco"
                                }, 

                                "@1,name", 
                                Buffer (0x0C)
                                {
                                    "ATY,Orinoco"
                                }, 

                                "@2,name", 
                                Buffer (0x0C)
                                {
                                    "ATY,Orinoco"
                                }, 

                                "@3,name", 
                                Buffer (0x0C)
                                {
                                    "ATY,Orinoco"
                                }, 

                                "@4,name", 
                                Buffer (0x0C)
                                {
                                    "ATY,Orinoco"
                                }, 

                                "ATY,Card#", 
                                Buffer (0x0C)
                                {
                                    "113-4E3531U"
                                }, 

                                "ATY,Copyright", 
                                Buffer (0x33)
                                {
                                    "(C) 1988-2017, AMD Technologies Inc."
                                }, 

                                "ATY,Rom#", 
                                Buffer (0x1D)
                                {
                                    "GV-RX580GAMING-8GD/F10/058AE"
                                }, 

                                "ATY,VendorID", 
                                Buffer (0x02)
                                {
                                     0x02, 0x10                                     
                                }, 

                                "ATY,DeviceID", 
                                Buffer (0x02)
                                {
                                     0xDF, 0x67                                     
                                }, 

                                "device_type", 
                                Buffer (0x12)
                                {
                                    "ATY,OrinocoParent"
                                }, 

                                "model", 
                                Buffer (0x13)
                                {
                                    "RX 580 G1 GIGABYTE"
                                }, 

                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }

                    Method (_INI, 0, NotSerialized)  // _INI: Initialize
                    {
                        If (LEqual (BAR5, Zero))
                        {
                            Store (BAR2, Local0)
                        }
                        Else
                        {
                            Store (BAR5, Local0)
                        }

                        OperationRegion (GREG, SystemMemory, And (Local0, 0xFFFFFFFFFFFFFFF0), 0x8000)
                        Field (GREG, AnyAcc, NoLock, Preserve)
                        {
                            Offset (0x6800), 
                            GENA,   32, 
                            GCTL,   32, 
                            LTBC,   32, 
                            Offset (0x6810), 
                            PSBL,   32, 
                            SSBL,   32, 
                            PTCH,   32, 
                            PSBH,   32, 
                            SSBH,   32, 
                            Offset (0x6848), 
                            FCTL,   32, 
                            Offset (0x6EF8), 
                            MUMD,   32
                        }

                        Store (Zero, FCTL)
                        Store (Zero, PSBH)
                        Store (Zero, SSBH)
                        Store (Zero, LTBC)
                        Store (One, GENA)
                        Store (Zero, MUMD)
                    }
                }

                Device (HDAU)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        Store (Package (0x02)
                            {
                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }

for r9 290x

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

                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        Store (Package (0x1A)
                            {
                                "AAPL,slot-name", 
                                Buffer (0x07)
                                {
                                    "Slot-1"
                                }, 

                                "@0,name", 
                                Buffer (0x0B)
                                {
                                    "ATY,Baladi"
                                }, 

                                "@1,name", 
                                Buffer (0x0B)
                                {
                                    "ATY,Baladi"
                                }, 

                                "@2,name", 
                                Buffer (0x0B)
                                {
                                    "ATY,Baladi"
                                }, 

                                "@3,name", 
                                Buffer (0x0B)
                                {
                                    "ATY,Baladi"
                                }, 

                                "ATY,Card#", 
                                Buffer (0x11)
                                {
                                    "113-C6710101-100"
                                }, 

                                "ATY,Copyright", 
                                Buffer (0x25)
                                {
                                    "(C) 1988-2017, AMD Technologies Inc."
                                }, 

                                "ATY,Rom#", 
                                Buffer (0x36)
                                {
                                    "C67101 HAWAII XT A0 GDDR5 4GB 64MX32 STILT MLU +37.5M"
                                }, 

                                "ATY,VendorID", 
                                Buffer (0x02)
                                {
                                     0x02, 0x10                                     
                                }, 

                                "ATY,DeviceID", 
                                Buffer (0x02)
                                {
                                     0xB0, 0x67                                     
                                }, 

                                "device_type", 
                                Buffer (0x11)
                                {
                                    "ATY,BaladiParent"
                                }, 

                                "model", 
                                Buffer (0x14)
                                {
                                    "R9 290X Asus MATRIX"
                                }, 

                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }

                    Method (_INI, 0, NotSerialized)  // _INI: Initialize
                    {
                        If (LEqual (BAR5, Zero))
                        {
                            Store (BAR2, Local0)
                        }
                        Else
                        {
                            Store (BAR5, Local0)
                        }

                        OperationRegion (GREG, SystemMemory, And (Local0, 0xFFFFFFFFFFFFFFF0), 0x8000)
                        Field (GREG, AnyAcc, NoLock, Preserve)
                        {
                            Offset (0x6800), 
                            GENA,   32, 
                            GCTL,   32, 
                            LTBC,   32, 
                            Offset (0x6810), 
                            PSBL,   32, 
                            SSBL,   32, 
                            PTCH,   32, 
                            PSBH,   32, 
                            SSBH,   32, 
                            Offset (0x6848), 
                            FCTL,   32, 
                            Offset (0x6EF8), 
                            MUMD,   32
                        }

                        Store (Zero, FCTL)
                        Store (Zero, PSBH)
                        Store (Zero, SSBH)
                        Store (Zero, LTBC)
                        Store (One, GENA)
                        Store (Zero, MUMD)
                    }
                }

                Device (HDAU)
                {
                    Name (_ADR, One)  // _ADR: Address
                    Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
                    {
                        Store (Package (0x02)
                            {
                                "hda-gfx", 
                                Buffer (0x0A)
                                {
                                    "onboard-1"
                                }
                            }, Local0)
                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                        Return (Local0)
                    }
                }

post-916820-0-24004600-1508706389_thumb.png

post-916820-0-42508500-1508706414_thumb.png post-916820-0-13936000-1508706431_thumb.png

post-916820-0-29941900-1508706475_thumb.png

Share this post


Link to post
Share on other sites

I make little and cosmetic modification of your patch to add correct name, apply correct framebuffer and load custom rom. 

 

Yes, iIt can be done this way but it's also possible to let Clover inject these properties. In the end, both methods lead to the same result. Nevertheless, thank you!

 

Mieze

Share this post


Link to post
Share on other sites

Yes, iIt can be done this way but it's also possible to let Clover inject these properties. In the end, both methods lead to the same result. Nevertheless, thank you!

 

Mieze

True, but clover can not load two defriend framebuffer selected by me.  

Share this post


Link to post
Share on other sites

Thank you Mieze

My RX 580 work fine

CSM disable, RX 580 Primary

Only one more thinks - add HDAU in DSDT for HDMI Audio

All great work! :)

Share this post


Link to post
Share on other sites

Just want to confirm, that Miezes patch from first post is working on my config as well. IGPU and CSM completely disabled in BIOS.

just have to make some "preperations" to make a tripple-monitor-setup working and some cosmetic changes as well,

as already Matthew82 has documented.

 

So now, i no longer nee LILU and WhatEverGreen kexts.

Thanx for another incredible work. Love it. Makes my Hackintosh so much easier.

Share this post


Link to post
Share on other sites

Really great, I'm working with two GPU r9 270x and r9 270, on an AMD fx platform, with InjectAti and Framebuffer Futomaki in Clover, and with LILU and WhatEverGreen in kexts 10.12/10.13

 

 

I do not have a selection for IGPU,

but only enable CSM and legacy Vbios,\and inserted inject Ati and Fbuffer into Clover

Mac Pro di carlo.zip

Schermata 2017-10-23 alle 00.19.21.png

Schermata 2017-10-23 alle 00.19.28.png

Schermata 2017-10-23 alle 00.19.28.png

Share this post


Link to post
Share on other sites

@Mieze

 

Thanks a lot for this great solution.

 

Does this method work on Legacy BIOS as well or it only applies to UEFI? 

 

I have an old GA-EP45-DS3R and a Sapphire 7790 GPU which was working with WheteverGreen and Lilu, but ever since macOS High Sierra it's not working anymore. I get the black screen.

 

Thanks again

Share this post


Link to post
Share on other sites

Confirmed working without Whatevergreen.kext on Sapphire Nitro+ RX 580 4GB, High Sierra (10.13). Used SSDT aml provided by slice in clover patched folder. With clover injection System information looks better (shows as RX 480). Without clover injection still works and shows as AMD R9 XXX. Might need some cosmetic DSDT patch to show correct information. Sleep works. I have:

 

1. CSM Disabled

2. IGPU enabled

3. Primary Display PEG

4. ig-platform-id for HD 630 as 0x59120003 for quicksync

5. Lilu.kext and IntelGraphicsFixup.kext for quicksync

 

Everything works fine including hardware decoding by HD 630. SMBIOS used iMac18,3

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   1 member

  • Similar Content

    • By BrianWong11031
      Hi, my hackintosh won't sleep!
      It often sleeps for 3-5 seconds and auto wakes up.
      sometimes it can't enter the sleep mode even you click the sleep button.
      I have uploaded my DSDT file.
      but I don't know how to patch DSDT.
      If you know how to solve this issue, please help me!
       
      Cheers,
      Brian
      DSDT.aml
    • By fusion71au
      Clover r4747 ISO compiled with GCC and minimal config.plist compatible for use in VMWare Workstation.
       
      Tested with unlocked Workstation 15 running OSX 10.9 -->10.14 guest in Windows X64 host.
       
      Installation
      1. Download and unzip "EFI_Clover_r4747 for VMware.zip". Mount Clover-v2.4k-4747-X64 by double clicking on it.
      2. Mount your VM's EFI System Partition eg in terminal
      sudo diskutil mount disk0s1   3. Copy EFI folder from step 1 into the EFI partition
      4. Shutdown the VM, add bios.bootDelay = "3000" to your VM's vmx file
      5. Reboot your VM, press <F2> to access the VMware Boot Manager and add CLOVERX64.efi to the boot menu.
       
      Substitute your own unique and valid MLB and ROM variables in the /EFI/CLOVER/config.plist (Rt Variables section) to activate iMessage/Facetime on your VM.
    • By superdooper71
      Hi all,
      I hope someone can help me as I am struggling with this bloody installation.
      I am running on several problems that I can't face : (
       
      First of all my config:
      Mobo: ASROCK H81M-DGS R2
      CPU: Intel Xeon E3-1220 v3 @3.10ghz
      RAM: 16gb DDR3 1600Mhz
      SSD: Crucial BX100 120Gb SSD
      Monitor: Hp 27w Hdmi
       
      POST Installation CLOVER
       
      Current Issues:
      • System will not boot (clover boot loader do not shows up) from SSD
         - System boot only with USB stick
      • Screen Resolution is only 1024x768
      • Monitor recognised as 17" instead of 24"
      • Monitor identified as secondary
      • Grafic Card Geforce GT710 shows 0 Mb
      • System info do not match Config.plistin Clover
       
      I attach screenshot of System Info, Kext in Clover, Resolution etc etc.
       
      Please can someonhelp me?
       
      Please can you tell me what is the Clover Parameter to activate when installing Clover  (Clover_v2.4k_r4722) into Boot Disk?
       
      I hope someone can help me out of this little troble: )
       
      Cheers
      Franco
       
      system info.tiff
      kext.tiff
      resolution.tiff
      system.tiff
      config.plist
    • By fantomas1
      Hi InsanelyMacaholics   

      Use this thread to link / talk about of the future Nvidia Web Driver updates for macOS Sierra.
       
      10.12.6
      Nvidia Web Driver - 378.05.05.25f11 --> build 16G1618 (thanks to Frank Nitty) New!
      Nvidia Web Driver - 378.05.05.25f10 --> build 16G1510 (thanks to BreBo) 
      Nvidia Web Driver - 378.05.05.25f09 --> build 16G1408 (thanks to BreBo)
      Nvidia Web Driver - 378.05.05.25f08 --> build 16G1314 (thanks to BreBo)
      Nvidia Web Driver - 378.05.05.25f07 --> build 16G1314 (thanks to haring)
      Nvidia Web Driver - 378.05.05.25f06 --> build 16G1212 (thanks to WeBeRiO)
      Nvidia Web Driver - 378.05.05.25f04 --> build 16G1114 (thanks to lukazm)
      Nvidia Web Driver - 378.05.05.25f03 --> build 16G1036 (thanks to Gradou)
      Nvidia Web Driver - 378.05.05.25f01 --> build 16G29 (thanks to Badruzeus)
       
       
      10.12.5
      Nvidia Web Driver - 378.05.05.15f01 --> build 16F73 (see this post)
       
       
      10.12.4
      Nvidia Web Driver - 378.05.05.05f02 --> build 16E195(thanks to crachmaster4999)
      Nvidia Web Driver - 378.05.05.05f01 --> build 16E195 (thanks to Moviemakergr)  Pascal support!!!
      Nvidia Web Driver - 367.15.10.45f01 --> build 16E195 (thanks to Lanc)
       
       
      10.12.3

      Nvidia Web Driver - 367.15.10.35f01 --> build 16D32 (thanks to shatterhenner)
       
       
      10.12.2
      Nvidia Web Driver - 367.15.10.25f02 --> build 16C68 (see this post)
      Nvidia Web Driver - 367.15.10.25f01 --> build 16C67 (see this post)
      Nvidia Web Driver - 367.15.10.25b06 --> build 16C60b/16C63a (see this post)
       
       
      10.12.1
      Nvidia Web Driver - 367.15.10.15f03 --> build 16B2657/16B2659 (thanks to Moviemakergr).
      Nvidia Web Driver - 367.15.10.15f01 --> build 16B2555 (thanks to Moviemakergr)
       
       
      10.12.0
      Nvidia Web Driver - 367.15.10.05f01 --> build 16A323 (thanks to phi777)
       
       
      GM
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A323 (same driver since DP4/PB3)
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A322 (see this post)
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A320 (see this post)
       
       
      DP/PB
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A313a (DP8 & PB7) (see this post)
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A304a (DP7 & PB6) (see this post)
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A294a (DP6 & PB5) (see this post)
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A286a (DP5 & PB4) (see this post)
      Nvidia Web Driver - 367.10.10.05b01 --> build 16A270f (DP4 & PB3) (thanks to TheRacerMaster)
      Nvidia Web Driver - 367.05.10.05b07 --> build 16A254g (DP3 & PB2) (see this post)
      Nvidia Web Driver - 367.05.10.05b07 --> build 16A238m (PB1) (thanks to Faun) 
      Nvidia Web Driver - 367.05.10.05b07 --> build 16A239j (DP2) (thanks to Faun)
      Nvidia Web Driver - 367.05.10.05b03 --> build 16A201w (DP1) (thanks to Xmedik)
       
×