Howto: Install NVidia drivers In Debian or Ubuntu

[SIZE=“5”][CENTER]Howto Install NVidia drivers In Debian or Ubuntu
-aka-
Getting 3D in Debian or Ubuntu with NVidia[/CENTER]
[/SIZE]

Installing the proprietary NVidia drivers in Debian (or Ubuntu, a Debian spin-off) is surprisingly easy. Not as easy as they’d be if they were open-source, but I digress… :wink:

[CENTER][COLOR=“DarkRed”]
[SIZE=“5”]STOP! This thread is outdated and is here for historical purposes only. Please read the bottom of this post under the heading “EDIT”.[/SIZE][/CENTER]


[SIZE=“4”]Requirements:[/SIZE]

[ul]
[li]Your kernel headers must matched your installed kernel. If you roll your own kernels, this is already handled. Otherwise, use the command: uname -a…to identify your running kernel, and use your package manager to install the corresponding kernel header package.[/li][li]Make sure the build-essential meta package is installed, which allows the drivers to compile in the first place.[/li]apt-get install build-essential
[li]If you do build your own kernels, leave out the Riva FB drivers, and do build the appropriate AGPart module if you have an AGP architecture.[/li][/ul]

[SIZE=“4”]Steps to install:[/SIZE]
[ol]
[li]Download NVidia’s Linux drivers and save them someplace where you’ll remember them later.[/li][li]Save anything you’re working on and log out of your desktop session.[/li][li]Go to a virtual terminal (ALT+CTRL+F1)[/li][li]Login as root [SIZE=“1”][COLOR=“Gray”]Note: In Ubuntu, you are already root… sort of. Yes, I know, this is dumb. To get full root in Ubuntu, run the following command: sudo su -[/SIZE][/li][li]Terminate your graphical user environment. There are a few ways to do this; the easiest is to /etc/init.d/kdm stop if you’re using the KDE display manager, /etc/init.d/gdm stop if you’re running the Gnome display manager, or if you’re using the X display manager:/etc/init.d/xdm stop[/li][li]Navigate to the directory where you downloaded your drivers earlier.[SIZE=“1”][COLOR=“Gray”] Note: If you don’t know how to do this part, you need to first go over the absolute basics: Absolute basics …you can always post here if you need help with something specific, but please at least read that first if you’re having trouble navigating in a non-graphical environment.[/SIZE][/li][li]Install the NVidia drivers with the following command: sh NVIDIA-Linux-x86-1.0-9629-pkg1.run --x-module-path=/usr/lib/xorg/modules/ -aqNX…where “NVIDIA-Linux-x86-1.0-9629-pkg1.run” should be the actual name of the NVidia driver you’re trying to install. [SIZE=“1”][COLOR=“Gray”]Tip: You can start typing the name of the file, then hit the TAB key and your system will automatically complete the filename for you. That makes it a lot easier to type long filenames without making typos.[/SIZE][/li][li]Once you’ve got the new drivers installed, just start your display manager back up and logout of your virtual terminal. Here are the commands to do so with KDM, GDM and XDM respectively:[/li]/etc/init.d/kdm start && exit

/etc/init.d/gdm start && exit
/etc/init.d/xdm start && exit

[li]To test your new 3D Drivers, log back in to a desktop session and run the following command in a terminal: glxinfo | grep render[COLOR=“Gray”][SIZE=“1”]Note: the “|” is a pipe symbol, not an “i” or an “L”. [/SIZE] You should see something similar to the following: direct rendering: [B]Yes[/B][/li]OpenGL renderer string: GeForce 6800 GT/AGP/SSE/3DNOW! GL_NVX_conditional_render, GL_SGIS_generate_mipmap, GL_SGIS_texture_lod,
…If “Direct Rendering” reads as “yes”, congratulations! If not, feel free to post here, and we’ll see what we can do to help you out.
[/ol]

[COLOR=“DarkRed”][SIZE=“7”]EDIT[/SIZE]

OK, this thread is completely obsolete! For Debian users, I recommend avoiding my silly little script and instead using the excellent sgfxi, which will automatically download and install the ideal graphics drivers for your NVidia or ATI video card. To install it, simply do the following as root:

cd /usr/local/bin;wget -Nc smxi.org/sgfxi;chmod +x sgfxi

To execute the script, simply drop to a VT and run the command ‘sgfxi’ as root.

Or if you prefer to be able to install the drivers with a normal user account, you could do something like this:

:~# visudo[/code] ...and add a line like this:[code]%video ALL=/usr/local/bin/sgfxi[/code]Then you'd be able to install the drivers by dropping to a VT, then running [code]sudo sgfxi

[SIZE=“1”]NOTE: This script is for real Debian distros only, not for Ubuntu. If Ubuntu users don’t like their distro’s way of packaging drivers, I’ve heard good things about the Envy script.[/SIZE]

Howto: Install NVidia drivers in Linux In Debian or Ubuntu

Nice How to Guide there… [ot]…now we need someone to do a How to for the ATi Drivers :p[/ot]

Howto: Install NVidia drivers in Linux In Debian or Ubuntu

[ot]how to install… ATI Graphics Drivers!

Ubuntu:Edgy - ATI Graphics Drivers[/ot]

Hi AT

Followed the instructions, thenks! However, I have a query -
When I tried the command “glxinfo | grep render”, debian complains that glxinfo is an unknown command.

When I check the KInfoCenter I can see under OpenGL - see attached image

I am using the HWF P4 kernel…

Is everything alright here?

glxinfo is part of the mesa-utils package. Just install that and you’ll have the command you’re looking for.

Ubuntu has added some scripts to the mix which make building drivers the NVidia way a real pain in the ass. To help counter this, I’ve written a primitive BASH script which Ubuntu users may find useful:

[code]
#!/bin/sh

#######################################

Easy NVidia Builder Script

Licensed under the GPLv3

(or later at your option):

The GNU General Public License v3.0 - GNU Project - Free Software Foundation

#######################################

#############################

Default Display Manager

#############################

Change to kdm, gdm or xdm as necessary:

DMNG=gdm

#############################

NVidia Driver Location

#############################

What’s the absolute path to the drivers?

NVDRIVER=/usr/local/src/nvidia/NVIDIA-current.run

#############################

Path to X Modules

#############################

Shouldn’t have to change this in Ubuntu:

XMODPATH=/usr/lib/xorg/modules

Kill Ubuntu’s annoying script that keeps respawning the display manager:

killall gdmopen

Now stop the display manager we’ve defined earlier:

/etc/init.d/$DMNG stop

If there are still any X.org processes hanging around, kill them too:

killall Xorg

Zombie Clause - Wait 6 seconds and make absolutely sure they stay dead:

sleep 6
killall $DMNG
killall gdmopen
killall Xorg

They’ve had their fair chance. After 3 seconds, we bring out the big guns:

sleep 3
killall -9 $DMNG
killall -9 gdmopen
killall -9 Xorg

Now we build the NVidia driver:

sh $NVDRIVER --x-module-path=$XMODPATH -aqNX --no-runlevel-check

Restart the display manager:

/etc/init.d/$DMNG start[/code]

How to use this script:
[ol]
[li]Download the appropriate drivers from NVidia’s website.[/li][li]Put this BASH script someplace in your path where it can executed. For instance, /usr/local/sbin/ would be a perfect location:[/li]cd /usr/local/sbin && wget http://www.hardwareforums.com/repo/scripts/nvinst.sh
[li]chmod the script so that it can be executed: chmod 755 /usr/local/sbin/nvinst.sh[/li][li]Using your favorite text editor, edit the NVDRIVER section of the script to account for the exact path to your downloaded drivers. For example:[code]#############################[/li]## NVidia Driver Location ##
#############################

What’s the absolute path to the drivers?

NVDRIVER=/usr/local/src/nvidia/NVIDIA-Linux-x86-169.12-pkg1.run[/code]
[li]Also change the display manager variable, if necessary.[/li][li]Logout of any X sessions (KDE, Gnome, etc) and either drop to a virtual terminal (Ctrl+Alt+F1-F6) or to runlevel 1, whichever is more convenient for you.[/li][li]Execute the script: sudo nvinst.sh[/li][/ol]
And of course, feel free to post here with problems or improvements.

[OT]

They’ve had their fair chance. After 3 seconds, we bring out the big guns:

sleep 3
killall -9 $DMNG
killall -9 gdmopen
killall -9 Xorg

KILL DASH NINE,
No more CPU time.
I run KILL DASH NINE,
And your process is mine.
I run KILL DASH NINE,
'Cause it’s MY time to shine
So don’t step outta line or else it’s
KILL DASH NINE!

Kill Dash Nine | Lyrics
[/OT]

Hey all

Just came against a big wall when trying to install the nVidia driver against the 2.6.25 Kernel In Debian (Lenny). Basically the short of it is that the latest from nVidia will not build against a XEN enabled Kernel #476504 - nvidia-kernel-source: Fails to build with Linux kernel 2.6.25 - Debian Bug report logs. If, like me you are using a stock kernel and have not a clue how to compile a kernel, disabling the option, your best bet is to try and use Debian’s latest, own nvidia-glx driver. It is unfortunate that the driver is only available from the Sid repo’s.

I suppose it is down to you whether you wish to dab in the unknown but this is how it worked for me:
Just to quickly explain that I am using the new kernel out of choice as it solves an issue I had. If you are using the new Kernel it is likely that you are experimenting anyway so on your head be it…

Add and enable the Sid repository (I include the lot - main contrib non-free). Then as root:

/etc/init.d/kdm stop (replace kdm with other if necessary)
apt-get update
apt-get install nvidia-kernel-source module-assistant (if it is not installed already) nvidia-settings nvidia-xconfig

You might get a warning that the packages suggest installing the nvidia-glx package. Options are Y/N/Q. I chose Y.

When all is done:

m-a prepare && m-a a-i nvidia
apt-get install nvidia-glx

When this is finished, to make sure the new module is loaded:

rmmod nvidia (not necessary if you were not using the module already)
modprobe nvidia

Now restart your desktop manager

/etc/init.d/kdm start
or reboot
reboot
.

Disclaimer - this is not a how-to but just an FYI which I felt would be a bit silly if I did not include the way I manged to install the driver.
I took the how to from here -
Debian User Forums :: View topic - Nvidia 100.14.19 - Debian way, custom (or not) kernel.
Note that I have omitted the

grep -q ^nvidia /etc/modules || echo nvidia >> /etc/modules

as it crashed the whole process for me… probably because it was not intended for me… :doh:

AAAAnyways I hope some of you will find this useful.

Yeah, to be honest one shouldn’t enable Xen in their kernels unless they actually plan to run hypervisors… and that would be weird on a desktop warranting 3D graphics anyway. :slight_smile: On typical desktops, Xen should be disabled.

OK, this thread is completely obsolete! For Debian users, I recommend avoiding my silly little script and instead using the excellent sgfxi, which will automatically download and install the ideal graphics drivers for your NVidia or ATI video card. To install it, simply do the following as root:

cd /usr/local/bin;wget -Nc smxi.org/sgfxi;chmod +x sgfxi

To execute the script, simply drop to a VT and run the command ‘sgfxi’ as root.

Or if you prefer to be able to install the drivers with a normal user account, you could do something like this:

:~# visudo[/code] ...and add a line like this:[code]%video ALL=/usr/local/bin/sgfxi[/code]Then you'd be able to install the drivers by dropping to a VT, then running [code]sudo sgfxi

[SIZE=“1”]NOTE: This script is for real Debian distros only, not for Ubuntu. If Ubuntu users don’t like their distro’s way of packaging drivers, I’ve heard mixed reviews about the Envy script.[/SIZE]

yep, you guessed it, using drivers installed (sgfxi) and grx are crap now, only 800 X 600 & 60Htz and what looks like 16 color, is there a way to activate higher settings

BTW: i’ve attached a screenshot & the browser window is green but when i make ksnapsshot the active window display returns to screenshot

BTW: making this post wasn’t easy

Have a look at your xorg.conf (/etc/X11/) file and try and add the additional resolutions and depths manually (not before backing the file up!!!) -
You should have the following lines already

[QUOTE=xorg.conf]

Subsection “Display”
Depth 16
Modes “800x600” “640x480”
EndSubsection

[/QUOTE]

Try to add another Subsection for 24 and 32 Depth -
[COLOR=“Blue”]Subsection “Display”
Depth 24
Modes [“any other possible resolutions”] “1024x768” “800x600” “640x480”
EndSubsection
Subsection “Display”
Depth 32
Modes [“any other possible resolutions”] “1024x768” “800x600” “640x480”
EndSubsection

Obviously you can only add resolutions which are supported by your screen…

Good luck…

well, exited X, downloaded and ran nvidia-xconfig & it auto rewrote xorg.conf, now all is good @ 1280x1024[ot]like you need telling about nv-conf[/ot]but i’m kinda proud of my little self cos i fixed it

BTW: your suggestion would also have worked :beer:

Edit: grandma, you suck eggs like this, shlurp shlurp shlurp

Yep, Saba’s got it exactly right. I’ve got a 16:10 screen that maxes out at 1680x1050. Here’s the screen section of my X.org if it helps you:

Section "Screen"
    Identifier     "Default Screen"
    Device         "nVidia Corporation GeForce 8800 GT"
    Monitor        "SyncMaster"
    DefaultDepth    24
    SubSection     "Display"
        Depth       8
        Modes      "1680x1050" "1440x900" "1280x1024" "1280x960" "1152x864" "1024x768" "832x624" "800x600" "720x400" "640x480"
    EndSubSection
    SubSection     "Display"
        Depth       15
        Modes      "1680x1050" "1440x900" "1280x1024" "1280x960" "1152x864" "1024x768" "832x624" "800x600" "720x400" "640x480"
    EndSubSection
    SubSection     "Display"
        Depth       16
        Modes      "1680x1050" "1440x900" "1280x1024" "1280x960" "1152x864" "1024x768" "832x624" "800x600" "720x400" "640x480"
    EndSubSection
    SubSection     "Display"
        Depth       24
        Modes      "1680x1050" "1440x900" "1280x1024" "1280x960" "1152x864" "1024x768" "832x624" "800x600" "720x400" "640x480"
    EndSubSection
EndSection

Very kind, but just so you know, I only managed to install the nVidia drivers on my desktop once (GeForce 6200)… and to be frank, I cannot remember how I did it… :doh:.
One of the more frustrating processes I encountered with Debian. :mad:
Saying that, I am normally very impatient, which could explain why I did not have much success… lack of trying! :chk:

cheers, my Vista box is 1440x900 (highest setting available:()

and well deserved, i still think of myself as someone who hasn’t got clue, but i’m realizing my potential slowly

your luckier than me, i couldn’t get my 6200 functioning correctly on *bubtu, AT will probably remember helping me, my 6200 did work with nv drivers, but froze every 5 - 10 mins[ot]was a tw4t[/ot]