F36 MBP 2011/2012 very slow wake from sleep

trying to resurect an old MacBook Pro 15 2011 (macbookpro8,2) with defective AMD Radeon graphics using Fedora 36 Workstation.

like it’s documented here, there’s an EFI variable in place forcing Intel graphics, the defective Radeon chip is disabled with a series of grub kernel flags and outb commands. additionally I blackilisted the radeon kernel driver. sensors reports that the chip emits no heat and that the device isn’t present (lspci), so everything is good. clean install passed without issues, btrfs unencrypted, enabled RPMFusion and installed broadcom-wl.

the problem is the laptop takes an insane amount of time to wake from sleep, it’s between 2 and 6 minutes! the laptop sleeps normally, and starts the breathing light. when I wake the laptop (open lid/press key/press power) the blinking light goes out, the fans start… and then there’s X minutes of nothing; at first I thought it doesn’t wake at all. finally, the keyboard and display backlight come on and after a second or two the lock screen appears. journal messages confirm there’s no activity during those X minutes of darkness, the log continues when the lock screen comes on; no change between stock and current kernel. googling showed that this was happening with Fedora 34/35 and MBP 2012 and 2015 with same symptoms.

I’ve recently came accross a MBP 2012 Retina (HD4000 + GT650M) and the same issue persist, with and without the Nvidia GPU.

I’ve tried a fresh install of Linux Mint (5.4 kernel) and Ubuntu 22.04 (5.15 kernel), wake is instantaneous with the same setup as above, so this is some Fedora specific thing. any ideas what to look for?

Welcome to ask.:fedora:edora @some-random

It looks like that you compare apples with pears.
Linux mint uses the 5.4 Kernel and Fedora uses 5.18.11.
If you want to compare, and contribute to a solution, please do it with distributions who use same kernel version. Else you cant really say it is a fedora specific thing.

As a work around i propose you to shutdown instead of hibernate. You can also set your system so that when you close your laptops lid it shuts down.

You will save startup time as long as your problem exists.

And if you not had time yet, please read the #start-here section for your next request.

Can you verify if it is going to sleep or hibernating? These wake times make sense if it’s hibernating to a spinning disk.

as mentioned, this goes back to F34/35, so this is happening with 5.15 and below kernels, and one of those is in Ubuntu 22.04. thanks for the suggestion, but shutting down a laptop multiple times per day is not a solution.

the laptop is sleeping and it has an SSD. I have another MBP 2012 (also SSD) that behaves identically and also a non-Apple laptop (Skylake) that sleeps and wakes instantaneosly, so I doubt the Macbooks got somehow switched to suspend-to-disk.

edit: as far as I know, suspend to disk isn’t enabled by default and /etc/systemd/sleep.conf is nominal.

edit 2: installed 5.18.14 in ubuntu 22.04, wakes normally.

I have this issue since 34/35, i3-5005 laptop.

Hi, How much Ram are you running on your system? And did you create a partition for swap that’s at least 10 GB? I’m on a 2011 and can confirm a kernel update might solve your issue.

8gb, but i did have swapiness set to not utilise the hdd, but i will adjust this and test (had forgotten i did this).

1 Like

Okay, yes, swappiness to like 20 or 30 for improvement. I saw a YouTube Video and did mine as well.

I have 16 GB and haven’t created any swap partitions, the default F36 automatic install setup with btrfs. you’re saying I should create a swap partition and modify vm.swapiness and this goes away?

Yes 10 - 20 GB is okay for that if your running out of space go for 10GB. You can also check this YouTube video for tips on how to reduce swappiness. It will reduce the writing of swap to disk.

Please do not post youtube videos here. Links are fine, but the video itself is discouraged.

1 Like

yeah, tried it, no change. how would this fix the issue?

I have the same vanilla install on a Dell Latitude 5270, HP Elitebook 840 G3 and Lenovo Thinkpad T490, they also have no swap partition/file and yet they wake without issue.

Thank you, so sorry I just posted the link, but I think the default setting of the forum is to display it. Can you let me know how I can avoid this next time? Is it by using hyperlink from the editor.

Obviously it is.

1 Like

Oh Dude!

I’m running Fedora 35 / KDE on my iMac 27" mid 2012 because my Graphics Card broke!

Apparently if you issue this command in the Mac Bios by pressing CTRL+S when booting:

nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00

it’ll apparently disable the graphics card. I’m running on the integrated GPU and YouTube works fine.

Also, I disabled SWAP on my system as I have 32GB of RAM with the following:
sudo yum remove zram-generator-defaults
sudo swapoff -a

and then edit your /etc/fstab file and delete the whole line that refers to SWAP… then restart.
It’s open to debate if you even need the SWAP partition…

Have a look at your power management settings.
On my Lenovo X1 there was a ‘On Lid Close’ option that controlled the actions.
Hope this helps.

1 Like

thanks for trying to help, but as stated in the OP the nvram variable is in place, there are additional tweaks and everything is in order GPU-wise. the same setup works without issues with Ubuntu and I have other Macbooks that don’t have a disabled GPU and the issue persists.

as to the swap thing, that’s a misdirection from one of the commentors, there is no swap file or partition in F36, it uses zram and thus no disk swapping takes place.

I’ve just tried booting off the USB installer and trying suspend-wake there. it wakes in about 10-15 seconds, so way faster than with a disk installation, but it’s still not comparable to a normal wake in Ubuntu or macOS.

edit: tried it again (suspend-wake when booted off the USB installer), it wakes in 1m10s :frowning:

edit 2: recent reddit post about a Macbook Pro 2012 also with broken wake.