Nvidia driver - Debian way, custom (or not) kernel.

Share your own howto's etc. Not for support questions!
Post Reply
Message
Author
User avatar
mzilikazi
Forum Ninja
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Nvidia driver - Debian way, custom (or not) kernel.

#1 Post by mzilikazi »

03.29.11 This howto is out of date. It may be updated in the near future. For now, feel free to browse the thread (lots of good info here stil) or read the Debian wiki:
http://wiki.debian.org/NvidiaGraphicsDrivers

05.26.10
* Updated for latest versions.
* Moved Changelog to end of this post.
* Reviewed/edited for consistency & clarity.
* For a time nvidia-kernel-source was broken in Debian, this patched version worked in the meanwhile:
195.36.24-0 0
500 http://frickelplatz.de sid/non-free Packages

I'd like to say thanks for that!

* Debian Nvidia is now back on track for Sid & Testing

BEFORE you get started:

If you need X windows until such time that you are able to get the Nvidia driver built simply use the vesa or nv driver in /etc/X11/xorg.conf.

If you used the Nvidia installation script to install you should first use the Nvidia method to uninstall that driver before continuing on. I can't say that it will or won't cause problems.
____________________________________________________________
Available Nvidia versions:

Code: Select all

$ date
Wed May 26 19:59:43 MDT 2010
$ apt-cache policy nvidia-kernel-source
nvidia-kernel-source:
  Installed: 195.36.24-2
  Candidate: 195.36.24-2
  Version table:
 *** 195.36.24-2 0
        500 http://mirrors.xmission.com sid/non-free Packages
        100 /var/lib/dpkg/status
     195.36.24-1 0
        500 http://mirrors.xmission.com testing/non-free Packages
     195.36.24-0 0
        500 http://frickelplatz.de sid/non-free Packages
     173.14.09-5 0
        500 http://mirrors.xmission.com stable/non-free Packages
Standard method

PART 1
Add contrib and non-free to /etc/apt/sources.list.d/sources.list (or whatever .list you use).

Code: Select all

deb ftp://ftp.us.debian.org/debian/ sid main contrib non-free
deb ftp://ftp.us.debian.org/debian/ testing main contrib non-free
deb ftp://ftp.us.debian.org/debian/ stable main contrib non-free
You need some specific tools to build this:

Code: Select all

apt-get update && apt-get install nvidia-kernel-source module-assistant nvidia-settings nvidia-xconfig
Build the driver:

Code: Select all

m-a prepare && m-a a-i nvidia
apt-get install nvidia-glx
Optionally add -t switch for text mode

Code: Select all

m-a prepare && m-a a-i -t nvidia
I'd switch to a VT at this point and stop your DM

Code: Select all

CTRL+ALT+F1
/etc/init.d/gdm stop
If you're already using an nvidia driver you need to remove it first.
If you try to modprobe the new nvidia driver without first removing your existing nvidia driver it won't work.

Code: Select all

rmmod nvidia
modprobe nvidia

Which driver is currently in use?

Code: Select all

modinfo nvidia
PART 2
Obviously if you're already using the nvidia driver there is probably no need to edit xorg.conf. Just restart your login manager. If you have not yet set up xorg.conf to use the nvidia driver, create or modify your current file. An example from my laptop:

Code: Select all

Section "Device"
        Identifier      "Device 0"
        Driver          "nvidia"
        BoardName       "nVidia Corporation GeForce 7150M"
        BusID           "PCI:0:18:0"
EndSection

Change your driver to nvidia in /etc/X11/xorg.conf or /etc/X11/XF86Config-4

Code: Select all

nano /etc/X11/xorg.conf
CTRL+O to save
<enter>
CTRL+X to exit
Now just restart your DM.

Code: Select all

/etc/init.d/gdm restart
OR if you use KDM

Code: Select all

/etc/init.d/kdm restart
After you've gotten the driver to build and Xwindows working you can do a quick test for Direct Rendering (requires mesa-utils):

Code: Select all

glxinfo|grep rendering
Also of interest is nvidia-settings.

Code: Select all

nvidia-settings --glxinfo
Build the Nvidia driver for your new kernel before booting into it. It certainly is nice to just reboot and have Nvidia ready to go!

Code: Select all

m-a a-i -t -k /usr/src/linux-headers-$<kernel-name-here> -l $<kernel-name-here> nvidia
Example:

Code: Select all

m-a a-i -t -k linux-headers-2.6.31-1.dmz.2-liquorix-686 -l 2.6.31-1.dmz.2 nvidia
*TIPS* If you want to run nvidia-settings on log in (and not see the GUI) simply add nvidia-settings -l to your login script (whatever that may be for your desktop).

If you need help generating a working xorg.conf switch to a VT CTRL+ALT+F1, log in as root and issue:

Code: Select all

nvidia-xconfig
At one time it was necessary to probe the driver.

Code: Select all

grep -q ^nvidia /etc/modules || echo nvidia >> /etc/modules
EXPERIMENTAL REPO METHOD
This is for experienced users or at least those who do not mind fixing what they break. ;) Sometimes the latest Nvidia is in experimental a while before reaching Unstable. If you need the experimental version read on...

Add an experimental repo to /etc/apt/sources.list

Code: Select all

deb http://ftp.de.debian.org/debian experimental main contrib non-free
deb-src http://ftp.de.debian.org/debian experimental main contrib non-free
Get updated, install the necesary packages

Code: Select all

apt-get update && apt-get install nvidia-kernel-source/experimental module-assistant nvidia-settings
Build the driver:

Code: Select all

m-a prepare && m-a a-i nvidia
apt-get install nvidia-glx/experimental
I'd switch to a VT at this point and stop your DM

Code: Select all

CTRL+ALT+F1
/etc/init.d/gdm stop
OR if you use KDM

Code: Select all

/etc/init.d/kdm stop
If you're already using an nvidia driver you need to remove it first.
If you try to modprobe the new nvidia driver without first removing your existing nvidia driver it won't work.

Code: Select all

rmmod nvidia
modprobe nvidia
Changelog:
2.19.07
Tidied up a bit.
Changed the subject line to be a bit more accuarate.
4.13.07
Tidied up some more.
Updated.
4.23.07
Updated.
7.6.07
Updated for latest Nvidia driver
Changed subject line again. Sorry.....
8.5.07
Checked for accuracy.
Added nvidia-xconfig.
10.7.07
Updated for latest Nvidia driver - added more detailed Howto for building driver before booting into new kernel.
09.14.08
Realtime kernel & nvidia?
See here.
12.08.08
Added contrib non-free sources.list entries
Added example xorg.conf Device section
Updated
01.12.09
Updated for latest Nvidia versions.
03.02.09
Updated for latest Nvidia versions.
09.03.09
Updated for latest Nvidia versions.
09.30.09
Updated for latest Nvidia versions.
Last edited by mzilikazi on 2010-05-27 02:50, edited 22 times in total.

AJxn
Posts: 56
Joined: 2006-07-30 17:21
Location: Gävle, Sweden

#2 Post by AJxn »

Didn't you forget to make experimental lower priority than stabel testing and sid (and Sarge, Etch)?
Or else wouldnt all experimental packages get into your system next apt-get update && apt-get upgrade ?

I think you need to lock version to others, and only allow nvidia to be installed from experimental.

graybeard
Posts: 48
Joined: 2005-08-08 05:58
Location: Houston, Texas

#3 Post by graybeard »

AJxn, I'm thinking of upgrading my nVidia card. At the present I'm using Nvidia's driver. I understand mzilikazi's instructions. But your's leave me a little bewildered. Could you please give us a little more on how to "...lock version to others, and only allow nvidia to be installed from experimental."

At this time I've got two PC. One has Sid and my main machine has Etch. Both with the official Nvidia drivers. Don't want to screw them up.

Thanks.

User avatar
rickh
Posts: 3473
Joined: 2006-06-29 02:13
Location: Albuquerque, NM USA

#4 Post by rickh »

You don't need to worry about things getting inadvertently updated from experimental. Apt won't update from there unless you specifically tell it to. Also, unless you have a very specific need, I wouldn't update from there anyway. The original post describes the update from sid or testing. That should be all you need.
Debian-Lenny/Sid 32/64
Desktop: Generic Core 2 Duo, EVGA 680i, Nvidia
Laptop: Generic Intel SIS/AC97

graybeard
Posts: 48
Joined: 2005-08-08 05:58
Location: Houston, Texas

#5 Post by graybeard »

I reread mzilikazi's post. I see where one could install the 'standard' Debian nvidia driver or, as mzilikazi writes, go for the bleeding edge. I don't need to go there. So there is no need for me to add an experimental repo to my source list. Correct?

So his instructions contain two ways: One for the excepted standard driver and the other for the experimental driver. Yes?

Thanks.

User avatar
mzilikazi
Forum Ninja
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

#6 Post by mzilikazi »

graybeard wrote:
So his instructions contain two ways: One for the excepted standard driver and the other for the experimental driver. Yes?

Thanks.
Yup 2 ways, different driver versions, same end result. :)

aketus
Posts: 53
Joined: 2006-10-29 07:47
Location: Australia

#7 Post by aketus »

All sounds very complicated. I just download the Nvidia driver from Nvidia website, download kernel header, switch to runlevel 3 and run the script as root.

Works every time. Even updates the xorg.conf automatically to suit.

I wrote a Howto for installing Nvidia drivers on Blag but the procedure is universal.

Edit: Oops I see the most complex instructions were for Experimental. My mistake.

User avatar
mzilikazi
Forum Ninja
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

#8 Post by mzilikazi »

aketus wrote:All sounds very complicated. I just download the Nvidia driver from Nvidia website, download kernel header, switch to runlevel 3 and run the script as root.

Works every time. Even updates the xorg.conf automatically to suit.

I wrote a Howto for installing Nvidia drivers on Blag but the procedure is universal.

Edit: Oops I see the most complex instructions were for Experimental. My mistake.
Sure you can run the installer from Nvidia - but as the topic mentions this is a howto for the Debian way not the Nvidia way. I also run a script - 1 command and Nvidia works. Some advantages this method gives is the ability to boot multiple kernels with each kernel having its own nvidia kernel module. That is not possible using Nvidias script. Also you have just another .deb on your system that you can remove anytime you like.

Code: Select all

$ dpkg -l|grep 2.6.19-rt1
ii  linux-headers-2.6.19-rt1-k8           mz1  Header files related to Linux kernel, specif
ii  linux-image-2.6.19-rt1-k8             mz1  Linux kernel binary image for version 2.6.19
ii  linux-source-2.6.19-rt1-k8            mz1   Linux kernel source for version 2.6.19-rt1-k
ii  nvidia-kernel-2.6.19-rt1-k8           1.0.9631-1+mz1     NVIDIA binary kernel module for Linux 2.6.19

DanielW
Posts: 1
Joined: 2007-02-17 01:00

#9 Post by DanielW »

I have a Geforce 8800 card and got the problem, that X was unable to load the lib libwfb.ko. I found the lib in /usr/lib/xorg/modules with the name libnvidia-wfb.so.1.0.9746.

The solution is to make a symlink like that:

cd /usr/lib/xorg/modules
ln -s libnvidia-wfb.so.1.0.9746 /usr/lib/xorg/modules/libwfb.so

I found this solution here:
http://www.nvnews.net/vbulletin/showthread.php?t=83214

User avatar
Jackiebrown
Posts: 1276
Joined: 2007-01-02 04:46
Location: San Antonio, TX

#10 Post by Jackiebrown »

mzilikazi wrote: Some advantages this method gives is the ability to boot multiple kernels with each kernel having its own nvidia kernel module. That is not possible using Nvidias script.
This is the main advatage for me. Very useful if you roll out your own kernels or track sid.

AJxn
Posts: 56
Joined: 2006-07-30 17:21
Location: Gävle, Sweden

#11 Post by AJxn »

On Debian Wiki there is good instructions how to use nVidia binary 3D driver in Debian. Some pro. and cons. are also explained there for different ways of installing the driver.

http://wiki.debian.org/NvidiaGraphicsDrivers

BartlebyScrivener
Posts: 1
Joined: 2007-03-02 08:31
Location: Omaha

#12 Post by BartlebyScrivener »

This one saved me and has worked flawlessly ever since. After using Etch for about three months and taking all of the updates as they came along, I rebooted one day and the display manager would not start. All I got was:
"FATAL Module Nvidia Not found."

I used the Standard method above and it worked.

rd
rd

"Operator! Give me the number for 911!

dinesh
Posts: 74
Joined: 2007-02-18 17:30
Location: India

#13 Post by dinesh »

anyone cud tell me wats the difference between installing this nvidia driver using the above said method and the nvidia installer from nvdia.com. which one is better. i m newbie to linux so plz help.

Xylock
Posts: 43
Joined: 2007-04-11 13:28

#14 Post by Xylock »

1 is installing the official 'debianized way' - handy if you use multiple kernels.

The other is the 'nvidia way' - only supports 1 kernel.

Unless your planning on having lots of concurrent kernel versions available.. I'd say stick with the nvidia one. I'd say its easier.. but you'll still need to use aptitude to grab yourself the linux-headers for your current kernel... unless of course you've already dived into a custom kernel, in which case you've prolly still got em lying around.
Using rm -rvf * to remove old backups... lazy.
Realising you were in / as root ... priceless.

chealer
Posts: 671
Joined: 2005-09-24 16:11
Location: Kebekia, Kanada
Contact:

#15 Post by chealer »

dinesh wrote:anyone cud tell me wats the difference between installing this nvidia driver using the above said method and the nvidia installer from nvdia.com. which one is better.
See http://wiki.debian.org/NvidiaGraphicsDr ... 0a5e6fecd5
The Debian way is usually better.

tmafcerqueira
Posts: 37
Joined: 2007-03-23 22:45

#16 Post by tmafcerqueira »

Will this driver allow me to use beryl + aiglx on my desktop?

User avatar
mzilikazi
Forum Ninja
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

#17 Post by mzilikazi »

tmafcerqueira wrote:Will this driver allow me to use beryl + aiglx on my desktop?
Assuming you have a supported Nvidia card then yes Beryl will work.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G

morax
Posts: 25
Joined: 2007-03-22 19:07
Location: Oppdal, NO

#18 Post by morax »

Thanks for this. :)

jongi
Posts: 477
Joined: 2007-04-15 02:41

#19 Post by jongi »

Here is what I did on KDE system to install the latest nVidia driver

1. Download the driver

Code: Select all

# cd /home/user
# wget http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9755/NVIDIA-Linux-x86-1.0-9755-pkg1.run
Obviously the name will change as per driver.

2. Enter a non x-server terminal and run the package

Code: Select all

Ctrl-Alt-F1
# su -
<Enter password>
# cd /home/user
# /etc/init.d/kdm stop
# sh NVIDIA-Linux-x86-1.0-9755-pkg1.run
<Follow instructions>
# /etc/init.d/kdm start
Last edited by jongi on 2007-05-10 23:00, edited 1 time in total.

User avatar
mzilikazi
Forum Ninja
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

#20 Post by mzilikazi »

jongi wrote:For those of us running KDE, to install the nVidia driver from the site change

Code: Select all

/etc/init.d/gdm stop
to

Code: Select all

/etc/init.d/kdm stop
And after running the nVidia package, then

Code: Select all

/etc/init.d/kdm start
KDM is mentioned in the original post BTW. :)
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G

Post Reply