Installing Nvidia driver in Debian 10

A discrete graphics card from Nvidia are some of the most common. They offer maximum performance at a slightly higher price compared to other manufacturers. By default in Debian for Nvidia cards the nouveau driver is open source.

This driver does not support fine-tuning of the video card, and usually has lower performance. However, you can always install the proprietary driver. In this article we will discuss how to install Nvidia driver Debian 10.

  • Installing Nvidia driver in Debian
    • 1. How do I know which driver version you need
    • 2. Preparing to install the video driver
    • 3. Install the driver from the Debian repository
    • 4. Install the driver from the testing repository
    • 5. Installing the Nvidia driver from the official site
    • 6. Check the installation is complete
  • Removing the Nvidia driver from Debian
    • 1. Remove drivers from the repository
    • 2. Remove the drivers installed from the Nvidia website
  • Insights

Installing Nvidia driver in Debian

1. How do I know which driver version you need

In order to view installed proprietary driver run:

lspci-k | grep -EA2 "VGA|3D|Display"

Utility nvidia-detect allows you to view information about the graphics card Nvidia and to determine the recommended driver for this model. Utility is installed with the following command:

sudo apt-y install nvidia-detect

To know the recommended graphics driver using command:

sudo nvidia-detect

If you do not want to install this utility, you can see the official Nvidia website or use the following guidelines:

  • driver version 340.107 for video cards GeForce, beginning with the 8-series and up to the 300-series;
  • driver version 390.116 — for GeForce 400 and 500 series;
  • driver version 418.74 or newer for GeForce 600 series and above.

2. Preparing to install the video driver

Before you will install the Nvidia driver in Debian 10, installed the kernel headers:

sudo apt install linux-headers-$(uname-r|sed 's/[^-]*-[^-]*-//')

3. Install the driver from the Debian repository

Open the file repository sources.list in mcedit and add to the branch contrib and non-free:

sudo mcedit /etc/apt/sources.list

deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free

Save the changes to sources.list by pressing F2. Exit the text editor by pressing F10.

Updated list of packages on your system:

sudo apt update

To install the latest stable version of the driver from the repositories, run:

sudo apt install nvidia-driver

For video card series 400-500 necessary to install the driver up to and including version 390:

sudo apt install nvidia-legacy-390xx-driver

To install Nvidia driver Debian 10 version 340 for very old graphics cards, run the command:

sudo apt install nvidia-legacy-340xx-driver

If you have installed the driver version 340, it is possible, it need to install nvidia-xconfig:

sudo apt install nvidia-xconfig

Run the package nvidia-xconfig to automatically create the configuration file:

sudo nvidia-xconfig

Reboot the system:

sudo reboot

4. Install the driver from the testing repository

At the moment the latest version of the driver is 430.64. This package can be used for GeForce 600 series and above. The driver is not yet included into the mainline kernel repository.

When installing a repository is used buster-backports — official repository packages from testing and unstable branches, designed to work in the stable version of the OS, for example, security patches. This repository provides the most recent versions of packages. First add the repository buster-backports /etc/apt/sources.list:

sudo mcedit /etc/apt/sources.list

deb http://deb.debian.org/debian buster-backports main contrib non-free

Save the changes to sources.list by pressing F2. Exit the text editor by pressing F10. Then updated the packages on your system:

sudo apt update

And install the Nvidia driver in Debian:

sudo apt install-t buster-backports nvidia-driver

Reboot the system:

sudo reboot

5. Installing the Nvidia driver from the official site

A downloadable file with the software from Nvidia:

Check existence of file in folder Download:

cd Boot && ls

Disable the nouveau driver:

sudo echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf

sudo echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf

Install required build packages for gcc and make:

sudo apt install gcc make

Deactivate the GUI for the OS after the reboot:

sudo systemctl set-default multi-user.target

Reboot the system:

sudo reboot

Autorisoes in the terminal as root. Go to the folder /home/user/Download:

cd /home/username/Download

Run the command:

sudo bash NVIDIA-Linux-x86_64-390.116.run

During the installation process you will need to answer some questions and perform the appropriate issues of the action. At the same time, depending on your system settings, some of the issues may be missing. The displayed information:

The CC version check failed:

The kernel was built with gcc version 8.2.0 (Debian 8.2.0-14), but the current compiler version is cc (Debian 8.3.0-2) 8.3.0.

  • Ignore CC version check
  • Abort installation

Install NVIDIA’s 32-bit compatibility libraries?

  • Yes
  • No

An incomplete installation of libglvnd was found. Do you want to install a full copy of libglvnd? This will overwrite any existing libglvnd libraries.

  • Don’t install libglvnd files
  • Install and overwrite existing filesort installation.
  • Abort installation

Would you like to run the nvidia-xconfig utility to automatically update your X configuration file so that the NVIDIA X driver will be used when you restart X? Any pre-existing X configuration file will be backed up.

  • Yes
  • No

Return the system boot in graphical mode and reboot:

sudo systemctl set-default graphical.target

sudo systemctl reboot

6. Check the installation is complete

To check the installed driver by using the command:

lspci-k | grep -EA2 “VGA|3D|Display”

Removing the Nvidia driver from Debian

1. Remove drivers from the repository

Removed the Nvidia driver with the command:

sudo dpkg-P $(dpkg-l | grep nvidia-driver | awk '{print $2}')

Next, execute:

sudo apt autoremove

Activate again the nouveau driver:

sudo apt install xserver-xorg-video-nouveau

Reboot the system:

sudo reboot

2. Remove the drivers installed from the Nvidia website

Go to the folder with the package that contains the driver:

cd /home/user/Downloads

Then, to remove the Nvidia driver in Debian run:

sudo bash NVIDIA-Linux-x86_64-XXX.XX.run --uninstall

In the process of removing the driver the system will ask to restore the xorg configuration from backup? Answer: Yes.

Restoring from backup the configuration of xorg, if not done so in the process of removing the driver:

sudo nvidia-xconfig --restore-original-backup

Activate the nouveau driver:

sudo rm /etc/modprobe.d/blacklist-nvidia-nouveau.conf

Reboot the system:

sudo reboot

Insights

Today we figured out how to install the Nvidia driver in Debian 10. We have considered the issues of installing the drivers from both the repository and from the official Nvidia website and the installation of different versions. We tested the performance of the drivers. Also attention was paid to the procedure of removing the Nvidia driver from the system and return to the nouveau driver open source.

Source: losst.ru

(Visited 838 times, 14 visits today)