Fixing a Broken NVIDIA / GNOME Setup on Ubuntu

3 minute read

Published:

Recently my Ubuntu installation ended up in a broken state after a reboot: external displays stopped working, nvidia-smi failed inside the desktop environment (DE), and the system would hang while stopping gdm during shutdown. Interestingly, the NVIDIA driver still worked in recovery mode, which suggested the kernel modules themselves were not completely broken. I decided to reset both the NVIDIA stack and the DE entirely since I have had issues in the past with GPU weirdness.

One thing that helped diagnose root issues was disabling the graphical splash screen during boot. By default Ubuntu hides most boot messages behind the splash screen, which makes it hard to see where the system is hanging.

To see the real boot output, while in the Ubuntu DE I edited the GRUB configuration:

1
sudo nano /etc/default/grub

In the line:

1
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

I removed quiet splash so it became:

1
GRUB_CMDLINE_LINUX_DEFAULT=""

Then I updated the GRUB:

1
sudo update-grub

Now Ubuntu displayed the full boot log instead of the splash screen. This made it obvious that the system was hanging while rebooting from the DE due to gdm, which pointed toward a joint problem with the DE and GPU stack rather than the kernel itself.

At this point, I hard reset, then powered back on. I then pressed ESC in order to reveal the GRUB boot menu. I then entered recovery mode and fixed the issue as follows:

First, I updated the system to ensure all packages and kernel components were consistent:

1
apt update && apt upgrade

Next, I completely removed all NVIDIA and CUDA packages:

1
apt --purge remove "*nvidia*" "*cuda*"

To make sure no stale desktop configuration remained, I also removed the GNOME desktop and the display manager:

1
apt --purge remove ubuntu-desktop gdm3

Then I cleaned up any remaining dependencies:

1
apt autoremove

After that, I reinstalled the desktop environment:

1
apt install ubuntu-desktop gdm3

Finally, I let Ubuntu reinstall the recommended GPU drivers automatically:

1
ubuntu-drivers install

After rebooting, the system came up normally again. NVIDIA worked inside the desktop environment, external displays were detected, and the gdm shutdown hang was gone. While perhaps not the most elegant solution, completely resetting both the GPU drivers and the desktop environment turned out to be the fastest path to a clean state.

Update (2026-03-10)

Interestingly, this solution worked only temporarily. I did not dig into system logs; however, it turns out that by default ubuntu-drivers will try and install the most recent stable driver available. In this, on my Ubuntu 24.04 system with v6.17 kernel, the automatically installed driver was nvidia-driver-590. Oddly, this is actually not the driver version that is recommended if you list the available devices for which drivers are available with

1
ubuntu-drivers devices

The output was

1
driver   : nvidia-driver-580-open - distro non-free recommended

So, in order to properly fix my problem, I did the following:

1
2
3
4
5
6
7
8
9
10
11
12
# 1. Purge all NVIDIA leftovers
sudo apt purge '*nvidia*' '*cuda*'
sudo apt autoremove

# 2. Update package lists
sudo apt update

# 3. Install NVIDIA driver 580
sudo apt install nvidia-driver-580 nvidia-settings nvidia-prime

# 5. Reboot
sudo reboot

I ended up doing this for v6.14 kernel, which I set to the default kernel loaded during boot by modifying /etc/default/grub with

1
GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 6.14.0-37-generic"

and then sudo update-grub.

I have since had no issues with my drivers or display manager :))