Tuesday, December 5, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  4] [ 0]  / answers: 1 / hits: 5339  / 1 Year ago, thu, august 25, 2022, 3:02:54

I have a laptop running Lubuntu 21.04, but which was previously running 20.04 LTS. The system has an NVIDIA GeForce 9400M graphics processor.

Under 20.04 LTS, the "Software Sources" dialog was able to find the graphics card easily, and show me the option to toggle between either the Nouveau driver or the proprietary NVIDIA driver. I was able to choose the latter option and the driver was working just fine. The same also worked after I upgraded to Lubuntu 20.10: it was using that driver.

However, after I upgraded to Lubuntu 21.04, it switched to the Nouveau driver. The option to toggle to the NVIDIA driver is no longer present in the Software Sources dialog.

I tried using sudo apt-get install nvidia-driver-340, but it couldn't find the package. nvidia-340 showed up as a Nouveau package when I used apt-cache search, so I didn't try that. I also tried sudo add-apt-repository ppa:graphics-drivers/ppa, but the above first command still didn't work.

I also tried downloading the 340 driver from the Nvidia website and manually installing that, but the installation failed. (If necessary, I can post the log file.)

How can I use the proprietary NVIDIA driver for graphics under 21.04? Why did it stop working there?

I imagine the same problem will also apply to those sticking with LTS versions of Ubuntu, when upgrading from 20.04 LTS to 22.04 LTS.

More From » drivers


As ChanganAuto commented, the NVIDIA driver 340 isn't officially supported on the kernel that 21.04 uses, 5.11. (The error log for the installation I mentioned actually doesn't contain anything other than what I was shown when installing.)

However, I was able to find a way to work around the issue and use the driver anyway, by following the instructions at https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy. Basically, you have to enter the following three commands:

sudo add-apt-repository ppa:kelebek333/nvidia-legacy
sudo apt-get update
sudo apt-get install xorg-modulepath-fix

After executing these three commands and reopening the Software Sources settings, the option to select the NVIDIA driver was showing once again. I selected it, and it's working fine now.

Just a word of warning, though: after doing this, I noticed that the options for Important and Recommended Updates were deselected, so my system wasn't updating anymore. I selected those again and that solved that.

Update: I just upgraded from 21.10 to 22.04 LTS today, and as part of the upgrade the NVIDIA driver was automatically uninstalled. I noticed it was uninstalled as I read the details as to what packages will be removed before proceeding with the upgrade. And yes, after the upgrade, my system would freeze after the kernel boot was complete.

I fixed the issue by booting in recovery mode and resuming the boot, which worked fine as it starts up with generic drivers, then re-running the three commands above.

To prevent this from happening, I recommend temporarily changing your Software Sources settings to use the Nouveau driver before performing the upgrade, then, after restarting, running the commands and changing back to proprietary drivers.

[#1613] Thursday, August 25, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 33
Total Questions: 136
Total Answers: 114

Location: Singapore
Member since Wed, Jan 13, 2021
3 Years ago
taigysel questions
Wed, Mar 23, 22, 10:19, 2 Years ago
Tue, Sep 6, 22, 23:54, 1 Year ago
Tue, Jul 26, 22, 00:33, 1 Year ago
Sat, Mar 12, 22, 03:09, 2 Years ago