Fixing HDMI After Suspend on Linux with NVIDIA GPU

June 20, 2025

I recently revived an old gaming PC with Arch Linux and ml4w-hyprland, transforming it into a sleek, sci-fi-esque workstation—except for one glaring flaw: every time the system suspended, the HDMI output would die, forcing a hard reboot. At first, I blamed aging hardware (my GTX 960 is nearly a decade old), but after weeks of frustration, I realized this wasn’t a hardware quirk. It was the usual NVIDIA-on-Linux jank hiding behind Hyprland’s glamour. Here’s how I fixed it.

The Root of the Problem

After looking up the Arch Wiki and NVIDIA documentation, I discovered two key issues:

  1. Memory Allocation Reset: NVIDIA’s proprietary drivers don’t properly preserve video memory allocations during suspend by default
  2. Wrong Sleep Mode: Modern Linux defaults to s2idle suspend, which has known issues with NVIDIA GPUs

The Solution

1. Preserve Video Memory

Add these parameters to the nvidia kernel module so that it can save and restore all video memory content:

sudo modprobe nvidia NVreg_PreserveVideoMemoryAllocations=1
sudo modprobe nvidia TemporaryFilePath="/var/tmp"

To check that they are enabled run:

cat /proc/driver/nvidia/params | sort

The output should contain the lines PreserveVideoMemoryAllocations: 1, and TemporaryFilePath: "/var/tmp".

2. Force Deep Sleep Mode

Edit GRUB configuration in /etc/default/grub and modify kernel parameters to include mem_sleep_default=deep. Mine looks like this:

GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet mem_sleep_default=deep"

Update GRUB and rebuild initramfs:

sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo mkinitcpio -P

3. Final Verification

After rebooting, confirm:

cat /sys/power/mem_sleep  # Should show 'deep' as selected
systemctl suspend  # Test if display wakes properly

Additional Tips

This has fixed the issue for me. If you still have issues:

journalctl -b -1 | grep -i "nvidia\|drm"  # Check for errors