In this tutorial I will show you how to properly install nvidia drivers on debian 9 or ubuntu 17.04 system.
Note: If you are using ubuntu you can skip directly to Install nvidia-detect step .

Add “contrib” and “non-free” repository – (You can skip this step if you are using ubuntu)

open sources.list file
nano /etc/apt/sources.list

append ‘contrib’ and ‘non-free’ to repo URL


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

Update apt cache


sudo apt-get update

Install nvidia-detect


sudo apt-get install nvidia-detect

now execute

 nvidia-detect 

nvidia-detect command is used to find the right nvidia driver for your gpu.


Detected NVIDIA GPUs:
00:0d.0 VGA compatible controller [0300]: NVIDIA Corporation C61 [GeForce 7025 / nForce 630a] [10de:03d6] (rev a2)

Checking card:  NVIDIA Corporation C61 [GeForce 7025 / nForce 630a] (rev a2)
Your card is only supported up to the 304 legacy drivers series.
It is recommended to install the
    nvidia-legacy-304xx-driver
package.

Here nvidia-legacy-304xx-driver is the right driver package for my gpu

Install the recommended driver and linux headers


sudo apt-get install linux-headers-$(uname -r) nvidia-legacy-304xx-driver 

Create an Xorg configuration for your gpu


mkdir /etc/X11/xorg.conf.d
nano /etc/X11/xorg.conf.d/20-nvidia.conf 

Now add below contents to the file


Section "Device"
Identifier "My GPU"
Driver "nvidia"
EndSection

Reboot to take effect new driver.

How to properly install Nvidia drivers on Debian 9 & Ubuntu 17.04

Leave a Reply

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

%d bloggers like this: