Status: Site Admin
Joined: 26 Sep 2003
Posts: 3388
Location: East Coast, West Coast? I know it's one of them.
Back to top
Posted: Aug 10, 07, 18:22    Debian nVidia / ATI graphics driver installer script sgfxi
(Page last updated 2010-10-20)
sgfxi Debian, Ubuntu - nVidia, fglrx + xorg driver installer/configuration
This script is designed for Debian sid, testing, and stable, as well as derived distros like Mepis, Antix, Aptosid, LMDE. Also supports Ubuntu, Mint, and is working on Fedora. Arch support more or less works.

NEW: Improved nouveau handling, blacklisting, unblacklisting.
sgfxi (or sgfxi -c if you want composite enabled - NOTE: composite is now enabled by default for nvidia cards, turn OFF with -q, -c not required for nVidia that is): nvidia non free direct download from, selects proper driver for your card, extracts, installs, cleans up, removes all previous drivers.
Ubuntu:sgfxi -D fglrx direct download from, builds distro packages for Ubuntu. Tested and seems to work.
Ubuntu: sgfxi -d install distro supplied drivers, configure xorg.conf, remove any previous drivers. Works in theory for fglrx but not confirmed, works for nvidia, confirmed. (formerly -s)
Arch: sgfxi : for fglrx binary direct install. Assumed to be working until we hear otherwise.
Fedora: sgfxi or sgfxi -d: nvidia direct sgfxi install, sgfxi -d distro driver install. May require a reboot depending, sgfxi will tell you this, also applies required nouveau blacklist stuff.

Free xorg driver reinstall, remove non free binaries.
sgfxi -n (native driver install nv/ati, removes all binary non free parts)
sgfxi -N <ati|radeon|radeonhd|nv|nouveau|vesa> (like: sgfxi -N vesa) (upgrades xorg.conf to use specified free xorg driver, removes all binary.

Not Working:
Ubuntu: sgfxi - For fglrx, results vary. Use -D if you want the latest fglrx driver, direct download/install does not work so far in my tests.
Arch: sgfxi -D / sgfxi -d - not yet, don't know if it's feasible.
Fedora: fglrx has not been implemented yet, and is untested, it might work for the binary direct install, don't know.

  • sgfxi, direct binary fglrx install is now script default. -D is now optional way to try the constantly failing fglrx run package distro package builder/installer method. This is because the distro packages are consistently over the years not working or unreliable or out of date.
  • -L [d|f|n] option. Shows current, live, from sgfxi server, driver/fglrx/nvidia status information. Can be run in X, not as root.
  • Automatic beta driver install (nVidia only). -B automatically tests for latest beta driver support for your card type, if available, uses it, if not, uses correct stable driver version.
  • Support for new vanilla/default Debian Xen enabled kernels (kernels > 2.6.25 now in Debian sid/testing) + driver installer run packages from ATI/Nvidia (patch source).
  • Install onto new kernel from old kernel, using -K option, like this:
    :: Code ::
    sgfxi -K 2.6.25-2

    This would install to kernel 2.6.25-2 no matter what kernel you're in now. No longer supported for default fglrx install, does work for distro-driver method (sgfxi -d - formerly -s) and fglrx -D method (which is not reliable in general)
  • Much improved patch handling, now downloads and runs patches as required for nvidia/fglrx (when fglrx actually works, of course).

script information and resources:
  • script documentation. Useful items:

  • script svn - Home to sgfxi code. This is always the current code. Includes most script development tools, patches, and all script files.
  • #smxi on - irc smxi / sgfxi / svmi support for all Debian based distro users trying out smxi or other scripts - bughunters with output welcomed. If someone is in the channel, ask a question, then check back later, it might take some time to get an answer. To check available factoids from the Amy bot, type in: !categories in your irc client.

Script functions
This script downloads the binary graphic driver installers from either nvidia or ATI, prepares system, installs, then sets up xorg.conf, all in a fairly clean, reasonably intuitive way.

sgfxi allows you to easily switch between proprietary non free drivers like ATI's fglrx and nVidia's nvidia driver and the free xorg drivers. Simply use the -n option to do any automatic install for nvidia, ati, intel, and 3dfx, or -N <xorg driver name> for others.

Debian packaged nvidia or ati drivers tend to be fairly unreliable for cutting edge kernels and systems, but the script makes it easy to install either the run installer from nVidia/ATI, or using Debian methods.

If you want to switch between the distro nvidia/fglrx drivers and the straight installs from ATI/Nvidia, you can easily do that by using: sgfxi -d
-d forces distro packaged driver method instead of downloaded binaries. You can switch back and forth easily, in case one works and another doesn't.

Script requirements
  • Must be run as root/su (except to view help -h menu)
  • Script does not run in x, must be in console, and it will shut down detected instances of kde/gnome etc
  • Please run script from /usr/local/bin to avoid errors in the future. That's where it expects to be
  • Debian sid / testing / stable based systems only officially supported.
  • Must have a working internet connection to update itself and download drivers if required.

Script download / install
Download the sgfxi script here or just run the following command string as root user in terminal/console [recommended]:

:: Code ::
cd /usr/local/bin;wget -Nc;chmod +x sgfxi;sgfxi
# for help, or lists of available drivers etc, do:
sgfxi -h

Script features the following:

  • sgfxi -h shows available drivers, options, and if your system is supported.
  • Script updates itself automatically every time to latest version
  • Full logging of install located /var/log/sgfxi/<time stamped log of install>
  • sgfxi will also detect multiple video cards and ask which you want to install a driver for.
  • Pre setup configuration
  • Script detects card type and determines which driver and driver version to install, for example, for legacy nvidia cards, it will automatically select the proper legacy nvidia driver.
  • Download/extraction of binary installers from either ATI or nVidia. Note: script will download to this location: /usr/src and will then reuse the driver if you need to reinstall it due to xorg or kernel updates.
  • System cleanup, removes all previously installed graphics drivers
  • Installs drivers - or creates distro packages for driver install (ATI sgfxi -D method only)
  • Configures and installs driver distro packages (sgfxi -D for ATI only)
  • Creates a time stamped backup of xorg.conf, like so: xorg.conf-bu-20070812....
  • Reconfigures xorg.conf, cleans up all legacy cruft that it can find, then redoes it to work as expected
  • Script also features option to simply install xorg drivers such as intel, nv, ati, radeon, etc.

Script options
Here are some examples of typical installs and useage:
:: Code ::
# for normal nvidia install, with composite enabled
# for normal nvidia install, with composite disabled
sgfxi -q
# for normal fglrx install (direct binary install, no distro packages)
# for normal fglrx install, with composite enabled
sgfxi  -c
# fglrx binary run package install: distro packages created/installed
sgfxi -D
# for installing normal ati xorg driver
sgfxi -n
# for installing special xorg radeon driver
sgfxi -N radeon
# for installing an older nvidia driver, with composite
sgfxi -o 100.14.19

The following is what the -h help menu gives as options and system information, as an example.

Latest nvidia stable/beta drivers are usually added the day of release, unless there are problems. Generally only current fglrx version, sometimes also one prior, is supported due to consistent problems with fglrx drivers and cutting edge distros:

:: Code ::
sgfxi -h
While you can run this script in X, we recommend you run it in terminal.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Script Requirements: Only true Debian based systems. No *buntus.
Xorg version required: 7.1/1.1 or greater - Your X version: 1.6
Linux Kernel required: 2.6.18 or greater - Your kernel: 2.6.30-5.dmz.4-liquorix-686
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
'default:' - This is the driver installed automatically unless it is not supported by
your card. Some older cards will force an override of this basic default. Script will
print out what driver it will install when you start it up, with option to exit.

'supported-drivers:' choices require -o <see -o for correct syntax> to install.
fglrx: default: 9-8 supported-drivers: 9-8 9-3 8-12 9-7 9-6 9-5 9-4 9.2 9-1 8-11 8-10 8-9 8-8 8-7 8-6 8-5 8-4
nvidia: default: 185.18.36      supported-drivers: 185.18.36 173.14.20 96.43.13 71.86.11 185.18.31 185.18.29 185.18.14 180.60 180.51 180.44 177.82 173.14.18 173.14.12 169.12 100.14.19 96.43.11 71.86.09 71.86.06
The following drivers are available for testing purposes:
nvidia: 190.25 190.18 185.19 180.53 96.43.10
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
These are your supported options:
-A Run the install non-interactively. Will not restart x at end.
-b Enable tripleBuffer (nvidia only). triplebuffer can reduce 3d performance on cards
   with low graphics memory (64 mB or less). Default is disabled/off.
-B Use latest Beta Driver for your card type. Autodetects card type/beta driver (nVidia cards only).
   If no beta driver is available, the current stable driver for your card type is used.
-c Use composite mode. For things like Beryl/Compiz (newer ATI/Intel/nVidia cards only).
    Not needed for nVidia, which defaults to composite ON
-C Skip Xorg configuration. Only use this if your Xorg is already working with your driver.
   Main use is if you have dual card output and don't want xorg.conf changed.
-D Build distro package files for fglrx with FGLRX binary run package, then install them (ATI Only). (formerly -F)
   Because of constant distro package builder failures, the direct install method is recommended and default for sgfxi.
-h View this help menu.
-j Alternate text/output script colors. Requires this syntax: -j 0 (sets to monochrome )
   -j 1 (script default); -j 2 (alternate color scheme); -j 3 (nice earthy scheme)
-K Installs nVidia/fglrx driver for another kernel. Syntax: sgfxi -K 2.6.25-2
   sgfxi will double check that the kernel exists.
-L List current live driver or status data then exit. Requires extra argument: d to show current drivers;
   n to show current nvidia support status; f to show current fglrx support status.
-n Automatically installs correct native xorg nv, intel, or ati driver for your system.
   Cleans up old binary driver stuff, updates xorg.conf with new driver information,
   and cleans nvidia and fgrlx stuff out of xorg.conf
-N Force install of specific xorg driver. Syntax: sgfxi -N <one of the drivers from the list, like -N radeon>
   Supported Xorg drivers: apm ark ati chips cirrus cyrix fbdev glint i128 i740 intel i810 imstt mach64 mga neomagic nsc nv openchrome radeon radeonhd rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng vesa vga openchrome via voodoo vmware v4l
   Also configures xorg.conf as required. Full radeon xorg 3d configuration automatically.
-o Override default: install a specific driver, this is an absolute override - syntax:
   -o 177.68 (for nVidia) or: -o 8-6 (for fglrx)
-q Turn off composite.
-Q Skip start X Question, automatically start X post driver install.
-r Remove mode lines from xorg.conf
-R Skips self updating feature. No restart.
-d Installs Debian nVidia/fglrx drivers. ATI/nVidia cards only. (formerly -s)
-U Forces sgfxi to update itself, must be root, but can be in x. Exits after.
-v Prints sgfxi current version information. Exits after.
-W Skip all wget downloads. Only use this to reinstall a driver
   that has already been downloaded using sgfxi at least once previously.
-x Reverts to default for system instead of nVidia package (nVidia only)
-X Use to skip auto X start/stop. Do not use this unless you have a good reason to not
   want X start/stop tests to run. Gives start X option on completion if not in X.

This script is actively maintained, and usually includes support for the latest drivers when they come out, except sometimes for ATI, when their drivers totally break, which seems to be about as often as they work, sadly.

The free ATI radeon/radeonhd drivers are improving quickly, but the fglrx stuff is still a constant problem, they are having trouble keeping up with both xorg and kernel development release to release.

The script should work fine with Debian sid/unstable and testing, and probably with Etch. Some support can be found on irc, #smxi channel. Or just use these smxi forums to get the latest news and updates.
Display posts from previous:   

All times are GMT - 8 Hours