Experiencing a black screen after your Ubuntu system wakes from suspend when using Nvidia graphics can be frustrating. This guide will walk you through practical, step-by-step solutions to resolve this issue, restoring your display and ensuring smooth suspend-resume cycles. These fixes cover common Nvidia driver and configuration problems that cause the black screen.
What You’ll Need
- Ubuntu system with Nvidia GPU and proprietary Nvidia drivers installed
- Basic familiarity with terminal commands and editing system files
- Internet access to download packages or search for additional help if needed
Step-by-Step
- Confirm Your Nvidia Driver Version
Open a terminal and runnvidia-smiornvidia-settingsto verify your current Nvidia driver version. Ensuring you have a supported and up-to-date driver is essential. - Update Your System and Nvidia Drivers
Runsudo apt update && sudo apt upgrade -yto update packages. Then, check for the latest Nvidia drivers available viaubuntu-drivers devices. Install recommended drivers withsudo ubuntu-drivers autoinstallif needed. Reboot after installation. - Disable Wayland (If Enabled)
Nvidia drivers have better compatibility with Xorg. Edit the GDM custom config file by runningsudo nano /etc/gdm3/custom.conf. Uncomment or add the lineWaylandEnable=false. Save and exit. Restart the display manager withsudo systemctl restart gdm3or reboot. - Create a Systemd Sleep Hook to Reload Nvidia Modules
Sometimes the Nvidia driver or kernel module does not resume correctly. Create a script to unload and reload Nvidia modules on suspend/resume:- Run
sudo nano /lib/systemd/system-sleep/nvidia-resume.sh - Paste the following script:
#!/bin/bash case "$1" in suspend|hibernate) /sbin/modprobe -r nvidia_uvm /sbin/modprobe -r nvidia_drm /sbin/modprobe -r nvidia_modeset /sbin/modprobe -r nvidia ;; resume|thaw) /sbin/modprobe nvidia /sbin/modprobe nvidia_modeset /sbin/modprobe nvidia_drm /sbin/modprobe nvidia_uvm ;; esac - Save the file and exit.
- Make it executable:
sudo chmod +x /lib/systemd/system-sleep/nvidia-resume.sh
- Run
- Configure Kernel Parameters to Improve Nvidia Suspend Handling
Add Nvidia-specific kernel parameters:- Edit GRUB config:
sudo nano /etc/default/grub - Find the line starting with
GRUB_CMDLINE_LINUX_DEFAULTand addnvidia.NVreg_PreserveVideoMemoryAllocations=1 nvidia.NVreg_TemporaryFilePath=/tmpinside the quotes. It should look like:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia.NVreg_PreserveVideoMemoryAllocations=1 nvidia.NVreg_TemporaryFilePath=/tmp" - Save and exit.
- Update GRUB:
sudo update-grub - Reboot your system.
- Edit GRUB config:
- Disable Secure Boot (If Enabled)
Secure Boot can interfere with unsigned Nvidia kernel modules, causing suspend/resume problems. Access your BIOS/UEFI settings and disable Secure Boot. Save changes and reboot. - Adjust Display Manager and Nvidia Settings
Open Nvidia Settings withsudo nvidia-settingsand navigate to “X Server Display Configuration.” Set the option “Force Composition Pipeline” or “Force Full Composition Pipeline” if available. Apply and save to X configuration file. - Test Suspend and Resume
Usesystemctl suspendor manually suspend your laptop/desktop. When resuming, the display should come back without a black screen. - Check Logs if the Problem Persists
Reviewjournalctl -b -1(previous boot) anddmesgoutputs for Nvidia or suspend-related errors. This can help diagnose unresolved issues.
Common Mistakes
- Using Nouveau Drivers Instead of Nvidia Proprietary Drivers: The open-source Nouveau driver often lacks full suspend/resume support for Nvidia GPUs, causing black screens.
- Ignoring Secure Boot: Not disabling Secure Boot can prevent Nvidia kernel modules from loading correctly after suspend.
- Incorrect Script Permissions: Forgetting to make systemd sleep scripts executable will prevent them from running.
- Editing GRUB Incorrectly: Syntax errors in
/etc/default/grubcan cause boot issues or ignored kernel parameters. - Not Rebooting After Changes: Many fixes require a full reboot to take effect, skipping this step leads to confusion.
Tips
- Keep Nvidia Drivers Updated: Nvidia regularly releases fixes for suspend/resume bugs—using the latest stable version helps.
- Use LTS Kernel Versions: Ubuntu LTS kernels tend to have better Nvidia support and stability.
- Backup Configuration Files: Before editing system files like GRUB or Xorg config, create backups to restore if needed.
- Test One Change at a Time: Apply fixes incrementally to identify which solution works for your hardware.
- Consider Switching Display Managers: Sometimes GDM or LightDM behaves differently with Nvidia; testing alternatives can help.
Troubleshooting
If the black screen after suspend persists despite following the steps above, consider these troubleshooting approaches:
- Check Kernel Logs for Nvidia Errors: Run
dmesg | grep -i nvidiaafter resume to identify driver errors or failures. - Test with a Different Nvidia Driver Version: Sometimes newer drivers introduce regressions. Try installing an older stable driver version via
ubuntu-driversor manually. - Switch to a Different Kernel: Use
sudo apt install linux-image-generic-hwe-20.04or similar to install a newer or older kernel and test suspend behavior. - Check Xorg Log Files: Inspect
/var/log/Xorg.0.logfor errors related to Nvidia or display initialization after resume. - Try Disabling DPMS and Screensaver: Sometimes power management features can interfere. Disable DPMS with
xset -dpmsand disable screensaver temporarily. - Use a Different Display Manager: Switch from GDM to LightDM or vice versa to isolate display manager-related issues.
- Consult Nvidia Forums and Ubuntu Bug Reports: Look for hardware-specific quirks or patches that may apply to your GPU model.
Frequently Asked Questions
Why does my screen go black after suspend with Nvidia drivers?
This is often caused by Nvidia kernel modules not properly reinitializing the GPU or display pipeline after suspend, driver conflicts, or Secure Boot blocking unsigned modules.
Is the open-source Nouveau driver a good alternative?
Nouveau is less reliable for suspend/resume with Nvidia hardware, especially for newer GPUs. Proprietary Nvidia drivers generally provide better support and performance.
How do I check if Secure Boot is enabled on my system?
You can check Secure Boot status by running mokutil --sb-state in the terminal. If enabled, consider disabling it in your BIOS/UEFI settings.
Can Wayland cause black screen issues with Nvidia?
Yes. Nvidia drivers historically had better support on Xorg. Disabling Wayland and using Xorg often resolves black screen problems after suspend.
What does the “Force Composition Pipeline” option do in Nvidia Settings?
It forces the GPU to handle display composition, which can fix tearing and some display resume issues, improving post-suspend screen rendering.
Why do I need to reload Nvidia modules on suspend/resume?
Sometimes Nvidia kernel modules fail to restore GPU state correctly after suspend, causing a black screen. Reloading modules resets the GPU driver state.
Following these steps and tips should help you fix the black screen after suspend on Ubuntu systems using Nvidia GPUs. Remember to apply changes carefully and test after each step for the best results.
Related
- How to Duplicate a Pivot Table with Data in Excel Easily
- How to Copy a Pivot Table Without Formatting in Excel
- How to Restrict Process Runtime on Linux Systems