6
April
2025
Installing NVidia video card driver instead of Nouveau in Ubuntu OS
0:49

Installing NVidia video card driver instead of Nouveau in Ubuntu OS

6 April 2025 0:49

Successfully updated the nouveau driver to nvidia:390 in RUNTU Lite 20.04 (the instructions can also be used for other Ubuntu-based OSes).

Earlier I wrote article about installing the Nvidia driver. This time I completed the installation without pushing away from it.

Requirements

To install the NVidia driver instead of Nouveau on Ubuntu Linux, the following must be completed:conditions:
*Linux Ubuntu or an operating system (OS) based on it Linux. For example,runtu LITE*.
Sufficient free hard disk space to build the kernel. I have 2GB available in my /boot partition after removing unused kernels. If a separate /boot mount point does not exist (see output df -h), we are talking about free space in the root of the “/” drive.
a kernel version must be used that supports embedding the Nvidia module into the kernel using the DKMS system(a sign of such a kernel: there are no problems with package dependencies linux-headers). To install kernels, you can use the mainline utility. If headers is not installed, then the kernel version is too high for this OS and needs to be downgraded. I have the 5.15.0-97-generic kernel for RUNTU Lite 20.04 (displayed by the command uname -r)
there is a driver for this video card, operating system**. The team is responsible for this sudo ubuntu-drivers list и за ней sudo ubuntu-drivers install.

First you need to select the right kernel: see.article about the mainline utility. Focus on the absence of dependency errors when installing in mainline package linux-headers.

Newer kernels in terms of DKMS are compatible only with new versions of the OS. For example, kernels 6.8-6.14 are suitable for Ubuntu 24.04, but not for 20.04 - DKMS does not work).

Original video card driver

sudo inxi -G

Graphics: Device-1: NVIDIA GF119 [GeForce GT 610] driver: nouveau v: kernel

       Display: server: X.Org 1.20.13 driver: modesetting resolution: 1280x1024~60Hz

       OpenGL: renderer: NVD9 v: 4.3 Mesa 21.2.6</code>

(Goal: install nvidia driver instead of nouveau).

nvidia graphics driver installation process

1) Kernel used:

uname -r

5.15.0-97-generic

2) Installation of the ubuntu-drivers package (done earlier):

sudo apt install ubuntu-drivers-common

Package Description ubuntu-drivers-common:
Description: Detect and install additional Ubuntu driver packages
This package aggregates and abstracts Ubuntu specific logic and knowledge
about third-party driver packages. It provides:
.

  • a Python API for detecting driver packages for a particular piece of
    hardware or the whole system.
    .
  • an "ubuntu-drivers" command line tool to list or install driver packages
    (mostly for integration in installers).
    .
  • some NVidia specific support code to find the most appropriate driver
    version, as well as setting up the alternatives symlinks that the
    proprietary NVidia and FGLRX packages use.

    3) Request ubuntu-drivers for a list of available drivers

    sudo ubuntu-drivers list

nvidia-340
nvidia-driver-390

4) Trying to install a suitable driver automatically

sudo ubuntu-drivers install

Reading package lists... Done
Building a dependency tree

Reading status information... Done
The following packages were installed automatically and are no longer required:
amd64-microcode intel-microcode iucode-tool
To remove them, use "sudo apt autoremove".
Recommended packages:
libcuda1-340 nvidia-opencl-icd-340
The following NEW packages will be installed:
nvidia-340

...

Error! Bad return status for module build on kernel: 5.15.0-97-generic (x86_64)
Consult /var/lib/dkms/nvidia-340/340.108/build/make.log for more information.
dpkg: error processing package nvidia-340 (--configure):
installed nvidia-340 package post-installation script subprocess returned error exit status 10
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.17) ...
Processing triggers for initramfs-tools (0.136ubuntu6.7) ...
update-initramfs: Generating /boot/initrd.img-5.15.0-97-generic
I: The initramfs will attempt to resume from /dev/sda7
I: (UUID=7a17fe7e-acee-4c19-8641-1fdd39d0364d)
I: Set the RESUME variable to override this.
Errors occurred while processing the following packages:
nvidia-340

Automatic installation selected nvidia-340, driver installation was unsuccessful.

5) Manual installation of nvidia-390 driver:

Driver installation nvidia-390 using the command sudo ubuntu-drivers install драйвер:версия:

sudo ubuntu-drivers install nvidia:390

Reading package lists... Done
Building a dependency tree

Reading status information... Done
The following packages were installed automatically and are no longer required:
amd64-microcode intel-microcode iucode-tool
To remove them, use "sudo apt autoremove".
The following additional packages will be installed:
libnvidia-cfg1-390 libnvidia-common-390 libnvidia-compute-390 libnvidia-decode-390 libnvidia-encode-390 libnvidia-fbc1-390
libnvidia-gl-390 libnvidia-ifr1-390 nvidia-compute-utils-390 nvidia-dkms-390 nvidia-kernel-common-390
nvidia-kernel-source-390 nvidia-utils-390 xserver-xorg-video-nvidia-390
Recommended packages:
nvidia-prime libnvidia-compute-390:i386 libnvidia-decode-390:i386 libnvidia-encode-390:i386 libnvidia-ifr1-390:i386
libnvidia-fbc1-390:i386 libnvidia-gl-390:i386
The following packages will be REMOVED:
nvidia-340
The following NEW packages will be installed:
libnvidia-cfg1-390 libnvidia-common-390 libnvidia-compute-390 libnvidia-decode-390 libnvidia-encode-390 libnvidia-fbc1-390
libnvidia-gl-390 libnvidia-ifr1-390 nvidia-compute-utils-390 nvidia-dkms-390 nvidia-driver-390 nvidia-kernel-common-390
nvidia-kernel-source-390 nvidia-utils-390 xserver-xorg-video-nvidia-390
0 packages were updated, 15 new packages were installed, 1 packages were marked for removal, and 0 packages were not updated.
1 package was not installed or uninstalled.
You need to download 48.3 MB of archives.

...

Loading new nvidia-390.157 DKMS files...
Building for 5.15.0-97-generic
Building for architecture x86_64
Building initial module for 5.15.0-97-generic
Error! Bad return status for module build on kernel: 5.15.0-97-generic (x86_64)
Consult /var/lib/dkms/nvidia/390.157/build/make.log for more information.
dpkg: error processing package nvidia-dkms-390 (--configure):
installed nvidia-dkms-390 package post-installation script subprocess returned error exit status 10
The package libnvidia-decode-390:amd64 (390.157-0ubuntu0.20.04.1) is being configured...
The package libnvidia-gl-390:amd64 (390.157-0ubuntu0.20.04.1) is being configured...
The package libnvidia-encode-390:amd64 (390.157-0ubuntu0.20.04.1) is being configured...
dpkg: Package dependencies do not allow nvidia-driver-390 package to be configured:
nvidia-driver-390 depends on nvidia-dkms-390 (<= 390.157-1), however:
The nvidia-dkms-390 package is not configured yet.
nvidia-driver-390 depends on nvidia-dkms-390 (>= 390.157), however:
The nvidia-dkms-390 package is not configured yet.

dpkg: error processing package nvidia-driver-390 (--configure):
dependency problems - leave unconfigured
No apport report was written because the error message indicates a repeat error from a previous failure.

It can be seen that DKMS has built the driver into the kernel, and the error occurred during the nvidia-dkms-390 configuration step (--configure).

6) Command to fix broken packages:

sudo apt --fix-broken install

There were no mistakes. Rebooted the computer. I checked the same kernel 5.15, just in case, and selected “Advanced boot options” in the Grub2 advanced boot menu. (In the future, the remaining kernels need to be removed, for example, in synaptic, so as not to interfere).

7) Check which graphics driver is used using the inxi -G command:

sudo inxi -G

Graphics: Device-1: NVIDIA GF119 [GeForce GT 610] driver: nvidia v: 390.157

       Display: server: X.Org 1.20.13 driver: nvidia resolution: 1280x1024~60Hz

       OpenGL: renderer: GeForce GT 610/PCIe/SSE2 v: 4.6.0 NVIDIA 390.157</code>

Ultimate video card driver

Judging by the output of inxi -G, driver driver: nvidia v: 390.157.

That's what was required. The problem is solved.

Differences between NVidia and Nouveau drivers

NVidia is a closed source driver, Nouveau is open source. The difference between them is in the capabilities of video and 3D acceleration. For 2D, the differences are not visible to the eye, but noticeable when tested in a synthetic test that simulates browsing a website Speedometer 2.1. NVidia is faster than Nouveau - 110 versus 90 on my PC. On the other hand, open source supporters can continue to use the Nouveau driver.



Related publications