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
- 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.