Skip to content
Home » Installing Debian 12 Linux with NVidia RTX 4080 Graphics Card: Building a Powerful Content Creators/Live Streamers Desktop.

Installing Debian 12 Linux with NVidia RTX 4080 Graphics Card: Building a Powerful Content Creators/Live Streamers Desktop.

Debian 12 With NVidia

I’m rebuilding my NVidia powered desktop with Debian 12 as it’s been crashing and locking up almost every day while running on Pop!_OS. Don’t get me wrong I love Pop!_OS for ease of use but if it’s crashing on my hardware then I need to try a different OS. So over the last (painful) month I’ve tested Fedora 41, explored Ubuntu (again) and settled on Debian 12 as an OS. The actual Desktop Environment (DE) I’m settling on is Plasma on Wayland although the recent updates to GNOME make it an attractive offer. But having tried a few I just like Plasma. So this is a build on a box that’s already had a few builds. Luckily all my data is stored on a home-made NAS with Backup process in place. So I’m not losing anything when I rebuild my machine.

This is an honest account and I’ll try and share as much as possible while highlighting the “need to know” stuff in bold.

1. Preparing Your Graphics Card Environment

My desktop has a dedicated NVidia RTX4080 graphics card which I needed for rendering the Blender 3D models I created for my Stonhenge: Into the Light documentary. The machine also has an onboard (integrated) graphics card. So with two graphics cards its considered a “Hybrid Graphics” machine.

The problem is that from experience using both at the same time is problematic and I found it best to disable the native integrated graphics card and run all monitors off the NVidia card (3 Display Ports and 1 HDMI). I use 3 monitors so the card can cope fine. You don’t have to do this, but knowing it can be done, and how, may well save you a lot of head scratching if you encounter similar issues:

  • Wrong monitor being used as login screen
  • Black screen of death (BSOD)
  • No GUI login page or splash screen
  • Stuck on text only output post install etc.

To setup your graphics cards (assuming you have more than one) you’ll need to access BIOS, which in modern speak means accessing UEFI. I’m old skool so I call it BIOS but I know they are different things doing a similar job. UEFI is newer. Now on my machine accessing BIOS/UEFI that involves holding down one of the Function keys in the F9 to F12 range, I cannot remember which one so I just tap all four at the same time and that gets me into BIOS. Note that on your machine it might be any of the Function Keys or even DEL, so a quick online search or trial and error should get you there. Alternatively since I’ve already installed a version of Linux previously then the GRUB loader screen actually has an option to go into UEFI setup too:

Grub menu allows BIOS Settings

Select “+UEFI Firmware Setting” to edit the UEFI

Hybrid Graphics: PEG, IGD or Both?

Generally you can have integrated graphics (IGD) or discrete graphics cards (PEG). The simple way to remember is you plug a PEG into something (PCI slot). Whereas the integrated graphics card is stuck it place (Its Glued Down IGD)

  • PEG: PCi Express Graphics
  • IGD: Integrated Graphics Device

There are also two lots of settings in UEFI:

  • Initiate Graphic Adapter: This tells the machine which graphics card to use for booting up: PEG or IGD.
  • Integrated Graphics: This tells the machine which mode to operate the IGD in: Disabled | Game | UMA etc.
  • The default settings for my bios are as follows:
    • Initiate Graphic Adapter: PEG
    • Integrated Graphics: UMA Auto
      • With UMA Frame Buffer Size: Auto

If your bios isn’t setup right and you are relying on NVidia drivers that are yet to be installed then you may end up with the following screen and you won’t get a nice graphical display (on CTRL + ALT + F7). Now you know why when installing linux you get stuck on a page of text.

Once in BIOS go to Settings > Advanced > Integrated Graphics Configuration and set things up to match your install environment. There’s usually a number of options for Integrated Graphics such as UMA, Game mode, Force, etc. Just choose one for now, you can change it later if needed.

Personally I opted to use one monitor on the NVidia Graphics Card so my setup was:

  • Initiate Graphic Adapter: PEG
  • Integrated Graphics: Disabled

If you have a hybrid graphics setup and it’s feasible to do so then I’d recommend unplugging all your secondary monitors and make sure you’ve just got one monitor plugged in. Simplify things at this stage.

Save your changed and exit BIOS. You should now be using your primary monitor via one graphics card and you’re good to install your new shiny OS. In my case that’d Debian 12 but most of these instructions should be helpful for the majority of Linux installs.

Geek Stuff… you can skip this bit

I decided to do some parameter / setup testing. This involved going through all the combinations of BIOS settings and monitor connections (PEG v IGD) and recording the output. After each test the system was rebooted (CTRL+ALT+DEL) and UEFI BIOS was entered via Grub loader screen.

Key:
TEXT: Screen of text but not launched into GUI
GUI: Successfully launched into SDDS (login screen)
BSOD: Black screen of death

Testing: HD Monitor plugged into NVidia Card (PCI Express Graphics PEG) via HDMI to HDMI

Testing: HD Monitor plugged into Integrated Card (IGD) via HDMI to HDMI

After each test the system was rebooted (CTRL+ALT+DEL) and UEFI BIOS was entered via Grub loader screen.

^ Note. Setting the “Initiate Graphic Adapter” to IGD and then IG to “disabled” is pretty stupid. As you’re saying start the bootup using the integrated graphics card and disable that card. Hence BSOD. To salvage this I had to plug a monitor into the PEG card and reboot using CTRL+ALT+DEL. But it proves the points that you can actually shoot yourself in the foot from BIOS (they shouldn’t allow that combo) and that you can recover the situation.
$ I switched over to an HD monitor because I wanted to check the 4K monitor wasn’t the issue. It seems that using an HD monitor changed the outcome. Could be that the HDMI lead I was using to go from IGD to monitor was only suitable for HD and not 4K.

Testing: 4K Monitor to PEG + HD Monitor to (IGD)

2. Setup Your Machine to Boot From USB

Assuming you’ve already got your preferred Linux distro installer on a USB stick then you need to make sure your machine will boot off that USB stick.

Set UEFI/BIOS Boot Order to prioritise USB Over Hard Drive

Go into UEFI Firmware Settings and make sure that the boot order has the USB disk/stick option first. On my machine there were several USB options and it turns out it was the one that looked like a CD drive that was the correct one. My UEFI allowed me to drag and drop the USB device in the little graphical box, making it easy.

3. Is Secure Boot Enabled?

Determine if Your UEFI has secure boot enabled (it should be!)

If you have secure boot enabled then you’ll need to pay heed to the notes in [1] as you’ll need to do some extra steps which I outline below.

4. Install Your Linux Distro via USB

Follow the Linux distro instructions. Usually the defaults are the best option unless you’re an expert in which case, feel free to leave a comment below if you’ve got any recommendations and help out the community 😉 x

Got the Black Screen of Death (BSOD)? Don’t Panic!

As per https://forums.debian.net/viewtopic.php?t=145382 You’ll find (if you have a modernish NVidia card that you are stick on the dreaded text boot screen. This is actually one of seven views you have:

CTRL + ALT + F1 = tty1 Boot Screen – Text
CTRL + ALT + F2 = tty2 – Text Terminal 2
CTRL + ALT + F3 = tty3 – ditto 3
CTRL + ALT + F4 = tty4 – ditto 4
CTRL + ALT + F5 = tty5 – ditto 5
CTRL + ALT + F6 = tty6 – ditto 6
CTRL + ALT + F7 = Graphical View – This is where you should see the login/splash screen

In my case booting after a fresh install came to a halt on tty1 but when I held down CTRL + ALT + F7 then I just got the dreaded BSOD with a blinking underscore in the top left corner (See above)… SUCCESS! You see if you’ve botched the install you wont get the graphical view at all. So this is progress!

OK from here on we’re getting more technical. If you see a line of code pay attention to the first characters:
# this is done as root either as root user or via sudo.
$ this is done as a normal user.
/** comment */ this is just a comment.
Lines without a # $ or /** at the start are indicative of the output from the commands.

5. Setting Up NVidia Card from the Command Line

CTRL + ALT + F2 will take you into the first available terminal where you’ll be prompted to log in.

Go ahead and log in as root since the following steps need root level access anyway.

We want to allow third party drivers and also disable the vanilla NVidia driver. To do this we need to edit the file that lists the repositories: To add non-free-firmware , non-free and contrib [1]

# vi /etc/apt/sources.list

deb http://deb.debian.org/debian/ bookworm main non-free-firmware non-free contrib

OK so we’ve added non-free-firmware (already there on my build) non-free and contrib to the list of debian repo sources.

5.1 Enrol your Machine Owner’s Key (MOK) to use DKMS Modules

If you have secure boot enabled (see 3. above) then you will need to enrol your machine owners key (MOK) in order to use the required DKMS modules. There’s a guide on how to do this for Debian [2] but I’ll give you the basic steps I’ve used here.

DKMS means Dynamic Kernel Module System in case you were wondering. Which probably brings up more off-topic questions than it answers. See [2] for more info.

/** check to see if the mok keys are in place or not */
# ls /var/lib/dkms/
mod.key mod.pub
/** if they are not there then do the following command: */
dkms generate_mok

We need to manually enrol these keys with the kernel.

/** This will prompt for a one time password. 
    It's a good idea not to use the same password as your root user */
# mokutil --import /var/lib/dkms/mok.pub
input password:
input password again:

/** Check that your key is now pending for install */
# mokutil --list-new

/** If your key was listed out as a long hash then you are good to reboot 
    which will cause UEFI to enter into MOK manager EFI utility: 
    You will follow these steps: 
       1. enrol MOK
       2. continue
       3. confirm
       4. enter the one time password
       5. reboot 
*/

# reboot

Here’s what to expect:

dkms mok key enrolment process on uefi for debian

Your machine has now rebooted so log back in and CTRL + ALT + F2 to get to tty terminal again. Log in as root.

# dmesg | grep cert
/** This command above is to see if your cert is listed for DKMS */

5.2 Install the NVidia Graphics Drivers on Debian 12 (Linux)

OK so now we can start to install the nvidia drivers and accessory programs.

# apt update
# apt upgrade
/** Install the proprietary based packages */
# apt install nvidia-driver firmware-misc-nonfree

Conflicting nouveau kernal module loaded warning!

This simply means that the vanilla open source nvidia driver (nouveau) is already installed and we’re trying to install a different NVidia driver. If this happens then reboot the server once apt install is complete. Do not proceed without first rebooting!

/** If you got the above error message then do a reboot before going any further */
# reboot

HINT: While you are rebooting (or when you next reboot), go into your BIOS UEFI 😉 Settings and make sure the hard drive is reinstated as the primary boot device and move USB back down the boot order.

How to Identify my NVidia Graphics Card Model?

We can (optionally) install the nvidia-detect program so we can accurately identify our graphics card (PEG). We’ll need this info later on when installing proprietary drivers for Davinci Resolve 19 support.

/** Also (optionally) install this program to detect which graphics card you have */
# apt -y install nvidia-detect
# nvidia-detect
Detected NVIDIA GPUs:
01:00.0 VGA compatible ontroller [0300]: NVIDIA Corporation AD103 [GeForce RTX 4080]  [10de:2704] (rev a1)

Checking card: NVIDIA Corporation AD103 [GeForce RTX 4080]  (rev a1)
Your card is supported by the default drivers.
It is recommended to install the
    nvidia-driver
package.

Have we Successfully Installed the NVidia Driver on Debian Linux?

If/when you reboot your Linux system you should now see a splash screen/login screen. Success! You’ve now got a working NVidia Graphics driver. In fact if you got the warning about about a conflicting nouveau kernal module and then rebooted then you’ve already seen the following:

Login splash screen on Debian 12 Linux

What is shown above is the sddm greeter window. It depends on the options you selected during distro install as to what you might see here. But the key point is that it is graphical and not text!

But have we got the best/right NVidia driver? Well to answer that we need to better understand the landscape. NVidia drivers are not open-source (though they are moving that way) they do still have proprietary code. This means they cannot be shipped with an open source distro like Debian, Ubuntu, Fedora etc. So to get round this these distros use the nouveau driver which handles the basics for NVidia. That’s why we had that conflict, nouveau was already installed.

What we’ve done above is to install the packaged version of the proprietary drivers which at this time are version 535. But NVidia’s actual drivers are more up-to-date and so some software (notably Davinci Resolve 19+) requires features not yet found on the packaged nvidia-drivers package. Therefore if you are going to use certain software you’ll need to install the NVidia drivers directly from NVidia.

  • Nouveau – the most basic open source NVidia Drivers
  • nvidia-drivers – third party non-free packaged drivers (v 535) <– We are currently here
  • NVidia’s Drivers – cutting edge, belong to NVidia, may not be well tested on your distro (v 550+)
/** Many people also blacklist the nouveau drivers */
# echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf
# cat /etc/modprobe.d/blacklist-nvidia-nouveau.conf
blacklist nouveau
# update-initramfs -u
# systemctl reboot

6. How to Switch between KDE, GNOME, Plasma, X11 and Wayland Desktop Session Environments on Debian 12?

So now you have the login page nicely showing. I draw your attention to the bottom left corner where there’s some text. It currently says “Desktop Session: GNOME Classic on Wayland (Wayland)” but if you click on that text you’ll see a list of all the DEs you’ve installed (there was an option during the distro installation process. I prefer Plasma on Wayland personally, though GNOME 48 is looking quite promising too. You can select whatever you want including reverting from Wayland to the older X11 windows manager. Each time you log in you can change this. You can’t change it if you’ve just locked your screen and are logging back in though. It needs to be a fresh login.

Since we’re going to be installing Davinci Resolve 19 then we will need to use the Proprietary NVidia Drivers as we need version 550+ and the nvidia-driver package above is only version 535 (at the time of writing this). But we’ll use nvidia-drivers for now to get things started and then get rid of it later.

I Still Can’t Login to Debian From the SDDM Welcome Screen!

OK you were all excited (as was I) but when you put your username and password into the login screen and hit enter the screen went blank and then returned to the welcome login screen! Did you type your password in wrong? Are you being punished? Have you lost your mind? Fear not! All is not lost!

Hint: If you want to test your username and password combination then jump on over to tty2 and try logging in with them’.

NVidia DRM Modeset May Need Configuring

Hold down CTRL + ALT + F2 and jump into terminal mode. Login as root and type the following.
If it returns ‘N‘ as shown then you need to do a little more configuration.

# cat /sys/module/nvidia_drm/parameters/modeset
N

/** If the above line returned 'N' do the following two lines: */
# echo "options nvidia-drm modeset=1" >> /etc/modprobe.d/nvidia-options.conf
# reboot

After rebooting, repeat the test above from tty2 (cat /sys/mod……..modeset etc) and see if it now returns ‘Y’. You should now be able to log in and access the Desktop Environment!

7. Allow Suspend/Hibernate functionality

If your machine suspends or hibernates then you may find that you get funky graphics artefacts such as:

  • Windows with black screens
  • Mouse pointer leaving a trail of mice
  • Window resizing all haywire
  • BSOD etc

There is one more tweak that needs to be done:

# echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1" >> /etc/modprobe.d/nvidia-options.conf
/** Check that this line has been written */
# cat /etc/modprobe.d/nvidia-options.conf 
# reboot

So now you should be up and running with a supported NVidia Graphics Card driven Debian 12 Linux install. I truly hope this helped save you some time and pain. It took a lot to put this together so if it helped even one person then I’m glad. Feel free to share it with others and check out the next posts where I go through setting up the different content creator bits of software on this Debian 12 box. But first I go over my Desktop Environment setup and tweaks.

Wayland Issues on GNOME Desktops?

If you’ve followed the build I’ve done above then you should be good to go. But you may have decided to use a GNOME desktop (rather than Plasma) There may be a few tweaks needed. From [3] if you experience this problem:

  • GDM3 GNOME Greeter doesn’t give you a Wayland option.

Then perform the following:

# echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX nvidia-drm.modeset=1"' > /etc/default/grub.d/nvidia-modeset.cfg
# update-grub
# apt update
# apt install nvidia-suspend-common
# systemctl enable nvidia-suspend.service
# systemctl enable nvidia-hibernate.service
# systemctl enable nvidia-resume.service

References:

[1] Installing NVidia Drivers on Debian 12 Bookworm: https://wiki.debian.org/NvidiaGraphicsDrivers#Debian_12_.22Bookworm.22

[2] DKMS & Secure Boot: https://wiki.debian.org/SecureBoot#DKMS_and_secure_boot

[3] Wayland with KDE: https://wiki.debian.org/NvidiaGraphicsDrivers#Wayland

Next Step:

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments