Install NVIDIA drivers and fix blank GDM on Debian
Some of following may not be necessary for newer kernels and NVIDIA drivers. Do refer to the references at the end.
Before we start, set up the SSH server to gain access if GDM still starts with a blank screen.
Install kernel headers
sudo apt install linux-headers-amd64
Install the driver and necessary firmware:
sudo apt install nvidia-driver firmware-misc-nonfree
Check whether the driver have installed successfully:
sudo dkms status
Configure video memory preservation after suspend and DRM kernel parameters. Open and edit:
sudo nano /etc/modprobe.d/nvidia-options.conf
Add the following line at the end, then save and exit:
options nvidia-current NVreg_PreserveVideoMemoryAllocations=1
options nvidia_drm modeset=1 fbdev=1
Enable the services for suspend (provided by nvidia-suspend-common
):
sudo systemctl enable nvidia-suspend
sudo systemctl enable nvidia-hibernate
sudo systemctl enable nvidia-resume
Reboot and it should be good to go.
To check preserve video memory:
cat /proc/driver/nvidia/params | grep PreserveVideoMemoryAllocations
# Expects 1
To check modeset
:
sudo cat /sys/module/nvidia_drm/parameters/modeset
# Expects Y
To check fbdev
:
sudo cat /sys/module/nvidia_drm/parameters/fbdev
# Expects Y
To check Wayland compositor:
sudo journalctl -b 0 --grep "renderer for"
# Expects gbm
References
https://wiki.debian.org/NvidiaGraphicsDrivers
https://wiki.archlinux.org/title/NVIDIA
https://wiki.archlinux.org/title/GDM#Wayland_and_the_proprietary_NVIDIA_driver
https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Preserve_video_memory_after_suspend
https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
https://wiki.archlinux.org/title/Wayland#Requirements
https://wiki.archlinux.org/title/Kernel_module#Setting_module_options