View Single Post
Old 11-04-2008, 02:24 AM   #6 (permalink) Top
Anti-Trend
Nonconformist Geek
 
Anti-Trend's Avatar
 
Join Date: Oct 2003
Age: 27 Male
Posts: 4,879
Times Helpful: 535
Status: Offline

My Computer

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:
  1. Download the appropriate drivers from NVidia's website.
  2. 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
  3. chmod the script so that it can be executed:
    Code:
    chmod 755 /usr/local/sbin/nvinst.sh
  4. 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
  5. Also change the display manager variable, if necessary.
  6. 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.
  7. Execute the script: sudo nvinst.sh
And of course, feel free to post here with problems or improvements.

Send a message via ICQ to Anti-Trend Send a message via AIM to Anti-Trend   Reply With Quote
The Following User Says Thank You to Anti-Trend For This Useful Post: Show me >>