Contribute
Register

Instant darkwake after sonoma - i7-10700k, Gigabyte B460, RX580

Joined
Nov 27, 2012
Messages
97
Motherboard
MSI Pro Z690-A WiFi DDR5
CPU
i9-12900K
Graphics
RX 6600
Mac
  1. MacBook Pro
  2. Mac Pro
Mobile Phone
  1. iOS
I am experiencing two issues after upgrading to Sonoma. It was running flawlessly in Ventura, Mojave, etc.
  • Darkwake every 1 hr after upgrading to Sonona.
  • Instant darkwake after sleep after adding Rx580.
I guess if it's because of (1) a hardware issue/fault (2) something that I'm missing (3) something else.

The configuration is;
  • i7-10700K
  • Gigabyte B460 Aorus Pro WiFi Motherboard
  • Gigabyte Radeon RX 580 8GB
  • Intel I-225V LAN
  • Apple VTD enabled in Opencore. Intel VT-d enabled in BIOS.
  • Internal iGPU UHD630 is enabled but the monitor is connected to the RX 580.
  • Opencore 0.9.5, and other kexts are all up-to-date.
I disabled onboard WiFi(Intel WiFi with Airportitlwm.kext) and bluetooth(BlueToolFixup.kext, IntelBluetoothFirmware.kext, Intel BTPacher.kext) to isolate the issue, but the result was the same. So, I guess they are not related to the issue.

pmset -g gives;
standby 1
Sleep On Power Button 1
womp 0
hibernatefile /var/vm/sleepimage
proximitywake 0
powernap 0
networkoversleep 0
disksleep 40
standbydelayhigh 86400
sleep 120 (sleep prevented by sharingd)
hibernatemode 0
ttyskeepawake 1
displaysleep 30
highstandbythreshold 50
standbydelaylow 86400

pmset -g log | grep -e "Sleep.*due to" -e "Wake.*due to" gives;
...
2023-10-03 11:09:39 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 46 secs
2023-10-03 11:10:25 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 33 secs
2023-10-03 11:10:58 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 45 secs
2023-10-03 11:11:43 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 35 secs
2023-10-03 11:12:18 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 45 secs
2023-10-03 11:13:03 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 29 secs
2023-10-03 11:13:32 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 45 secs
2023-10-03 11:14:17 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 31 secs
2023-10-03 11:14:48 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 45 secs
2023-10-03 11:15:33 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 28 secs
2023-10-03 11:16:01 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 45 secs
2023-10-03 11:16:46 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 28 secs
2023-10-03 11:17:14 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 45 secs
2023-10-03 11:17:59 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 34 secs
2023-10-03 11:18:33 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 46 secs
2023-10-03 11:19:19 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 34 secs
2023-10-03 11:19:53 -0400 DarkWake DarkWake from Normal Sleep [CDN] : due to PEG1 PEG2/ Using AC (Charge:0%) 45 secs
2023-10-03 11:20:38 -0400 Sleep Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 4 secs
...

boot-args in the opencore is set to keepsyms=1 debug=0x100 vm_compressor=2
 
Last edited:
What I tested more.
  • iGPU disabled, enabled => same.
  • Hardware issue => Win11 runs, sleeps, wakes up well.
  • boot-args => tested agdpmod=pikera. same.
  • Removed Rx580 => sleep well. (as long as instant wake up doesn't happen.)
It means Rx580 is causing the issue. The darkwake every 1 hour happens regardless the Rx580. It's Gigabyte Rx580 8GB.
 
Update: I guess I'm the only one on this boat.

PEG0 is used by Radeon GPU card. But PEG1 and PEG2 is not used at all. IOregistry and DSDT shows it's not connected to any services at all. But it triggers the darkwake. DSDT is;

PHP:
External (_SB_.PCI0.PEG1, DeviceObj)
    External (_SB_.PCI0.PEG1.HPME, MethodObj)    // 0 Arguments
    
    Scope (_SB)
    {
        Device (PCI0)
        {
            ...
            
            Device (PEG1)
            {
                Name (_ADR, 0x00010001)  // _ADR: Address
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (PICM)
                    {
                        Return (AR02) /* \_SB_.AR02 */
                    }

                    Return (PD02) /* \_SB_.PD02 */
                }

                Device (PEGP)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                }
            }

            Device (PEG2)
            {
                Name (_ADR, 0x00010002)  // _ADR: Address
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (PICM)
                    {
                        Return (AR03) /* \_SB_.AR03 */
                    }

                    Return (PD03) /* \_SB_.PD03 */
                }

                Device (PEGP)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                }
            }
            
            ...
        }
    }
        
    Scope (_GPE)
    {
        Method (NTFY, 2, Serialized)
        {
                ...
                
                ElseIf ((Arg1 == 0x02))
                {
                    Switch (ToInteger (Arg0))
                    {
                        Case (One)
                        {
                            Notify (\_SB.PCI0.PEG0, Zero) // Bus Check
                        }
                        Case (0x02)
                        {
                            Notify (\_SB.PCI0.PEG1, Zero) // Bus Check
                        }
                        Case (0x03)
                        {
                            Notify (\_SB.PCI0.PEG2, Zero) // Bus Check
                        }

                    }
                }
                ...
        }
    }

Maybe, I need to disable PEG1 and PEG2 but I don't know how?
 
Update: I guess I'm the only one on this boat.

PEG0 is used by Radeon GPU card. But PEG1 and PEG2 is not used at all. IOregistry and DSDT shows it's not connected to any services at all. But it triggers the darkwake. DSDT is;

PHP:
External (_SB_.PCI0.PEG1, DeviceObj)
    External (_SB_.PCI0.PEG1.HPME, MethodObj)    // 0 Arguments
   
    Scope (_SB)
    {
        Device (PCI0)
        {
            ...
           
            Device (PEG1)
            {
                Name (_ADR, 0x00010001)  // _ADR: Address
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (PICM)
                    {
                        Return (AR02) /* \_SB_.AR02 */
                    }

                    Return (PD02) /* \_SB_.PD02 */
                }

                Device (PEGP)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                }
            }

            Device (PEG2)
            {
                Name (_ADR, 0x00010002)  // _ADR: Address
                Method (_PRT, 0, NotSerialized)  // _PRT: PCI Routing Table
                {
                    If (PICM)
                    {
                        Return (AR03) /* \_SB_.AR03 */
                    }

                    Return (PD03) /* \_SB_.PD03 */
                }

                Device (PEGP)
                {
                    Name (_ADR, Zero)  // _ADR: Address
                }
            }
           
            ...
        }
    }
       
    Scope (_GPE)
    {
        Method (NTFY, 2, Serialized)
        {
                ...
               
                ElseIf ((Arg1 == 0x02))
                {
                    Switch (ToInteger (Arg0))
                    {
                        Case (One)
                        {
                            Notify (\_SB.PCI0.PEG0, Zero) // Bus Check
                        }
                        Case (0x02)
                        {
                            Notify (\_SB.PCI0.PEG1, Zero) // Bus Check
                        }
                        Case (0x03)
                        {
                            Notify (\_SB.PCI0.PEG2, Zero) // Bus Check
                        }

                    }
                }
                ...
        }
    }

Maybe, I need to disable PEG1 and PEG2 but I don't know how?
probably easier to zip and upload your EFI

agdpmod=pikera is not needed for your AMD card
 
probably easier to zip and upload your EFI

agdpmod=pikera is not needed for your AMD card
Here is the EFI.zip.

I tested with three graphics cards,
  • Internal iGPU UHD 630 => No instant darkwake. (Darkwake every 1hr by RTC/Maintenance after upgrading Sonoma).
  • Radeon RX 580 => Instant darkwake by PEG1 PEG2
  • Radeon RX 6600 => Instant darkwake by PEG1 PEG2
The GPU causes the instant darkwake but the GPU is inserted in PEG0, neither PEG1 nor PEG2. I hate this motherboard (Gigabyte B460 Aorus Pro WiFi).

As a temporary solution, I removed the GPU. It still wakes up every hour. It happened after upgrading to Sonoma.

Code:
2023-10-05 23:36:57 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 0 secs   
2023-10-05 23:36:57 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 3323 secs
2023-10-06 00:32:20 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 45 secs   
2023-10-06 00:33:05 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 295 secs 
2023-10-06 00:38:00 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 0 secs   
2023-10-06 00:38:00 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 3664 secs
2023-10-06 01:39:04 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 46 secs   
2023-10-06 01:39:50 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 3615 secs
2023-10-06 02:40:05 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 0 secs   
2023-10-06 02:40:05 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 12003 secs
2023-10-06 06:00:08 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 46 secs   
2023-10-06 06:00:54 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 1733 secs
2023-10-06 06:29:47 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 0 secs   
2023-10-06 06:29:47 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 7261 secs
2023-10-06 08:30:48 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 45 secs   
2023-10-06 08:31:33 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 831 secs 
2023-10-06 08:45:24 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 0 secs   
2023-10-06 08:45:24 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 2789 secs
2023-10-06 09:31:53 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 45 secs   
2023-10-06 09:32:38 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 3615 secs
2023-10-06 10:32:53 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 0 secs   
2023-10-06 10:32:53 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 3663 secs
2023-10-06 11:33:56 -0400 DarkWake                DarkWake from Normal Sleep [CDN] : due to RTC/Maintenance Using AC (Charge:0%) 45 secs   
2023-10-06 11:34:41 -0400 Sleep                   Entering Sleep state due to 'Maintenance Sleep': Using AC (Charge:0%) 491 secs
 

Attachments

  • EFI.zip
    16.1 KB · Views: 44
  • DSDT.zip
    89.1 KB · Views: 31
Last edited:
Here is the options that I can choose now.
  1. Disable PEG1 PEG2 with DSDT/SSDT patch (Pros: best. Cons: I don't know how).
  2. Live with the iGPU (Pros: simple. Cons: slow iGPU)
  3. Replace the motherboard to other Z490 board (Pros: cost effective(+$50). Cons: no gain at all)
  4. Upgrade the motherboard/cpu/ram to i9-12900K/Z690/DDR5 (Pros: small performance gain. Cons: not cost effective(+$150))
I wish I could go to #1 but I don't know how. Any advice?
 
You have probably seen that this problem can be caused by Bluetooth, USB devices and is reported even with Apple ARM devices.
I have a comet lake i7f, Gigabyte 580 and MSI 490 mobo.
Not seeing your problem. So far.
Suggestions:
Turn off the integrated graphics at BIOS level. You don't need it in macOS or Windows. The 580 is a very capable GPU even in 2023.
Turn off Intel VT-d.
Redo the EFI with an automated approach. OC Configurator has worked well for me. Easy to miss a minor setting or two doing EFI manually.
Exclude your Bluetooth device if you have one.
Review what is plugged into the USB ports, consider revising your USB kext.
 
You have probably seen that this problem can be caused by Bluetooth, USB devices and is reported even with Apple ARM devices.
I have a comet lake i7f, Gigabyte 580 and MSI 490 mobo.
Not seeing your problem. So far.
Suggestions:
Turn off the integrated graphics at BIOS level. You don't need it in macOS or Windows. The 580 is a very capable GPU even in 2023.
Turn off Intel VT-d.
Redo the EFI with an automated approach. OC Configurator has worked well for me. Easy to miss a minor setting or two doing EFI manually.
Exclude your Bluetooth device if you have one.
Review what is plugged into the USB ports, consider revising your USB kext.
That's a great guide. I will try... Many thanks.
 
Here is the options that I can choose now.
  1. Disable PEG1 PEG2 with DSDT/SSDT patch (Pros: best. Cons: I don't know how).
  2. Live with the iGPU (Pros: simple. Cons: slow iGPU)
  3. Replace the motherboard to other Z490 board (Pros: cost effective(+$50). Cons: no gain at all)
  4. Upgrade the motherboard/cpu/ram to i9-12900K/Z690/DDR5 (Pros: small performance gain. Cons: not cost effective(+$150))
I wish I could go to #1 but I don't know how. Any advice?
I opted for option 4, which is switching to a different system. The Gigabyte B460 aorus pro was an excellent board, but it had several issues, such as RP04 and PEG1 PEG2. I managed to fix the RP04 problem, but I gave up on the PEG1 PEG2 issue.

The new system (MSI Pro Z690-A WIFI Pro and i9-12900K along with RX 6600) performs well and has no trouble with sleep and wake functions. I got a good deal on the bundle at MicroCenter, so the upgrade did not cost me much.
 
Back
Top