This site is being rebuilt and designed in public. Please excuse placeholder content, broken design, etc.!

Blog post: NVidia, Linux, and Wayland fun times

I switched my Ubuntu 24.04 install to the HWE stack yesterday to try out the 6.11 kernel, and everything seemed fine at first, but then I restarted and lost my NVidia driver. I've had this happen before and the solution is not super clear (I still don't know what ended up fixing it) so I'm just going to document a bunch of stuff I tried so I don't have to search for it again.

The basic problem as far as I can tell (beyond the fact that Linux, Wayland and NVidia just do not play well together) is that the kernel does not get the NVidia driver compiled into it correctly when an updated kernel is installed. This has also happened to me when installing a new NVidia driver using the ".run" file downloaded from NVidia. Probably better to stick with the recommended driver from Ubuntu, or maybe one of the ones from the graphics-drivers PPA.

I'm uploading a PDF here (for safe keeping) from a GitHub repository which covers a lot of this in more detail.

Things I did which may have made it worse, better, or neither include:

1. Starting in recovery mode and installing the ".run" drivers downloaded from NVidia here: Unix Drivers | NVIDIA

2. Doing the same but uninstalling them.

3. Installing the "recommended" version using "ubuntu-drivers" CLI or "Additional Drivers" GUI.

4. Completely removing all NVidia drivers. Make sure Nouveau is not blacklisted if you do this.

5. Using nvidia-settings (when it works) to enable Prime Performance mode. This tells the system to use the NVidia card by default (I think) instead of the onboard Intel graphics chip.

5. Compile the driver into the kernel using "dkms" (and also removed/reinstalled it). This supposedly shouldn't be necessary anymore, but at some point I definitely did not have the NVidia modules installed and this did it.

dkms remove -m DRIVER_NAME --all
dkms install -m DRIVER_NAME --all

"-all" means do this to all kernels. There's also a "-k" parameter to install to a specific kernel only.

5. Adding the "graphics drivers" PPA and installing newer driver versions from that (via ubuntu-drivers or Additional Drivers).

Also at one point I had a repeat of an old problem where my laptop would boot to a black screen unless it was plugged in to an external monitor. This can be fixed by deleting "/etc/X11/xorg.conf" and letting the system rebuild it. There's also /etc/gdm3/monitors.xml which I think handles some of this for Wayland. In the end deleting some of these configs resolved this issue. And also run "nvidia-xconfig" which will find problems with the x11 config, which was apparently my issue. Maybe?

Socials