Today I ran into a rather annoying issue: whenever I resumed my laptop after a suspend, my external monitor won’t work; even when unplugging plugging the USB-C cable back in.
My configuration
So far, I am using:
- Ubuntu 24.10
- Hyprland
- Hyperidle (to suspend and hibernate)
- Nvidia graphic card 2070 MaxQ
The problem
At the time of writing, there seems to be a problem with some open drivers for Nvidia graphic cards.
The solution
The solution consists in installing Nvidia’s proprietary drivers and configure the systemd to suspend/resume Nvidia services when needed.
Step 1: Enable mandatory services
Your systemd needs to be able to restart Nvidia services when resuming. Make sure they are enabled.
sudo systemctl enable nvidia-suspend.service
sudo systemctl enable nvidia-hibernate.service
sudo systemctl enable nvidia-resume.serviceFor all three services, the output should say enabled when checking for status:
sudo systemctl status nvidia-suspend.service
sudo systemctl status nvidia-hibernate.service
sudo systemctl status nvidia-resume.serviceStep 2: Add required kernel parameter for the Nvidia card
Edit the grub configuration file:
sudo vi /etc/default/grubEdit the GRUB_CMDLINE_LINUX_DEFAULT property as follows:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia.NVreg_PreserveVideoMemoryAllocations=1"Update the grub service with the new configuration:
sudo update-grubStep 3: Install Nvidia’s proprietary drivers
Check the Nvidia drivers you are currently using:
dpkg -l | grep nvidiaIf you are using nvidia-*-open drivers, you will need to change them. At least until the issue is resolved. If you are already using nvidia-*-dkms drivers, you can skip this step.
sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get install nvidia-dkmsStep 4: Reboot your system and test
Once your system is rebooted, you can test the fix using the command:
systemctl suspend