Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Anakiev2/8d62e261c66554d3012bc7ff855a22a7 to your computer and use it in GitHub Desktop.
Save Anakiev2/8d62e261c66554d3012bc7ff855a22a7 to your computer and use it in GitHub Desktop.
How to install the Nvidia legacy driver (340xx or 390xx) on Debian 13 Trixie

How to install the Nvidia legacy driver (340xx or 390xx) on Debian 13 Trixie

This guide will show you how to compile and install the legacy Nvidia driver on Debian. The steps bellow are compatible with both nvidia-legacy-340xx-driver and nvidia-legacy-390xx-driver and can be installed on Debian 13 (Trixie) as well as Debian 12 (Bookworm) or Debian 11 (Bullseye) in both 64-bit and 32-bit version. Execute the lines one by one and wait for every line to finish before proceeding to next. Only the lines starting with sudo should be executed as root. The lines with sudo pbuilder will take a lot of time.

To install the nvidia-legacy-390xx-driver version replace 340xx with 390xx everywhere bellow.
To install both 64-bit and 32-bit libraries for wine/steam you should run Step 2. twice.

Step 1. Prepare:

Update, upgrade and install the required packages.
If you use 32-bit system do not install linux-headers-amd64.
If you plan on using both 64-bit and 32-bit libraries check if your mirror list support both amd64 and i386. If not select one which does before you install pbuilder.

sudo apt update
sudo apt upgrade
sudo apt install pbuilder linux-headers-amd64

Edit your /etc/apt/sources.list by adding contrib to the end of every line which starts with deb (if it's not already there).
Add this line too.

deb-src http://httpredir.debian.org/debian unstable main non-free contrib

Download the source code from Debian Sid.

sudo apt update
mkdir "$HOME/nvidia-340xx" "$HOME/nvidia-settings"
cd "$HOME/nvidia-340xx"
apt source --download-only nvidia-legacy-340xx-driver
cd "$HOME/nvidia-settings"
apt source --download-only nvidia-settings-legacy-340xx

Edit /etc/apt/sources.list and remove this line.

deb-src http://httpredir.debian.org/debian unstable main non-free contrib

Step 2. Compile:

To compile the 64-bit version replace ???? with amd64.
To compile the 32-bit version replace ???? with i386.
In case you want both amd64 and i386 libraries on a 64-bit system run Step 2. twice.

sudo apt update
sudo pbuilder create --distribution trixie --architecture ????
cd "$HOME/nvidia-340xx"
sudo pbuilder build nvidia-graphics-drivers-legacy-340xx_340.108-25.dsc
cd "$HOME/nvidia-settings"
sudo pbuilder build nvidia-settings-legacy-340xx_340.108-7.dsc

Optional: If you no longer need the files created during this process.

sudo rm /var/cache/pbuilder/aptcache/*
sudo rm /var/cache/pbuilder/base.tgz
rm -r "$HOME/nvidia-340xx" "$HOME/nvidia-settings"

Step 3. Install:

Create a local repository for automated install with apt.
The -m flag is only required if you want both amd64 and i386 versions.

cd /var/cache/pbuilder/result
sudo sh -c 'dpkg-scanpackages -m . > Packages'

Edit your /etc/apt/sources.list once more to add this line.

deb [trusted=yes] file:/var/cache/pbuilder/result ./

Optional: Run the next step only if you are on 64-bit system and want both 64-bit and 32-bit libraries.

sudo dpkg --add-architecture i386

Before you proceed make sure that you have matching linux-headers for every single linux-image version on your system.

sudo apt update
sudo apt install nvidia-legacy-340xx-driver nvidia-settings-legacy-340xx

Optional: I recommend to create /etc/X11/xorg.conf file.

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "ServerFlags"
    Option         "IgnoreABI" "1"
EndSection

FAQ and Troubleshooting:

-> Was this tested?
Yes, it was tested on Debian 13 and Debian 12 with lxde and bspwm.
But I won't be surprised if modern desktop environments like GNOME or KDE Plasma don't work.

-> Does suspend to RAM work?
Yes, it does.

-> Which display manager works?
I've tested only lxdm and lightdm but should work with others as well.

-> Why should I even bother with this when I can just install from Debian Sid?
The drivers in Sid are compiled with newer version libraries which are not compatible with your current system. Installing them may look fine at first glance but will also install new incompatible packages and will overwrite some of your existing packages with ones from Sid. This may result in insatiability or even in unrecoverable system.

-> Is Wayland supported?
No.

-> My mouse and keyboard work in tty but not in Xorg.
Install xserver-xorg-input-all.

-> Some applications don't start. Especially the GTK4 ones.
GTK4 is not supported by this driver. But there is a workaround. Open a terminal-emulator and prepend GSK_RENDERER=cairo before the application's name, like this.

GSK_RENDERER=cairo pavucontrol
GSK_RENDERER=cairo ghb

Do not put GSK_RENDERER=cairo in /etc/environment or in any other way as environment variable. Because this will force almost all GUI programs to run in Cairo fallback renderer.

-> VDPAU doesn't work in mpv.
The version of mpv in the repositories doesn't include the x11 backend.
It can be added by recompiling mpv with this rule enabled -Dgl-x11=enabled. Then start mpv like this.

mpv --gpu-context=x11 --hwdec=vdpau

-> I've followed every single step but it doesn't work.
Run these and see if you have matching linux-headers for every linux-image.

apt list --installed | grep linux-image
apt list --installed | grep linux-headers

If there are missing ones, install them and go to the next question.

-> I've installed the linux-headers (after the Nvidia driver) but doesn't work. How to fix it?
Installing the headers after the driver doesn't trigger dkms. Run this.

sudo apt reinstall nvidia-legacy-340xx-kernel-dkms

-> Still doesn't work.
There might be a problem with /etc/X11/xorg.conf. Delete this file and try without it.
If doesn't work try to delete everything in /etc/X11/xorg.conf.d/ except 20-nvidia-legacy-340xx.conf.
Another possible solution is to generate new Xorg configuration with nvidia-xconfig.

-> How to use the deb822-style format sources?
If you prefer to use this format append the @macflav snipped to /etc/apt/sources.list.d/debian.sources.
I haven't tested this method yet.

# added for building nvidia-legacy driver
# deb-src http://httpredir.debian.org/debian unstable main non-free contrib
Types: deb-src
URIs: http://httpredir.debian.org/debian/
Suites: unstable
Components: main non-free contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
#
# deb [trusted=yes] file:/var/cache/pbuilder/result ./
Types: deb
URIs: file:/var/cache/pbuilder/result/
Suites: trixie
Components: main
Trusted: yes
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Then you have to move all amd64 packages from /var/cache/pbuilder/result to /var/cache/pbuilder/result/dists/trixie/main/binary-amd64/.
If you have any i386 they go to /var/cache/pbuilder/result/dists/trixie/main/binary-i386/.

-> Why pbuilder complains that either i386 or amd64 packages were not found even though I've updated my mirror list?
Modifying /etc/apt/sources.list after the pbuilder installation doesn't affect pbuilder. Fix your mirrors then run.

sudo apt purge pbuilder
sudo apt install pbuilder

-> I have Nvidia Optimus what should I do?
I don't have such hardware to test but this has been discussed in my previous guide.

-> In my case apt didn't automatically install the i386 packages.
Try to install them like this.
The third line is optional.

sudo dpkg --add-architecture i386
sudo apt install nvidia-legacy-340xx-driver-libs-i386
sudo apt install libnvidia-legacy-340xx-cuda1-i386

-> Should I keep the source?
Yes, you will have to recompile the driver once in a while.
Some day the Debian team will deprecate these drivers and delete the source from the servers.
Then you will have hard time finding the source elsewhere.

-> How often should I recompile the driver?
I don't know the exact answer but I have few assumptions.

Every time any of the dependencies is updated.
Every time GCC is updated.
If the driver stops working.
If dkms fails.

Before you start recompiling you can run these just in case.

sudo rm /var/cache/pbuilder/base.tgz
sudo rm /var/cache/pbuilder/result/*

-> Can I somehow make pbuilder faster?
Yes, if you use HDD and you have at least 8GB RAM you can significantly speed the process up.
If you use SSD there won't be much difference.
I can't find this method documented so I'm not sure if I can recommended it or not.

sudo mount -t tmpfs -o size=4G tmpfs /var/cache/pbuilder/build

When you finish using pbuilder run.
Everything in /var/cache/pbuilder/build will be instantly deleted after this command.

sudo umount /var/cache/pbuilder/build

-> Wine/Steam doesn't work. Failed to load libGL: libGL.so.1:... No such file or directory...
Read the very first comment in the comments section below.

-> I see RIP warnings in the kernel log.
I was able to remove them (except one), by the following...
The nvidia-340xx source doesn't include this patch, while nvidia-390xx does.

--- a/nv-drm.c
+++ b/nv-drm.c
@@ -168,6 +168,9 @@
     .poll = drm_poll,
     .read = drm_read,
     .llseek = noop_llseek,
+#if defined(FOP_UNSIGNED_OFFSET)
+    .fop_flags   = FOP_UNSIGNED_OFFSET,
+#endif
 };
 
 static struct drm_driver nv_drm_driver = {

The easiest way to install it is to apply the patch directly to /usr/src/nvidia-legacy-340xx-340.108/nv-drm.c then run.

sudo apt reinstall nvidia-legacy-340xx-kernel-dkms

Uninstalling these, since I don't use them, removed the rest RIP warnings.

libnvidia-legacy-340xx-cuda1
libnvidia-legacy-340xx-nvcuvid1
libnvidia-legacy-340xx-encode1

-> I have other video drivers should I keep them?
These are not necessary.
Purging xserver-xorg will also delete /etc/X11/xorg.conf. Recreate it if necessary.

xserver-xorg
xserver-xorg-video-all
xserver-xorg-video-amdgpu
xserver-xorg-video-ati
xserver-xorg-video-dummy
xserver-xorg-video-fbdev
xserver-xorg-video-nouveau
xserver-xorg-video-vesa
xserver-xorg-video-vmware

-> My question is not listed here.
I've made an earlier version of this guide here where a lot has been discussed. You might find something useful reading there.

Useful logs and tools for troubleshooting:

Replace lxdm with your display manager.

systemctl status lxdm.service
cat /var/log/Xorg.0.log
journalctl
dmesg

lsmod | grep nouveau
lsmod | grep nvidia
modprobe -r nouveau
modprobe nvidia
nvidia-settings
nvidia-xconfig
nvidia-smi
vdpauinfo
glxgears
glxinfo
lspci
@Anakiev2
Copy link
Author

Anakiev2 commented Aug 24, 2025

I've installed the 64-bit version of Debian 13 on my laptop with Nvidia 240M, installed wine and wine32, both amd64 and i386 nvidia drivers. I've tested two win32 games in wine with WINEARCH=win32. Without any additional steps outside of this guide both games worked, to prove it I've made screenshots.

preview1

As additional experiment I've uninstalled all i386 nvidia libraries and tried to start the games after that. Here is what happened.

preview2

I don't accept more complains that wine/steam doesn't work.

@macflav
Copy link

macflav commented Aug 28, 2025

For anyone still on Bookworm, using 340.108 (from the deprecated guide): I have successfully upgraded from Bookworm to Trixie, no issues. Neofetch shows Kernel 6.12.41+deb13-amd64. Of course it's always a good idea to have backups, so if everything goes south you can always do a fresh Trixie install and follow this updated guide.

@pilorain
Copy link

Fresh install from debian-13.0.0-amd64-netinst.iso on asus-k70io laptop.
Unable to satisfy dependencies issue : see attached file.
Thanks in advance for help.
Regards, Pierre
Capture d’écran_2025-08-29_10-46-12

@Anakiev2
Copy link
Author

Anakiev2 commented Aug 29, 2025

@pilorain I can't read that it's not in English. My best guess is problem with /etc/apt/sources.list. You probably didn't enable contrib or you don't have deb [trusted=yes] file:/var/cache/pbuilder/result ./. After editing /etc/apt/sources.list have to always run sudo apt update.
contrib

@pilorain
Copy link

pilorain commented Aug 30, 2025

OK I started a fresh install from debian-13.0.0-amd64-netinst.iso on asus-k70io laptop (nvidia G96CM [GeForce GT 120M]).
I did enabled contrib and followed steps 1 to 3 on this guide both 64-bit and 32-bit.
But I got a startup (kernel 6.12.41) loop endlessly on these messages
TrixieNvidiaStartupEndlessly
Then I reboot on kernel 6.12.38
GRUB
on which I could open NVIDIA X Server Settings
NvidiaServerSettings
but when trying to run nvidia-xconfig as specified I got
nvidia-xconfig_not_found
Then in doubt about "have matching linux-headers for every single linux-image version" I did reboot kernel 6.12.41 recovery.
I check linux-image & linux-headers then tried to install linux-headers-6.12.38+deb13-amd64 but that failed
linux-headers_not_found
"Erreur : impossible de trouver le paquet" means "Error : unable to find packet..."
I have noted that it's install pbuilder who add kernel 6.12.38 different from 6.12.41 in debian-13.0.0-amd64-netinst.iso.
Sure I am near to succeed with your help thanks in advance. Pierre

@Anakiev2
Copy link
Author

Anakiev2 commented Aug 30, 2025

Edit:
Try this first: uninstall apparmor sudo apt autoremove --purge apparmor then reboot into the 6.12.41 kernel.

Original:
It's interesting that you are unable to install the Linux header (which are definitely missing). Post your /etc/apt/sources.list.
You can try to manually download and install the missing headers. Download http://ftp.de.debian.org/debian/pool/main/l/linux/linux-headers-6.12.38+deb13-amd64_6.12.38-1_amd64.deb and install the downloaded file with sudo dpkg -i linux-headers-6.12.38+deb13-amd64_6.12.38-1_amd64.deb. After that run sudo apt reinstall nvidia-legacy-340xx-kernel-dkms. Reboot into the 6.12.38 kernel.
The audit messages can be disabled with "audit=0" as kernel parameter (which I actually use).
Post your /var/log/Xorg.0.log too.
nvidia-xconfig have to be installed separately sudo apt install nvidia-xconfig.

I have noted that it's install pbuilder who add kernel 6.12.38 different from 6.12.41 in debian-13.0.0-amd64-netinst.iso.

That's wrong. The iso installs 6.12.38 offline then pulls 6.12.41 from the net and you end up with both.

@macflav
Copy link

macflav commented Aug 30, 2025

Debian now recommends using the deb822-style format for apt sources. Following this guide gets a bit tricky then. Here's a snippet of my debian.sources (in case anyone has trouble figuring it out):

# added for building nvidia-legacy driver
# deb-src http://httpredir.debian.org/debian unstable main non-free contrib
Types: deb-src
URIs: http://httpredir.debian.org/debian/
Suites: unstable
Components: main non-free contrib
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
#
# deb [trusted=yes] file:/var/cache/pbuilder/result ./
Types: deb
URIs: file:/var/cache/pbuilder/result/
Suites: trixie
Components: main
Trusted: yes
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

When updating, the system looks for files in directories that don't exist (/var/cache/pbuilder/result/dists/trixie/main/binary-amd64/ and /var/cache/pbuilder/result/dists/trixie/main/binary-i386/), so the workaround I found was creating the expected directory tree, then copying the installation files to that new path.

On another note, I couldn't find a straightforward way to temporarily revert to Nouveau. It used to be as simple as commenting out the "blacklist nouveau" in modprobe.d, so it was possible to have both drivers installed and choose which one to use. Now it seems that you have to uninstall the legacy proprietary driver, because Nouveau doesn't take precedence anymore. I must be missing something.

@Anakiev2
Copy link
Author

Anakiev2 commented Aug 31, 2025

@macflav Thanks for pointing that out I wasn't aware. If they force this deb822-style I have to rewrite big portion of the guide.

On another note, I couldn't find a straightforward way to temporarily revert to Nouveau. It used to be as simple as commenting out the "blacklist nouveau" in modprobe.d, so it was possible to have both drivers installed and choose which one to use. Now it seems that you have to uninstall the legacy proprietary driver, because Nouveau doesn't take precedence anymore. I must be missing something.

Try to modify /etc/X11/xorg.conf to use the nouveau driver. Maybe you need blacklist nvidia too. You can also try without xorg xonfig.

The guide has been updated to better explain how to enable contrib. I've put the @macflav information about deb822-style format in the FAQ.

@macflav
Copy link

macflav commented Aug 31, 2025

Try to modify /etc/X11/xorg.conf to use the nouveau driver. Maybe you need blacklist nvidia too. You can also try without xorg xonfig.

No luck. Disabling systemd nvidia-persistenced.service makes no difference either. If I blacklist nvidia, I can't start xorg at all. It looks like nouveau never gets loaded, whatever I try. Without a xorg.conf, I always get a black screen with a blinking cursor at the top-left. If I switch to a tty, recreate xorg.conf (nvidia) and go back to X (Ctrl+Alt+F1), the greeter is shown and everything works as expected (no reboot needed).

The guide has been updated to better explain how to enable contrib. I've put the @macflav information about deb822-style format in the FAQ.

Hopefully it could help someone. Just a reminder that it's a "snippet", to be appended to the already existing debian.sources as needed. If the user inadvertently replaces their original file, they'll end up messing things up. Also, the Packages file needs to be copied into /var/cache/pbuilder/result/dists/trixie/main/binary-i386/ as well.

@Anakiev2
Copy link
Author

Anakiev2 commented Aug 31, 2025

No luck. Disabling systemd nvidia-persistenced.service makes no difference either. If I blacklist nvidia, I can't start xorg at all. It looks like nouveau never gets loaded, whatever I try.

You can try to load the nouveau module with sudo modprobe nouveau I guess.
I am an Arch user and moved to Debian because this driver no longer works on Arch. I am used to control everything but looks like Debian has some mechanisms to make the OS unbreakable for new users which I straggle fighting.
For example if I install more then one desktop manager. I am used to disable all services with systemd and enable only the one I want to use. But here in Debian it doesn't work.
Another example is that I want a minimal OS. Even though I install everything with sudo apt install --no-install-recommends --no-install-suggests ... it still installs crap I don't want. I can remove some of them but if I try sudo apt autoremove xscreensaver it removes xscreensaver but installs 10 new packages to replace it with. Then if I delete them it brings back xscreensaver.
One more - If a package has service it's automatically enabled. There are programs which I use once a week so I don't need a service running all the time. Yes I can disable it but most of the times I don't pay attention that a services has been created and it stays enabled.
Maybe some of those mechanisms prevents you from having both nvidia and nouveau.

Just a reminder that it's a "snippet", to be appended to the already existing debian.sources

Thanks I've updated the guide.

@macflav
Copy link

macflav commented Aug 31, 2025

No luck. Disabling systemd nvidia-persistenced.service makes no difference either. If I blacklist nvidia, I can't start xorg at all. It looks like nouveau never gets loaded, whatever I try.

Silly me. I was disabling only nvidia-blacklists-nouveau.conf. There are two other files in /etc/modprobe.d/: nvidia.conf and nvidia-options.conf. Disabling all of them made the system load Nouveau as expected.

I still haven't been able to start gdm3 with Nouveau though. I'm getting the white screen of death ("Oh no! Something has gone wrong."). I don't think this is related to the legacy 340xx installation, although it was working before. Again, I must be missing something.

You can try to load the nouveau module with sudo modprobe nouveau I guess. I am an Arch user and moved to Debian because this driver no longer works on Arch. I am used to control everything but looks like Debian has some mechanisms to make the OS unbreakable for new users which I straggle fighting. For example if I install more then one desktop manager. I am used to disable all services with systemd and enable only the one I want to use. But here in Debian it doesn't work. Another example is that I want a minimal OS. Even though I install everything with sudo apt install --no-install-recommends --no-install-suggests ... it still installs crap I don't want. I can remove some of them but if I try sudo apt autoremove xscreensaver it removes xscreensaver but installs 10 new packages to replace it with. Then if I delete them it brings back xscreensaver. One more - If a package has service it's automatically enabled. There are programs which I use once a week so I don't need a service running all the time. Yes I can disable it but most of the times I don't pay attention that a services has been created and it stays enabled. Maybe some of those mechanisms prevents you from having both nvidia and nouveau.

I wasn't aware that these legacy drivers are not working on Arch anymore. I have used Arch in the past, and had 340.108 installed from the AUR (if I remember correctly). It just annoyed me whenever there was a kernel upgrade, because it took forever to recompile etc. Still, it's a shame we can't use it now.

I find it very frustrating that my old laptop "just works" out of the box with Windows 11 (although I have to bypass the TPM 2.0 requirement), yet it's such a pain to make it work with Linux. If NVIDIA won't support their old products, the least they should do is open-source their drivers. That would make the X.Org Foundation's life a bit easier. I had followed your previous guide on Debian 12 (bookworm), and had a very stable experience with Gnome. On Trixie though, Gtk4 apps only work with the cairo workaround, as you have pointed out in the FAQ, and that really ruins the user experience. I wish they'd fix the system lock-up (freezing) issue in Nouveau, so we could all move on to Wayland and carry on with our lives. I believe my 15 year-old laptop will die before it happens, though. If it ever happens...

Sorry for the rant. And thank you so much for sharing your Debian solution.

@Anakiev2
Copy link
Author

Anakiev2 commented Sep 1, 2025

If you want to have both drivers this might be interesting for you. How to switch between the drivers directly from grub.

I wasn't aware that these legacy drivers are not working on Arch anymore.

The lts kernel still works but the software doesn't. There is this new thing called build-id which make most programs coredump. If this thing comes to Debian we are screwed.

If NVIDIA won't support their old products, the least they should do is open-source their drivers.

Nvidia open-sourced the drivers for the new gpus last year but not for the legacy ones.

@TheMrTaik
Copy link

Hi, great guide! Can I post it on my personal website to spread the word? I'd be happy to include the link to this page and author!

Thanks for your support and help (I've tried it myself)!

@macflav
Copy link

macflav commented Sep 1, 2025

If you want to have both drivers this might be interesting for you. How to switch between the drivers directly from grub.

Nothing worked. This was driving me nuts, until I finally found the culprit. lsmod showed nouveau was being used, but both gdm3 and sddm crashed (using either wayland or x11). I could launch plasma directly though, with startplasma-wayland, but it was a bit wonky (sometimes the mouse pointer was lagging, indicating software rendering was probably being used). Then I tried glxinfo and got an error. Eureka! As it turned out, glx was still configured to use nvidia, so all I had to do was sudo update-alternatives --config glx and set it to nouveau. So I am finally able to keep both nouveau and nvidia 340xx installed, and choose which one to use. Thanks again for all your effort and your patience.

@Anakiev2
Copy link
Author

Anakiev2 commented Sep 2, 2025

@TheMrTaik No. You are not allowed to copy my work to other places. You can put a link to redirect people here.

@macflav I haven't tried it myself. In case you missed it the first answer is the key. In case you use xorg.conf be sure to disable Driver "nvidia". I don't have any more ideas.

@pilorain
Copy link

pilorain commented Sep 2, 2025

Bookworm fresh install from debian-live-12.5.0-amd64-xfce.iso on asus-k70io laptop (nvidia G96CM [GeForce GT 120M]).
Added “ non-free-firmware” 4 times except debian-security in sources.list ; apt update && apt upgrade ; power off-on ; then I strickly followed this guide steps 1 to 3 both 64-bit and 32-bit libraries.
Every thing went fine, no more red messages in dmesg as with nouveau, could add wine 64 and 32 without problem.
Remain stuck on reboot problem. Previously I solved it on that box with GRUB_CMDLINE_LINUX_DEFAULT="reboot=pci" but now that does not solve the stuck on reboot from xfce desktop - I can live with it for a while.
Solved with GRUB_CMDLINE_LINUX_DEFAULT="acpi=force reboot=pci"
@Anakiev2 Unfortunately your suggestions (https://gist.github.com/Anakiev2/8d62e261c66554d3012bc7ff855a22a7?permalink_comment_id=5741075#gistcomment-5741075) did not help. I loose patience that why I went back to Bookworm and succeed with it. Thanks any way for your help and for that useful guide.

@TheMrTaik
Copy link

TheMrTaik commented Sep 3, 2025

@TheMrTaik No. You are not allowed to copy my work to other places. You can put a link to redirect people here.

@Anakiev2 Thank you for your work, it's much appreciated. I can't just post a link; I understand your point. It's better if the guide remains available only here.

Thanks again for the excellent work.

@xcap2000
Copy link

@Anakiev2

Thank you very much for the great work, once more I was able to save my old Dell Latitude e6400 from obsolescence. I have done the process successfully on Debian 13 using the XFCE desktop environment. Gnome worked but most apps would not run due to GSK_RENDERER configuration not being set, KDE would not show SDDM, just the mouse appeared.
Using XFCE I was able to have a good desktop environment that works even for working, the only app I had to use GSK_RENDERER configuration was audio mixer (so far).
About the issue of the incorrect tty 7 I had the same issue and the issue was that I had "splash" in the file /etc/default/grub and solved that by setting the default plymouth theme, installing the package firmware-linux-nonfree and using the following configuration on /etc/plymouth/plymouthd.conf:
[Daemon]
Theme=text
ShowDelay=0
DeviceTimeout=1
And used the suggested /etc/X11/xorg.conf

I did only amd64 build.

Hope this helps someone.

Kind regards,

Carlos Adriano Portes

@Anakiev2
Copy link
Author

@xcap2000 Thanks for sharing your fix. Since I don't have plymouth installed and I've tested bspwm and lxde only I haven't experienced these issues. I will update the FAQ later.

@xcap2000
Copy link

@xcap2000 Thanks for sharing your fix. Since I don't have plymouth installed and I've tested bspwm and lxde only I haven't experienced these issues. I will update the FAQ later.

You are more than welcome!

@ethixill
Copy link

Hello
i read your topic and i mentioned you in mint forums when ask the boys about move to debian 13 (bcs old gpu problem)
and yeah after i see problems in linux mint these days i think i will move to this in future
so this method is work? bcs i hade gt210

@djordjevics1998
Copy link

djordjevics1998 commented Sep 12, 2025

Thank you for the guide! I succeeded in using it for my old optimus (GT540m) laptop. I had to tweak around X11 conf, i could manage to make dGPU the primary GPU, however, that would turn off my laptop's display. I succeeded in enabling it by pasting the conf from NVIDIA Optimus - Debian Wiki and adding one additional entry on top of it (in another file such as /etc/X11/xorg.conf.d/intel.conf ):

Section "Device"
  Identifier             "Screen0"
  Driver                 "intel"
  BusID                  "PCI:0:2:0"
EndSection

Usage of dGPU as the primary causes a phantom display to appear in settings. I fixed it simply by setting it to mirror my laptop's internal display. It seems it can be managed to disappear altogether with a correct X11 conf, however, a wrong one can freeze laptop GUI (tried several times before i solved the main issue, maybe it can be turned off successfully). Also, once when I tried to hide it, it switched it's name (VGA-0) to another one (LGD-0 or something like that).

I succeeded in playing Stronghold 2 on Steam with these settings (I had to use PROTON_USE_WINED3D=1 since it doesn't have Vulkan capabilities).

Edit: If you still cannot manage to use your GPU, ensure nvidia-drm params are set both in GRUB_CMDLINE_LINUX_DEFAULT (with update-grub2) and nvidia options conf (update-initramfs -u)

@Anakiev2
Copy link
Author

Here https://github.com/flydiscohuebr/nvidia-304 I've found something for xfce:

XFCE or XFWM4 showing black screen with cursor only:
Run the command below or disable the window composer before installing the driver

xfconf-query -c xfwm4 -p /general/vblank_mode -s xpresent

If the above command fails, run this

xfconf-query -c xfwm4 -p /general/vblank_mode -t string -s "xpresent" --create

There is more useful information there.

@xcap2000
Copy link

@macflav about using nvidia or nouveau, following what you discovered alongside @Anakiev2 I created and tested two scripts, one for disabling nvidia (you must run this first as it changes some files) when you followed this article thus use nouveau and one for enabling it back thus disabling nouveau:

enable-nouveau.sh

#!/bin/bash
mv /etc/modprobe.d/nvidia.conf /etc/modprobe.d/nvidia.conf.disable
mv /etc/modprobe.d/nvidia-options.conf /etc/modprobe.d/nvidia-options.conf.disable
mv /etc/modprobe.d/nvidia-blacklists-nouveau.conf /etc/modprobe.d/nvidia-blacklists-nouveau.conf.disable
sudo sed 's/Driver         "nvidia"/Driver         "nouveau"/g' -i /etc/X11/xorg.conf
update-alternatives --set glx /usr/lib/mesa-diverted
shutdown -r now

enable-nvidia.sh

#!/bin/bash
mv /etc/modprobe.d/nvidia.conf.disable /etc/modprobe.d/nvidia.conf
mv /etc/modprobe.d/nvidia-options.conf.disable /etc/modprobe.d/nvidia-options.conf
mv /etc/modprobe.d/nvidia-blacklists-nouveau.conf.disable /etc/modprobe.d/nvidia-blacklists-nouveau.conf
sudo sed 's/Driver         "nouveau"/Driver         "nvidia"/g' -i /etc/X11/xorg.conf
update-alternatives --set glx /usr/lib/nvidia
shutdown -r now

Make them executable

$ chmod + x enable-nouveau.sh
$ chmod + x enable-nvidia.sh

When running use ctrl+alt+f1 to go to tt1, make sure to logout any graphical environment not to loose work and run the script you want as root, example:

$ sudo bash enable-nouveau.sh

I gave detailed instructions in case someone getting started can avoid all the tests we did :-)

@macflav
Copy link

macflav commented Sep 13, 2025

@macflav about using nvidia or nouveau, following what you discovered alongside @Anakiev2 I created and tested two scripts, one for disabling nvidia (you must run this first as it changes some files) when you followed this article thus use nouveau and one for enabling it back thus disabling nouveau:

I had done something similar. Thank you for sharing your solution. I'm sure it will help someone.

On another note, I decided to go back to Bookworm for the time being. Nouveau was not working for me on Trixie (I was constantly getting drm: failed to create ce channel, -22 and g84_gr_tlb_flush timeout, leading to random freezing), and I wasn't happy that GTK4 was not working with Nvidia 340.108. Let's hope the current stable release will improve support for old hardware in the future.

@xcap2000
Copy link

@macflav you are welcome. Next version of MX Linux base on Debian 13 will probably support 340 drivers, lets see how it will work.

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