Vic's Blog

No results found.

Upgrading NVIDIA Drivers on Debian: A Sequel to Ollama Installation

Written   by   Victor Feight

25 • 01 • 15     /    6 minutes     [ linux, debian, nvidia, kde, drivers ]

Warning

This guide covers proprietary NVIDIA driver installation and upgrade procedures. Always backup your system before making driver changes.

Welcome back!

╰(°▽°)╯

This is a sequel to my NVIDIA driver installation guide, where we'll dive deep into properly upgrading NVIDIA drivers on Debian. After getting your NVIDIA drivers working with the correct resolution setup, you might find yourself needing to upgrade your drivers for better performance or compatibility. This guide will walk you through the entire process, including solutions to common issues you might encounter along the way.

Table of Contents #

  1. Prerequisites
  2. Checking Your Current Setup
  3. Finding the Latest Driver Version
  4. The Upgrade Process
  5. Fixing Common Issues
  6. Verification and Testing
  7. Conclusion

Prerequisites #

Before we start, make sure you have:

  • A Debian system with KDE Plasma desktop
  • Existing NVIDIA proprietary drivers installed
  • Basic knowledge of terminal commands
  • Administrative (sudo) access

Checking Your Current Setup #

Let's first check what we're working with. Run the following command to see your current NVIDIA setup:

nvidia-smi

You should see output similar to this:

|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3080 ...    Off |   00000000:01:00.0  On |                  N/A |
| N/A   59C    P8             22W /   90W |

Also check your kernel version to ensure compatibility:

uname -a

Expected output:

Linux debian 6.12.32-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.32-1 (2025-06-07) x86_64 GNU/Linux

Finding the Latest Driver Version #

Head over to NVIDIA's Unix drivers page to check the latest production branch version. As of this writing, the latest is 570.169.

You can also check the specific driver details at the NVIDIA driver details page which shows:

  • Driver Version: 570.169
  • Release Date: Tue Jun 17, 2025
  • Operating System: Linux 64-bit
  • File Size: 375.82 MB

Before proceeding, verify your system meets the minimum requirements by checking the README requirements. The key requirements include:

  • Linux kernel 4.15 and newer ✓
  • X.Org xserver 1.7+ ✓
  • glibc 2.11+ ✓

Our Debian system with kernel 6.12.32 easily meets these requirements.

The Upgrade Process #

System Update and Preparation #

First, let's ensure your system is up to date:

sudo apt update
sudo apt upgrade

Update your sources list to use the testing repository if needed:

sudo nano /etc/apt/sources.list

Perform a distribution upgrade:

sudo apt update && sudo apt dist-upgrade

Install necessary headers:

sudo apt install linux-headers-amd64

Removing Existing NVIDIA Packages #

This is the crucial step that mirrors the technique from our previous NVIDIA driver installation guide. We need to completely wipe the existing NVIDIA installation to avoid conflicts:

sudo apt-get remove *nvidia*

Downloading and Installing New Driver #

Download the latest driver:

wget https://us.download.nvidia.com/XFree86/Linux-x86_64/570.169/NVIDIA-Linux-x86_64-570.169.run

Before installation, we need to disable the display manager temporarily. Switch to a terminal using CTRL+ALT+F1-F7 and disable SDDM:

sudo systemctl disable sddm.service
sudo systemctl stop sddm.service

Make the installer executable and run it:

chmod +x NVIDIA-Linux-x86_64-570.169.run
sudo ./NVIDIA-Linux-x86_64-570.169.run

Follow the installer prompts, accepting the license and allowing it to build kernel modules.

Post-Installation Configuration #

Reboot your system:

sudo reboot

After reboot, re-enable SDDM:

sudo systemctl enable sddm.service

Fixing Common Issues #

KDE Plasma Wayland Sleep/Wake Crashes #

After upgrading, you might encounter the infamous KDE Plasma Wayland sleep/wake crash bug. This is a known issue with NVIDIA drivers and KDE Plasma 6.1.2+ on Wayland.

The Fix: Enable NVIDIA's preserve video memory option.

First, verify the setting is available:

cat /proc/driver/nvidia/params | sort

Look for these lines:

  • PreserveVideoMemoryAllocations: 1
  • TemporaryFilePath: "/var/tmp"

If PreserveVideoMemoryAllocations is not set to 1, you'll need to add the kernel parameter. Edit your GRUB configuration:

sudo nano /etc/default/grub

Add or update the following line:

GRUB_CMDLINE_LINUX='quiet video=1024x768 nvidia-drm.modeset=1 nvidia.NVreg_PreserveVideoMemoryAllocations=1'

Update GRUB:

sudo update-grub2

The necessary systemd services (nvidia-suspend.service, nvidia-hibernate.service, and nvidia-resume.service) should be enabled by default on supported drivers. Verify with:

systemctl status nvidia-suspend.service
systemctl status nvidia-hibernate.service  
systemctl status nvidia-resume.service

Reboot to apply the changes:

sudo reboot

Screen Sharing Problems #

If you encounter screen sharing issues in Discord, Firefox, or other applications with the error "Failed to start screencasting" or "Failed to create PipeWire context", this is due to missing PipeWire on a standard Debian 12 KDE installation.

The Fix: Install and start PipeWire:

sudo apt install pipewire
systemctl --user start pipewire
systemctl --user enable pipewire

Verification and Testing #

After completing the upgrade and fixes, verify everything is working:

  1. Check NVIDIA driver version:

    nvidia-smi
  2. Test GPU acceleration:

    glxinfo | grep "OpenGL renderer"
  3. Verify sleep/wake functionality:

    • Put your system to sleep
    • Wake it up and check if Plasma remains stable
  4. Test screen sharing:

    • Open Discord or Firefox
    • Try to share your screen
    • Verify it works without errors
  5. Configure NVIDIA settings:

    nvidia-settings

    Save your configuration to ~/.nvidia-settings-rc and /etc/X11/xorg.conf.

Additional Configuration #

Disable KDE's KSCREEN2 Service #

To prevent conflicts with NVIDIA settings, disable KDE's automatic display management:

  1. Open System Settings
  2. Go to "Background Services"
  3. Disable "KSCREEN2"

Create an Autostart Script #

Create a script to load NVIDIA settings on startup:

mkdir -p ~/.local/state
nano ~/.local/state/nvidia-setting.sh

Add the following content:

#!/bin/bash
nvidia-settings --load-config-only

Make it executable:

chmod +x ~/.local/state/nvidia-setting.sh

Add this script to your KDE Autostart settings through System Settings.

Conclusion #

Congratulations! You've successfully upgraded your NVIDIA drivers on Debian and resolved the common issues that plague many users. The key takeaways from this process are:

  1. Always clean-install drivers by removing existing packages first
  2. Enable preserve video memory to fix Wayland sleep/wake issues
  3. Install PipeWire for proper screen sharing functionality
  4. Verify compatibility before upgrading

This upgrade process ensures you get the latest performance improvements and bug fixes while maintaining system stability. Your Ollama setup should now run even more smoothly with the updated drivers!

Remember to bookmark this guide for future driver upgrades, as the same technique applies each time NVIDIA releases new drivers.

Happy computing! 🚀

References #

🙏 SHARE 🙏

Thanks so much for reading this far, please consider sharing this article on your favorite social media network. I love receiving feedback. For feedback, please ping me on Twitter.