Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Debian 9 - Install Nvidia Drivers

If you wish to install the nvidia drivers, run the steps below.

Steps

Add the non-free sources

sudo editor /etc/apt/sources.list

Append the following lines to the end of the file (if you don't have them already).

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

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

deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main

Now install nvidia-detect and run it.

sudo apt-get update && sudo apt install nvidia-detect -y
nvidia-detect 

Example output

Detected NVIDIA GPUs:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380] (rev a2)

Checking card:  NVIDIA Corporation GM107 [GeForce GTX 750 Ti] (rev a2)
Your card is supported by the default drivers and legacy driver series 340.
It is recommended to install the
    nvidia-driver
package.

Follow its instructions which will probably state as above, to install the nvidia-driver package

sudo apt-get install nvidia-driver

Then reboot for the changes to take effect.

References

Last updated: 9th May 2020
First published: 16th August 2018