Adding nVidia video drivers to Debian 8.0 (Jessie)

Getting the nVidia drivers to work on whatever the current version of Debian can sometimes be a bit of a chore, there were binary drivers available in ‘lenny’, you had to download them and compile them for ‘squeeze’, and ‘wheezy’ was slightly different again.

Fortunately with ‘jessie’ is it relatively painless as the drivers have been included in the repositories. There is still some compilation involved but it is all handled for you, all you need to do is update you package sources and install the required packages.

First edit the sources file.

# vi /etc/apt/sources.list

Check the following entries are present, adding them if needed.

deb http://http.debian.net/debian/ jessie main contrib non-free
#deb-src http://http.debian.net/debian/ jessie main contrib non-free

Then you need to install the right version of the linux headers and the nVidia kernel module source, the following command will work out which headers are needed and install both packages.

Note – This will install the 340.65 version of the nVidia driver which only supports GeForce 8000 series or later cards. Since I’m using an Nvidia GT640 this is the right version for my system.

# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')\
> nvidia-kernel-dkms
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  binutils cpp-4.8 dkms fakeroot gcc gcc-4.8 gcc-4.9 glx-alternative-mesa
  glx-alternative-nvidia glx-diversions libasan0 libasan1 libatomic1
  libc-dev-bin libc6-dev libcilkrts5 libegl1-nvidia libfakeroot
  libgcc-4.8-dev libgcc-4.9-dev libgl1-nvidia-glx libgles1-nvidia
  libgles2-nvidia libitm1 libjansson4 liblsan0 libnvidia-eglcore
  libnvidia-ml1 libtsan0 libubsan0 libvdpau1 libxnvctrl0
  linux-compiler-gcc-4.8-x86 linux-headers-3.16.0-4-amd64
  linux-headers-3.16.0-4-common linux-kbuild-3.16 linux-libc-dev make
  manpages-dev menu nvidia-alternative nvidia-driver nvidia-driver-bin
  nvidia-installer-cleanup nvidia-kernel-common nvidia-modprobe
  nvidia-settings nvidia-support nvidia-vdpau-driver patch pkg-config
  xserver-xorg-video-nvidia
Suggested packages:
  binutils-doc gcc-4.8-locales gcc-multilib autoconf automake libtool flex
  bison gdb gcc-doc gcc-4.8-multilib gcc-4.8-doc libgcc1-dbg libgomp1-dbg
  libitm1-dbg libatomic1-dbg libasan0-dbg libtsan0-dbg libquadmath0-dbg
  gcc-4.9-multilib gcc-4.9-doc gcc-4.9-locales libasan1-dbg liblsan0-dbg
  libubsan0-dbg libcilkrts5-dbg glibc-doc make-doc menu-l10n gksu
  kde-runtime ktsuss ed diffutils-doc
Recommended packages:
  linux-image libgl1-nvidia-glx-i386
The following NEW packages will be installed:
  binutils cpp-4.8 dkms fakeroot gcc gcc-4.8 gcc-4.9 glx-alternative-mesa
  glx-alternative-nvidia glx-diversions libasan0 libasan1 libatomic1
  libc-dev-bin libc6-dev libcilkrts5 libegl1-nvidia libfakeroot
  libgcc-4.8-dev libgcc-4.9-dev libgl1-nvidia-glx libgles1-nvidia
  libgles2-nvidia libitm1 libjansson4 liblsan0 libnvidia-eglcore
  libnvidia-ml1 libtsan0 libubsan0 libvdpau1 libxnvctrl0
  linux-compiler-gcc-4.8-x86 linux-headers-3.16.0-4-amd64
  linux-headers-3.16.0-4-common linux-headers-amd64 linux-kbuild-3.16
  linux-libc-dev make manpages-dev menu nvidia-alternative nvidia-driver
  nvidia-driver-bin nvidia-installer-cleanup nvidia-kernel-common
  nvidia-kernel-dkms nvidia-modprobe nvidia-settings nvidia-support
  nvidia-vdpau-driver patch pkg-config xserver-xorg-video-nvidia
0 upgraded, 54 newly installed, 0 to remove and 0 not upgraded.
Need to get 59.0 MB of archives.
After this operation, 271 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
  :
  :
  :
Setting up nvidia-kernel-dkms (340.65-2) ...
Loading new nvidia-current-340.65 DKMS files...
First Installation: checking all kernels...
Building only for 3.16.0-4-amd64
Building initial module for 3.16.0-4-amd64
Done.

nvidia-current:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.16-amd64/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.16=amd64/updates/dkms/

depmod....

DKMS: install completed.
Setting up nvidia-settings (340.46-2) ...
Setting up libegl1-nvidia:amd64 (340.65-2) ...
Setting up libgl1-nvidia-glx:amd64 (340.65-2) ...
Setting up xserver-xorg-video-nvidia (340.65-2) ...
Setting up nvidia-driver (340.65-2) ...
Conflicting nouveau kernel module loaded

The free nouveau kernel module is currently loaded and
conflicts with the non-free nvidia kernel module.

The easiest way to fix this is to reboot the machine once
the installation has finished. 


Manual configuration required to enable NVIDIA driver 

The NVIDIA driver is not yet configured; it needs to be enabled
in xorg.conf before it can be used.

Please see the package documentation for instructions.

Processing triggers for libc-bin (2.19-18) ...
Processing triggers for initramfs-tools (0.120) ...
update-initramfs: Generating /boot/initrd.img-3.16.0-4-amd64
Processing triggers for systemd (215-17) ...
Processing triggers for menu (2.1.47) ...

Then reboot for the changes to take effect.

# reboot

That should be all that is necessary, but for reference I've included my xorg.conf file below.

# /etc/X11/xorg.conf

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "HP LP2475w"
    HorizSync       30.0 - 94.0
    VertRefresh     48.0 - 85.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 640"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "CRT-0"
    Option         "metamodes" "VGA-0: 1920x1200_60_0 +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

# 

Advertisements
This entry was posted in Debian and tagged , . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s