How to install private Nvidia drivers on Debian 9 Stretch?

nvidia-driver-debian-stretch

This tutorial we will show you how to install Nvidia graphics drivers on Debian 9 Stretch. By default, Debian uses the open source driver nouveau, which is included in the Linux kernel, for Nvidia cards.

However, this driver lacks 3D acceleration support, so if you want to get the most out of your graphics card in your system, you must install its private drivers.

Before installing the proprietary driver, I recommend disabling Secure Boot if you are using UEFI firmware.

This is because the Nvidia module will be added to the kernel, so the new kernel will not be able to pass signature verification. If Secure Boot is enabled, your system might not be able to boot.

Installing the Nvidia driver on Debian 9 Stretch

To start installing the Nvidia drivers in our system, we must open a terminal and in it let's proceed to verify which driver is being used for the Nvidia card:

sudo apt install lshw
sudo lshw -c display

Where they can verify that they are using the nouveau open controller:

new

Since the Nvidia package on Debian is proprietary, We must enable the contrib and non-free repositories in /etc/apt/sources.list with the following commands.

sudo apt install software-properties-common
sudo add-apt-repository contrib
sudo add-apt-repository non-free
sudo apt update

Now it's time to blacklist the nouveau driver, to avoid possible conflicts:

sudo nano /etc/modprobe.d/blacklist-nouveau.conf

And inside the file we put the following:

blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off

We close and save with Ctrl + O and Ctrl + X.

Now Install the nvidia-driver package using the following command:

sudo apt install nvidia-driver

During installation you will see the following message, just hit Enter to continue.

xserver-xorg-config-nvidia

In case any error occurs during the installation of the package on the system, you will need to install the driver from the stretch-backports repository.

To do this, in the terminal you must type the following command:

sudo add-apt-repository 'deb http://ftp.debian.org/debian stretch-backports main contrib non-free'
sudo apt update

Now To install the nvidia-driver from the stretch-backports repository already added to the system, we must type the following command:

sudo apt install -t stretch-backports nvidia-driver

Once the installation is complete, restart your computer with the help of the following command:

sudo shutdown -r now

Checking the installation

After the system reboot, We proceed to start our user session, we are going to open a terminal and in it we are going to type the following command:

sudo lshw -c display

In this case they should already see that they are using the Nvidia drivers. You can look in your application menu for the Nvidia X Server program.

With which the driver version, graphics card specification, card temperature, etc. can be used.

If you can't find this program, you can install it with:

sudo apt install nvidia-xconfig

And run with:

sudo nvidia-xconfig

Switch between Intel and Nvidia graphics card on Nividia Optimus laptops

For those who are laptop users with Nividia Optimus, It is possible that they encounter an error when opening the Nvidia X Server program, since when they open it they will see a message like:

"It seems you are not using the nvidia x debian driver"

For this they can use Bumblebee and Primus to run individual applications on the Nvidia card. To install Bumblebee and Primus on your system, you must open a terminal and run the following commands:

sudo dpkg --add-architecture i386
sudo apt install
sudo apt install bumblebee bumblebee-nvidia primus primus-libs: i386 libgl1-nvidia-glx: i386

To run a program on the Nividia card, just use the command as a prefix primusrun.

In this case you can verify this with the following command:

primusrun glxinfo | grep OpenGL

To open the Nvidia X server setup program, run:

optirun nvidia-settings -c :8

How to uninstall proprietary Nvidia drivers in Debian 9 Stretch?

If for some reason you no longer want the proprietary controller or it is causing conflicts with your system, you can remove it from your system using the following commands:

sudo apt purge nvidia- *
sudo apt autoremove


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Linuxero since 1998 said

    The DEBIAN wiki has always explained step by step, how to install NVIDIA drives.
    Simpler than explained here.
    A greeting.