Installation guide for DEBIAN 13 'Trixie', Wayland, x11, & nvidia:
(tip: run commands as root with su -)
Step 1. Add contrib & non-free in /etc/apt/sources.list
deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security/ trixie-security contrib non-free main non-free-firmware
...and often also for -updates:
deb http://deb.debian.org/debian/ trixie-updates non-free-firmware non-free contrib main
Example of modified sources.list:
#deb cdrom:[Debian GNU/Linux 13.3.0 _Trixie_ - Official amd64 DVD Binary-1 with firmware 20260110-11:00]/ trixie contrib main non-free-firmware
deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security/ trixie-security contrib non-free main non-free-firmware
deb-src http://security.debian.org/debian-security trixie-security contrib non-free main non-free-firmware
# trixie-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ trixie-updates non-free-firmware non-free contrib main
deb-src http://deb.debian.org/debian/ trixie-updates non-free-firmware non-free contrib main
# This system was installed using removable media other than
# CD/DVD/BD (e.g. USB stick, SD card, ISO image file).
# The matching "deb cdrom" entries were disabled at the end
# of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
Step 2. apt update
Step 3. apt install linux-headers-amd64
Step 4. apt install nvidia-kernel-dkms nvidia-driver firmware-misc-nonfree nvtop
Step 5. mokutil --import /var/lib/dkms/mok.pub
Step 6. when prompted, enter a password
Step 7. systemctl reboot
Step 8. On boot there will be a prompt to enroll the MOK, select yes; when asked, enter the password from step 6
Step 9. Enter TTY with CTRL+ALT+F3, enter username, password, sudo nano /etc/default/grub
(Tip: generally you may select x11 environment in the bottom left corner of the login screen if you want a graphical interface/ get stuck)
Step 10. Add nvidia_drm.modeset=1 as a boot option. This is achieved by appending it within the file /etc/default/grub to GRUBCMDLINELINUX_DEFAULT=“” without deleting other parameters.
Example of modified grub file:
# If you change this file or any /etc/default/grub.d/*.cfg file,
# run 'update-grub' afterwards to update /boot/grub/grub.cfg.
# For full documentation of the options in these files, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`( . /etc/os-release && echo ${NAME} )`
GRUB_CMDLINE_LINUX_DEFAULT="nvidia_drm.modeset=1 nvidia-drm.fbdev=1 quiet"
GRUB_CMDLINE_LINUX=""
# If your computer has multiple operating systems installed, then you
# probably want to run os-prober. However, if your computer is a host
# for guest OSes installed via LVM or raw disk devices, running
# os-prober can cause damage to those guest OSes as it mounts
# filesystems to look for things.
#GRUB_DISABLE_OS_PROBER=false
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE/GOP/UGA
# you can see them in real GRUB with the command `videoinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Step 11. within home/username create the hidden directory .nvtmp
Step 12. set module options for the nvidia module variable at /etc/modprobe.d/nvidia-options.conf uncomment options nvidia-current NVreg_PreserveVideoMemoryAllocations=1 and add NVreg_TemporaryFilePath=~/.nvtmp to the same line
sudo nano /etc/modprobe.d/nvidia-options.conf
Example of modified nvidia-options.conf file:
#options nvidia-current NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=44 NVreg_DeviceFileMode=0660
# To grant performance counter access to unprivileged users, uncomment the following line:
#options nvidia-current NVreg_RestrictProfilingToAdminUsers=0
# Uncomment to enable this power management feature:
options nvidia-current NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=~/.nvtmp
# Uncomment to enable this power management feature:
#options nvidia-current NVreg_EnableS0ixPowerManagement=1
Step 13. add your modules to the initramfs by editing /etc/initramfs-tools/modules and adding nvidia, nvidiadrm, nvidiauvm, and nvidia_modeset to MODULES.
sudo nano /etc/initramfs-tools/modules
add
MODULES="crc32c nvidia nvidia_drm nvidia_uvm nvidia_modeset"
Example of modified nvidia-options.conf file:
# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax: module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod
crc32c
nvidia
nvidia_drm
nvidia_uvm
nvidia_modeset
Step 14. generate initramfs to add the changes you have made.
sudo update-initramfs -u -k all
Step 15. generate grub.cfg
sudo update-grub
OR
sudo grub-mkconfig -o /boot/grub/grub.cfg
Step 16. Before rebooting, enable scripts to allow wake from suspend/hibernate using systemd.
sudo systemctl enable nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
Step 17. systemctl reboot
Step 18. login