I recently installed Ubuntu 20.04 “Focal Fossa” on an old desktop. My junk box has shrunk over the years so the only surplus graphics card I had on hand was an ancient Nvidia GeForce 210.
I didn’t think too much about the age of the card and at first all seemed well – the machine booted and the installation process started without any drama. Until near the end of the installation process where I received an error caused by the nvidia-340 package, and the machine didn’t boot properly after the installation finished. I tried again without the proprietary packages and installation completed and the machine rebooted to the login screen. When I tried to log in I got a blank screen and not much else – sadly I’ve seem a number of similar issues when using the free Noveau driver that is the default option for Nvidia cards in most Linux distros.
Eventually I discovered a few things that I’m making a note of here in case anyone else stumbles across this issue:
- The Nvidia driver version 340 is the last to support the GeForce 210.
- The Nvidia 340 driver only supports Linux kernels up to version 5.4.
- This driver version exists in the Ubuntu Focal repositories (nvidia-340).
- Ubuntu 20.04 desktop version ships with the hardware enablement (HWE) kernel, which is currently at 5.11.
It appeared that the Ubuntu installer was smart enough to realise I needed the nvidia-340 driver package, but not smart enough to realise that this meant reverting to the original GA kernel version of 5.4 (this is the default in the server version). An unfortunate combination!
Here’s how to install the desktop anyway and still get the card running with the Nvidia driver. The downside to not using the HWE kernel is potential lack of support for really recent hardware models, but if you are using such an old GPU in the first place I’m guessing the rest of your machine isn’t particularly bleeding edge either.
- Boot from the Ubuntu 20.04 Desktop DVD, ISO or USB image and run the installer.
- When prompted for the installation type, disable the option to install third-party drivers and codecs:
- Wait for the installation to finish and login to the desktop.
- Open a terminal and install the GA kernel package:
sudo apt install --install-recommends linux-generic
- Reboot so we can load the older kernel version – don’t install the legacy Nvidia drivers until you are actually running the 5.4 kernel.
- Press Esc immediately after the BIOS POST to enter the GRUB menu.
- Select Advanced Options for Ubuntu and press Enter:
- Select the latest 5.4 kernel version listed and press Enter to begin booting:
- Log in and run a terminal again.
- Check that the machine is actually running a 5.4 kernel version using the
uname
command:uname -r
5.4.0-81-generic - Install the Nvidia legacy driver:
sudo apt install nvidia-340 - If all goes well then you can remove the HWE kernel packages:
sudo apt-get remove --purge linux-generic-hwe-20.04 linux-oem-20.04 linux-hwe-* linux-oem-* linux-modules-5.1*
- Reboot and check that everything works!
So that’s not the most “direct” method, but it’s the least likely to get you into a frustrating position like accidentally removing all of the kernel packages entirely and rendering the machine unbootable.
If you want to verify the driver being used for the GPU, launch a terminal and run lspci
to find the PCI address of the Nvidia GPU:
lspci | grep NVIDIA
03:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2)
03:00.1 Audio device: NVIDIA Corporation High Definition Audio Controller (rev a1)
In this case we can see the GPU itself is at PCI address 03:00.0
although this may differ on your system. Run lspci
in verbose mode (-v
) and specify the address (-s 03:00.0
) to find the kernel module (driver) in use:
lspci -vs 03:00.0
03:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce 210] (rev a2) (prog-if 00 [VGA controller])
Subsystem: ASUSTeK Computer Inc. GT218 [GeForce 210]
Flags: bus master, fast devsel, latency 0, IRQ 88
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f0000000 (64-bit, prefetchable) [size=32M]
I/O ports at 8000 [size=128]
Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: nvidia
Kernel modules: nvidiafb, nouveau, nvidia
In this case the driver in use is nvidia
, which is the official Nvidia driver and should enable full hardware acceleration capabilities of the GPU.
If you do end up with a non-working system, press Esc at boot to get to the GRUB prompt and try booting into recovery mode. That should enable you to be able to remove the Nvidia driver package, reinstall the HWE kernel and revert any changes.
Is it worth it anymore? Is there a big advantage to utilize the Nvidia-340 over the one provided with install?
No good reason to use 340 unless you are using a GPU that isn’t supported by later drivers, which was the case above.
Thanks very much for providing this! Just had this same problem with an MSI Geforce GTX 260 that I am setting up to donate to charity.
Thanks so much. My mac mini is running like a champ now. The free driver had some problems with the mini display port output. I would have been so lost without this!
FYI these instructions did not work for me with the latest ubuntu 20.04 as of 2/1/2022
Easier instead, to add-apt-repository this repo. apt update and apt install from there. This was the thing which worked for me.
https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1872950
This article was extremely helpful for me. I have a 13 year old Dell Latitude E6400 laptop with a Nvidia GPU. Since the Ubuntu 20.04 upgrade I’ve been plagued with temporary and/or permanent freezing of the system and unable to use anything except Chromium (using any other application would lock the system permanently). The GPU chip, right next to the battery, would also get extremely hot during these lockups, so it was not only annoying but also a safety hazard. I checked the kernel log and every time a lockup occurred I would get the error “[TTM] Buffer eviction failed”.
Admittedly I skipped a few steps and only checked the kernel version before installing sudo-apt install nvidia-340 but luckily this is all I needed and now the system is working perfectly. Thanks again!
Or you could just go to
https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy
Thanks, this was very useful for an old Dell XPS 13 laptop. One small caveat – getting into Grub wasn’t possible on my system (booted too fast or something?) so I ended up following the top answer here: https://askubuntu.com/questions/668049/grub-menu-at-boot-time-holding-shift-not-working
yeah, still works with Linux Mint 21.1 on a Acer 8930G with nvidia9700M
Use the “Compatibility mode” to boot and install Linux Mint.
After the installation, press “shift2 and use “Advanced Options” -> “Recovery mode” from the boot menu and choose “resume”.
And follow https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-340/+bug/1872950