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):
# http://www.gnu.org/copyleft/gpl.html
#######################################
#
#############################
## 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
How to use this script:
- Download the appropriate drivers from NVidia's website.
- Put this BASH script someplace in your path where it can executed. For instance, /usr/local/sbin/ would be a perfect location:
Code:
cd /usr/local/sbin && wget http://www.hardwareforums.com/repo/scripts/nvinst.sh
- chmod the script so that it can be executed:
Code:
chmod 755 /usr/local/sbin/nvinst.sh
- 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:
#############################
## NVidia Driver Location ##
#############################
## What's the absolute path to the drivers?
NVDRIVER=/usr/local/src/nvidia/NVIDIA-Linux-x86-169.12-pkg1.run
- Also change the display manager variable, if necessary.
- 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.
- Execute the script: sudo nvinst.sh
And of course, feel free to post here with problems or improvements.