Reset Nvidia Drivers on Linux

Often a major update (especially involving the kernel) might break the perfectly working desktop environment. Though of late most popular distributions have sorted this out quite well – I have had really good experience with Pop OS, Solus on this front. But, there can always be a corner case when this occurs.

For example, just for fun, I put a 11 year old 9600 GT card in the box to find if it still works. And Pop OS updated as per its schedule, including the kernel. It broke the Nvidia driver.

Firstly, not all drivers will work as this is an old card. The last version that supports it, is 340.x, whereas the latest that Pop installs (also comes in its ISO image) is 440.x. Any version after 340.x on Linux does not have 9600 GT in its list of supported cards. So we need to stick to 340.x for this. I had downloaded and installed this version of the driver after putting the old card.

It is always a good idea to have a working driver saved somewhere on the disk, so that we can fail-safe in these situations. Before updating the system kernel, download this driver from Nvidia website. Search for the card, on Linux x64, and download the file

NVIDIA-Linux-x86_64-340.108.run

to somewhere on the disk. Note the location, say

$HOME/Downloads

Of course, for other cards, download the version that is latest for it. If you have a card released in the last 5 years, latest drivers should do.

Now, install the OS updates normally. After reboot, if UI does not come up (i.e login screen), fall back to a terminal using Ctrl+Shift+F3. Login using user and password, and navigate to the location where the driver was downloaded.

Make the file executable

$ cd $HOME/Downloads
$ chmod 755 NVIDIA-Linux-x86_64-340.108.run

Run as root

$ sudo ./NVIDIA-Linux-x86_64-340.108.run

Follow the prompts. Most options can just be accepted, however, depending on the driver version’s compatibility with the kernel, DKMS modules may give errors (like in my case). In that case we need to reinstall without selecting that option in the prompts.

Also install 32-bit drivers when prompted, as Steam etc. needs them. Once done,

$ reboot

, and we should now reboot on to the login screen.

Leave a comment