Jump to content
Mieze

Tracing back the AMD GPU wakeup issue to its origin

365 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

with the patch, on Sapphire nitro+ RX 580 I can get the machine to work on single monitor, however, dual monitor is still not working. dual monitor didn't work with whatevergreen.kext too. Dual monitor works on 10.12.6 but second monitor fails to get signal in 10.13. 

(both monitor connected to DP ports, where ports are DP,DP,HDMI,HDMI, DDVI, both monitor are 4k monitor). 

 

I know some of us have same or similar card and working dual monitor setup. It would be of great help if anyone can give me directions to get my setup working. 

 

Thanks.

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 Coddyx
      Hi,
       
      I followed the AMD OSX Vanilla Guide and managed to successfully build my first hackingtosh.
      Everything works great EXCEPT for my MSI - Radeon RX 580 8 GB GAMING X.
      I ran some benchmarks (and tried World of Warcraft) and I am getting ~50% of the performance I am usually getting in Windows 10.
      Unigine Heaven reports ~950 vs 1750 in Windows and World of Warcraft runs @ 30 fps lowest settings vs 60 fps ultra settings in Windows.
       
      Here are the kexts I am using:
      AppleALC Lilu NullCPUPowerManagement RealtekRTL811 VirtualSMC WhateverGreen  
      I should mention that this is an AMD hackingtosh running on Ryzen 5 1600 3.2 GHz 6-Core Processor.
       
      I read and I completely understand that I should not expect 100% performance. But I believe a 50% drop is out of the ordinary.
       
      If anyone has ideas on what I could try to up the performance it would be greatly appreciated.
       
      Thank you!
       
       
    • By fusion71au
      Clover r4961 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_r4961 for VMware.zip". Mount Clover-v2.4k-4961-X64.iso 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 MaLd0n
      Now have a Olarila app, just download app and clover folder for your Chipset! https://olarila.com/forum/viewtopic.php?f=81&amp;t=6771   Nehalem, SandyBridge, IvyBridge, Haswell, Broadwell     Skylake, Kabylake and Coffeelake is here http://www.insanelymac.com/forum/topic/321872-guide-sierra-on-gigabyte-mobos-serie-200-kabylake-dsdt/   Install MacOS with Olarila Image, Step by Step, Install and Post Install
       
      https://olarila.com/forum/viewtopic.php?f=50&t=8685
        Mojave Full DSDT patch   http://olarila.com/forum/viewtopic.php?f=59&amp;t=6428   First...   ***Update bios to last available version!***   If you need a full patched DSDT...  -Extract tables with F4 key in Clover boot screen! -Run it and send me files! RunMe.app   Installation   --Create a bootable copy of macOS Sierra / High Sierra / Mojave   https://github.com/chris1111/Create-Install-Media/releases   --Install Clover in USB stick   https://sourceforge.net/projects/cloverefiboot/files/Installer/   --Replace with my Clover folder https://olarila.com/files/Clover.Folder/CLOVER.SERIES.CHIPSET.zip   --Install Sierra/High Sierra and boot into system!   Post Installation --Install Clover and replace with my folder   https://olarila.com/files/Clover.Folder/CLOVER.SERIES.CHIPSET.zip   --Reboot and activate video!   Bingo!   Now you need a fine tune! DSDT time!   --DSDT   Patches -FIX ERRORS AND WARNINGS -HPET -SATA -DMAC -SLPB -DARWIN -LPC -XHCI -PLUGIN TYPE -XXXX to HDEF -HDEF -RTC -IRQs -SBUS -BUS1 -MCHC -ALS0 -SHUTDOWN -LAN -USBX -PMCR -EC -PNLF -HDMI
       
      --Power Management
      - 1 Generation Intel Processors, use Generate P and C States in config.plist
      - 2 and 3 Generations Intel Processors, Generate SSDT with Piker script and drop CpuPm and Cpu0Ist SSDTs
      ssdtPRGen.command.zip
      Credits-https://github.com/Piker-Alpha/ssdtPRGen.sh
      - 4 Generation+ Intel Processors, use PluginType=1 in DSDT, SSDT or Clover config.plist
       
      for check Power, Frequency, Temperature and Utilization, use it
       
      Install Intel Power Gadget.pkg.zip
       
      --Brightness
      Install .app, select the required permission and reboot. Work in F1 / F2 keys!
      NativeDisplayBrightness.app.zip


      https://github.com/Bensge/NativeDisplayBrightness/releases
      *in some cases .app don't work, check patches in config.plist inside Clover folder Post Install
       
      --Clover
       
      https://sourceforge.net/projects/cloverefiboot/files/Installer/
       
      --AUDIO
       
      Use DSDT + AppleAlc
       
      --install Lan driver by Mieze
        -Atheros   http://www.insanelymac.com/forum/files/file/313-atherose2200ethernet/   -Intel   http://www.insanelymac.com/forum/files/file/396-intelmausiethernet/   -Realtek   http://www.insanelymac.com/forum/files/file/88-realtekrtl8111-binary/   --Links   -FakeSMC   https://bitbucket.org/RehabMan/os-x-fakesmc-kozlek   -Audio   https://github.com/vit9696/AppleALC http://www.insanelymac.com/forum/topic/314406-voodoohda-289/   -USB   https://bitbucket.org/RehabMan/os-x-usb-inject-all/downloads   It's time to Rock   -Credits and thanks to the old and new people in the community who developed patches, kexts and bootloaders!   Apple, Slice, Kabyl, usr-sse2, jadran, Blackosx, dmazar, STLVNUB, pcj, apianti, JrCs, pene, FrodoKenny, skoczy, ycr.ru, Oscar09, xsmile, SoThOr, RehabMan, Download-Fritz, Zenit432, cecekpawon, Intel, Oracle, Chameleon Team, crazybirdy, Mieze, Mirone, Oldnapalm, netkas, Elconiglio, artut-pt, ErmaC, Pavo, Toleda, Master Chief and family, bcc9, The King, PMheart, Sherlocks, Micky1979, vit9696, vandroiy2013, Voodoo Team, Pike R. Alpha, lvs1974, Austere.J, CVad and many, many, many others!   We're all here to have fun and learn from each other!  
×