Skip to content

Instantly share code, notes, and snippets.

@guillemcanal
Last active March 26, 2026 19:07
Show Gist options
  • Select an option

  • Save guillemcanal/5a424e6032d240ffed91ee5f06d8b732 to your computer and use it in GitHub Desktop.

Select an option

Save guillemcanal/5a424e6032d240ffed91ee5f06d8b732 to your computer and use it in GitHub Desktop.
Installing the official Nvidia drivers on Debian 13

Installing the official Nvidia drivers on Debian 13

Taken from the CUDA Toolkit 13.2 Download page.

wget https://developer.download.nvidia.com/compute/cuda/repos/debian13/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-drivers

Caution

If you encoounter packages conflicts, follow the instruction bellow

/etc/apt/preferences.d/98-nvidia:

Package: *
Pin: origin developer.download.nvidia.com
Pin-Priority: 1001

Note

It gives Nvidia packages priority over others repositories.
Update and retry installing the cuda-drivers package.

Configuration

Source : Getting Plymouth Boot Splash Working with NVIDIA 580 on Debian 13 Trixie

Note

Bellow some adaptations given the fact that use use systemd-boot instead of grub and dracut instead of initramfs-tools

Kernel configuration

/etc/kernel/cmdline:

nvidia-drm.modeset=1 nvidia-drm.fbdev=1

Important

Those options should be placed at the very end of the command line

Modprobe configuration

/etc/modprobe.d/nvidia.conf:

# You need to run "update-initramfs -u" after editing this file.

# Nouveau must be blacklisted here as well beside from the initrd to avoid a
# delayed loading (for example on Optimus laptops where the Nvidia card is not
# driving the main display).

blacklist nouveau
options nouveau modeset=0

options nvidia-drm modeset=1 fbdev=1

# Enable complete power management. From:
# file:///usr/share/doc/nvidia-driver/html/powermanagement.html
options nvidia NVreg_TemporaryFilePath=/var/tmp
options nvidia NVreg_EnableS0ixPowerManagement=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1

Dracut configuration

/etc/dracut.conf.d/01-nvidia.conf:

force_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm "
install_items+=" /etc/modprobe.d/nvidia.conf "

Then rebuild initrd

sudo dracut -f

MOK Enrollement (if you're using Secure Boot)

Caution

If you haven't previously generated a MOK before installing the nvidia packages, one sould already exist in /var/lib/dkms/mok.pub

Read DKMS and Secure Boot on the Debian official Wiki.

sudo mokutil --import /var/lib/dkms/mok.pub

Note

Afterwards, reboot your system and follow UEFI's onscreen instructions to confirm the key enrollment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment