DEV Community

Kamran Khan
Kamran Khan

Posted on • Edited on

😴 Get Deeper Sleep on Fedora: Optimizing Suspend-to-RAM

If you're running Fedora on a laptop or desktop, you might have noticed your system defaulting to a lighter sleep state (s2idle) instead of the power-saving "deep sleep" (S3 Suspend-to-RAM). This can lead to faster battery drain and more warmth when suspended.

In this guide, you'll learn how to:

  • βœ… Verify if your system supports "deep" suspend
  • βš™οΈ Configure Fedora to use "deep" suspend by default
  • πŸ› οΈ Add NVIDIA suspend/resume fix (optional)
  • πŸ› οΈ Apply MSI/ASUS-specific ACPI tweak (optional)
  • πŸ” Understand the difference between sleep states

🎯 What is "Deep Sleep" (S3 Suspend)?

In the world of ACPI (Advanced Configuration and Power Interface), "deep sleep" typically refers to the S3 suspend state (Suspend-to-RAM). In this state:

  • The CPU, chipset, and most other components are powered down.
  • The RAM (Random Access Memory) remains powered to retain your session data.
  • The system consumes minimal power, making it ideal for battery life.
  • Resuming from S3 is fast, usually taking only a few seconds.

Fedora, by default, often uses s2idle (Suspend-to-Idle), which keeps more components powered on, consuming more energy, especially in modern hardware. While it's slightly faster to resume, S3 offers better power savings for true "deep sleep."


βœ… Step 1: Verify "Deep Sleep" Support

Run:

cat /sys/power/mem_sleep
Enter fullscreen mode Exit fullscreen mode

Example output:

[s2idle] deep
Enter fullscreen mode Exit fullscreen mode
  • If deep is present, your system supports S3 suspend.
  • If it’s missing, check your BIOS/UEFI for power settings (sometimes called ACPI S3 or Legacy Sleep).

βœ… Step 2: Configure Fedora for "Deep Sleep"

  1. Edit the sleep config:
   sudo nano /etc/systemd/sleep.conf
Enter fullscreen mode Exit fullscreen mode
  1. Add the lines:
   [Sleep]
   SuspendState=mem
   MemorySleepMode=deep
Enter fullscreen mode Exit fullscreen mode
  1. Save & exit, then reboot:
   sudo reboot
Enter fullscreen mode Exit fullscreen mode

After this, suspend should now default to deep sleep (S3).


🟒 Step 3 (Optional, NVIDIA users): Add GPU Resume Fix

On systems with NVIDIA GPUs, you may experience black screens after resume. NVIDIA provides a kernel option to preserve VRAM allocations across suspend.

  1. Open GRUB config:
   sudo nano /etc/default/grub
Enter fullscreen mode Exit fullscreen mode
  1. Find the line starting with GRUB_CMDLINE_LINUX= and add this at the end (inside the quotes):
   nvidia.NVreg_PreserveVideoMemoryAllocations=1
Enter fullscreen mode Exit fullscreen mode

Example:

   GRUB_CMDLINE_LINUX="rhgb quiet mem_sleep_default=deep nvidia.NVreg_PreserveVideoMemoryAllocations=1"
Enter fullscreen mode Exit fullscreen mode
  1. Rebuild GRUB and reboot:
   sudo grub2-mkconfig -o /boot/grub2/grub.cfg
   sudo reboot
Enter fullscreen mode Exit fullscreen mode

This helps the NVIDIA driver restore graphics properly after suspend.


🟠 Step 4 (Optional, MSI/ASUS laptops): ACPI Compatibility Tweak

Some MSI and ASUS laptops expose different suspend/resume behaviors depending on which OS they think is running. By default, Linux identifies itself as β€œLinux”, which may not unlock all ACPI features.

You can trick the firmware into using the same code paths as Windows 10/11 by adding:

acpi_osi=! acpi_osi="Windows 2020"
Enter fullscreen mode Exit fullscreen mode

to your kernel command line.

  1. Open GRUB config:
   sudo nano /etc/default/grub
Enter fullscreen mode Exit fullscreen mode
  1. Update GRUB_CMDLINE_LINUX, for example:
   GRUB_CMDLINE_LINUX="rhgb quiet mem_sleep_default=deep nvidia.NVreg_PreserveVideoMemoryAllocations=1 acpi_osi=! acpi_osi=\"Windows 2020\""
Enter fullscreen mode Exit fullscreen mode
  1. Rebuild GRUB and reboot:
   sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
   sudo reboot
Enter fullscreen mode Exit fullscreen mode

⚠️ Note:
This tweak is most useful on MSI and ASUS laptops that have issues resuming from suspend. If it causes problems (rare), just remove it again.


πŸ”’ Understanding Sleep States (Briefly)

  • S0 (Working): Fully on.
  • S0ix (Modern Standby / s2idle): Low-power idle; fast resume but higher drain.
  • S3 (Suspend-to-RAM): Only RAM stays powered; lowest power, fast resume.
  • S4 (Hibernate): Saves memory to disk; no power use, slower resume.
  • S5 (Soft Off): Full shutdown.

πŸ“Œ TL;DR Cheatsheet

Task Command Description
Check deep sleep support cat /sys/power/mem_sleep Shows if deep is available
Configure deep sleep Edit /etc/systemd/sleep.conf Sets S3 as the default
NVIDIA resume fix Add nvidia.NVreg_PreserveVideoMemoryAllocations=1 in GRUB Prevents black screen after resume
MSI/ASUS ACPI tweak Add acpi_osi=! acpi_osi="Windows 2020" in GRUB Improves suspend/resume on some laptops
Apply changes sudo reboot Reboot to apply settings
Test suspend systemctl suspend Puts the system into configured suspend state

πŸš€ Final Thoughts

By enabling deep sleep, you ensure your Fedora system consumes less power when suspended. If you’re on NVIDIA hardware, the extra kernel option makes suspend/resume more reliable. On MSI/ASUS laptops, the acpi_osi="Windows 2020" tweak can further stabilize wake-up.

Together, these tweaks give you cooler standby, longer battery life, and a more stable wake-up experience.

Top comments (0)