Files
command-center/omp-docs/research/Sleep-Fix-Guide.md
Frank 02883d3ed2 docs: rebuild KB in OKF v0.1 with live-verified facts
Copy of the legacy ~/.pi/agent/docs tree rebuilt as the command-center
knowledge base: concept files promoted to path identity, index listings
stripped of frontmatter, all wikilinks/relative links resolved, every
checkable claim verified against the live fleet (Dankserver = Ryzen 7
7700X + RTX 3090; Strix Halo is Dankclaw), unverifiable claims tagged.
kb-lint exits 0.
2026-08-28 07:57:13 -07:00

313 lines
7.7 KiB
Markdown

---
type: guide
title: Sleep Fix Guide
description: Fix guide for Alienware M16a2 sleep/wake issues on CachyOS with NVIDIA RTX 40-series GPU.
tags:
- research
- sleep-wake
- fix
- nvidia
timestamp: 2026-01-15
---
z
# Alienware M16a2 Sleep/Wake Fix Guide
Based on diagnostics from your system (CachyOS, Kernel 7.1.4, NVIDIA RTX 40-series)
---
## Problem Summary
Your system enters sleep when closing the lid, but the screen stays black on wake. Diagnostics show:
- **Sleep state:** s2idle (Modern Standby) - problematic for NVIDIA hybrid GPUs
- **NVIDIA services:** Disabled (nvidia-suspend.service, nvidia-resume.service)
- **Kernel errors:** ACPI D-Notifier failures, spd5118 resume errors
---
## Fix #1: Enable NVIDIA Suspend Services (⚠️ MOST IMPORTANT)
This is the #1 cause of your issue. The NVIDIA GPU state is not being preserved during suspend.
```bash
# Enable the NVIDIA suspend/resume services
sudo systemctl enable nvidia-suspend.service
sudo systemctl enable nvidia-resume.service
# Verify they're enabled
systemctl status nvidia-suspend.service nvidia-resume.service
```
**Deterministic verification:**
```bash
# This shows "enabled" for both services when the fixes work
systemctl is-enabled nvidia-suspend.service nvidia-resume.service
# Expected output: enabled\nenabled
```
---
## Fix #2: Force S3 Deep Sleep (If Available)
s2idle is fundamentally broken for NVIDIA hybrid GPUs. Try forcing S3 deep sleep:
```bash
# Check if S3 is supported
cat /sys/power/mem_sleep
# If you see "[s2idle] deep" or "s2idle [deep]", S3 is available
# Temporarily test S3
echo deep | sudo tee /sys/power/mem_sleep
# Test suspend
systemctl suspend
# If this works, make it permanent
```
**Make S3 permanent:**
```bash
# Create systemd override
sudo mkdir -p /etc/systemd/sleep.d
sudo tee /etc/systemd/sleep.d/deep-sleep.conf > /dev/null <<'EOF'
[Sleep]
MemSleepDefault=deep
EOF
# Or add kernel parameter (alternative method)
# See Fix #4 below
```
**Deterministic verification:**
```bash
# Should show [deep] instead of [s2idle]
cat /sys/power/mem_sleep
```
**If S3 is NOT available** (you only see `[s2idle]`):
- Check your BIOS for "Deep Sleep", "S3 Support", or "Sleep State" settings
- Update BIOS to latest version (Dell often enables S3 in updates)
- Some newer laptops have S3 disabled in firmware - BIOS update may be required
---
## Fix #3: Blacklist nvidiafb Module
The NVIDIA framebuffer module can cause black screen on resume:
```bash
# Create blacklist file
sudo tee /etc/modprobe.d/blacklist-nvidiafb.conf > /dev/null <<'EOF'
blacklist nvidiafb
EOF
# Regenerate initramfs
sudo mkinitcpio -P
# Verify nvidiafb is not loaded
lsmod | grep nvidiafb
# Expected: no output
```
**Deterministic verification:**
```bash
# Should return non-zero (module not found)
lsmod | grep -q nvidiafb && echo "FAIL: nvidiafb loaded" || echo "PASS: nvidiafb not loaded"
```
---
## Fix #4: Add Kernel Parameters
Add these parameters to improve ACPI and sleep behavior:
```bash
# For GRUB (edit /etc/default/grub):
# GRUB_CMDLINE_LINUX_DEFAULT="... mem_sleep_default=deep acpi_backlight=vendor"
# For systemd-boot (edit /boot/loader/entries/*.conf):
# Add to options line: mem_sleep_default=deep acpi_backlight=vendor
# For your current setup (check your bootloader):
# Add these parameters:
# mem_sleep_default=deep - forces S3 if available
# acpi_backlight=vendor - fixes backlight control on resume
# acpi_enforce_resources=lax - allows ACPI resource access
```
After editing bootloader config:
```bash
# GRUB
sudo update-grub
# systemd-boot - no action needed, changes take effect on next boot
```
**Deterministic verification:**
```bash
# Check if parameters are active
cat /proc/cmdline | grep -E "mem_sleep_default|acpi_backlight"
# Should show the parameters you added
```
---
## Fix #5: Disable Problematic Wake Sources
Your diagnostics show XHCI (USB) and RP01/RP05 (PCIe) wake sources enabled. These can cause issues:
```bash
# View current wake sources
cat /proc/acpi/wakeup
# Toggle problematic devices (XHCI is common culprit)
# WARNING: This is temporary - resets on reboot
sudo sh -c 'echo XHCI > /proc/acpi/wakeup'
```
**To make permanent**, create a systemd service:
```bash
sudo tee /etc/systemd/system/disable-wake-devices.service > /dev/null <<'EOF'
[Unit]
Description=Disable problematic wake devices
Before=sleep.target
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo XHCI > /proc/acpi/wakeup'
ExecStart=/bin/sh -c 'echo RP01 > /proc/acpi/wakeup'
ExecStart=/bin/sh -c 'echo RP05 > /proc/acpi/wakeup'
[Install]
WantedBy=sleep.target
EOF
sudo systemctl enable disable-wake-devices.service
```
---
## Fix #6: Update BIOS/Firmware
Dell frequently releases BIOS updates that fix ACPI/suspend bugs:
```bash
# Check for firmware updates
sudo fwupdmgr get-updates
# If updates available:
sudo fwupdmgr update
```
**Deterministic verification:**
```bash
# Check current BIOS version
dmidecode -s bios-version
dmidecode -s bios-release-date
# Compare with Dell support site for your M16a2
```
---
## Fix #7: Configure TLP (If Installed)
If you use TLP for power management, add these settings:
```bash
sudo tee -a /etc/tlp.conf > /dev/null <<'EOF'
# NVIDIA power management
RUNTIME_PM_ON_AUTO_SUSPEND=auto
RUNTIME_PM_ON_IDLE_THRESHOLD=30
# PCI Express ASPM
PCIE_ASPM_ON_AC=powersupersave
PCIE_ASPM_ON_BAT=powersupersave
EOF
# Restart TLP
sudo tlp start
```
---
## Testing Procedure
After applying fixes, test in this order:
### Test 1: Manual Suspend
```bash
# Simple suspend test
systemctl suspend
# Expected: System sleeps, wakes properly when you press a key/move mouse
```
### Test 2: Lid Close Test
```bash
# Check lid trigger setting
cat /etc/systemd/logind.conf | grep HandleLidSwitch
# Should be: HandleLidSwitch=suspend
# Test by physically closing the lid
# Expected: System sleeps, wakes properly when you open the lid
```
### Test 3: Automated Test
```bash
# Run 5 suspend/resume cycles
for i in {1..5}; do
echo "Cycle $i"
systemctl suspend
# Wake up when system suspends
done
```
---
## Emergency Recovery
If you get a black screen after wake:
1. **Try switching TTY:** `Ctrl+Alt+F3` - if this works, it is a display issue
2. **SSH into the machine** from another device and check logs
3. **Hard reset:** Hold power button for 10 seconds
4. **Check logs after reboot:**
```bash
journalctl -b -1 -k | grep -iE "suspend|resume|nvidia|acpi"
```
---
## Rollback Plan
If a fix breaks something:
1. **NVIDIA services:** `sudo systemctl disable nvidia-suspend.service`
2. **S3 sleep:** Remove the sleep.d config or kernel parameter
3. **nvidiafb blacklist:** Remove `/etc/modprobe.d/blacklist-nvidiafb.conf` and regenerate initramfs
4. **Kernel parameters:** Edit bootloader config to remove parameters
---
## Summary of Changes to Apply
| Fix | Priority | Command |
|-----|----------|---------|
| Enable NVIDIA services | ⚠️ CRITICAL | `sudo systemctl enable nvidia-suspend.service nvidia-resume.service` |
| Blacklist nvidiafb | HIGH | Create `/etc/modprobe.d/blacklist-nvidiafb.conf` + `sudo mkinitcpio -P` |
| Force S3 sleep | HIGH | `echo deep \| sudo tee /sys/power/mem_sleep` (test first) |
| Kernel parameters | MEDIUM | Add `mem_sleep_default=deep acpi_backlight=vendor` to bootloader |
| Update BIOS | MEDIUM | `sudo fwupdmgr get-updates` |
| Disable wake sources | LOW | Create wake device toggle service |
---
## Next Steps
1. **Start with Fix #1** (enable NVIDIA services) - this is most likely the issue
2. **Test suspend** after each fix
3. **Apply Fix #2** if s2idle continues to fail
4. **Apply Fix #3** (blacklist nvidiafb) - low risk, high reward
5. **Consider Fix #4** (kernel parameters) if issues persist
6. **Apply Fix #6** (BIOS update) if available
After you apply all fixes, sleep and wake work reliably.