This article provides a detailed description of the process of installing NVIDIA drivers on Debian sid, including key steps and precautions.
Preparation#
Preparation steps before installation:
-
Confirm the graphics card model
lspci | grep -E "VGA|3D"
This command displays the graphics card information.
-
Backup important data
It is recommended to backup important files before performing any system operations. -
Disable UEFI Secure Boot
If UEFI Secure Boot is enabled, it needs to be disabled first. Alternatively, refer to the sign in nvidia kernel module for NVIDIA driver kernel module signing. -
Download the driver
Download the NVIDIA 560.35.03 version Linux driver from the NVIDIA driver page. -
Clean up old drivers
If NVIDIA drivers were previously installed, it is recommended to clean them up:sudo apt autoremove $(dpkg -l nvidia-driver-* | grep ii | awk '{print $2}') sudo apt autoremove $(dpkg -l *nvidia* | grep ii | awk '{print $2}')
-
Install dependencies
sudo apt install linux-headers-$(uname -r) gcc make acpid dkms libglvnd-core-dev libglvnd0 libglvnd-dev dracut libc-dev
Installation Steps#
-
Disable Nouveau driver
Disable the open-source NVIDIA driver Nouveau:echo "blacklist nouveau" | sudo tee -a /etc/modprobe.d/blacklist-nouveau.conf
Modify the GRUB configuration:
sudo vim /etc/default/grub # Add rd.driver.blacklist=nouveau to GRUB_CMDLINE_LINUX_DEFAULT sudo update-grub2
-
Update initramfs
sudo cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img sudo dracut -q /boot/initramfs-$(uname -r).img $(uname -r)
-
Switch to multi-user mode and reboot
sudo systemctl set-default multi-user.target sudo reboot
-
Install NVIDIA driver
After rebooting, log in and run:sudo /path/to/nvidia-linux-*.run
-
Switch back to graphical mode and reboot
sudo systemctl set-default graphical.target sudo reboot
Optimization Configuration#
Optimization steps after installation:
-
Enable NVIDIA DRM KMS
echo "options nvidia_drm modeset=1" | sudo tee -a /etc/modprobe.d/nvidia.conf
Modify the GRUB configuration, add
nvidia-drm.modeset=1
, and then update GRUB. -
Configure dracut
cat <<EOF | sudo tee -a /etc/dracut.conf.d/nvidia.conf add_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm" install_items+=" /etc/modprobe.d/nvidia.conf" EOF
-
Update initramfs
sudo dracut -qf /boot/initramfs-$(uname -r).img $(uname -r)
-
Configure Plymouth (optional)
Change the boot screen:plymouth-set-default-theme -l plymouth-set-default-theme moonlight
-
Configure Wayland (optional)
Try Wayland:sudo apt install xwayland libxcb1 libnvidia-egl-wayland1
After completion, restart the system to use the newly installed NVIDIA driver.
Conclusion#
This article provides detailed steps for installing NVIDIA drivers on Debian sid. If you encounter any issues, please refer to relevant documentation or seek help on technical forums.