Dual Headed X11 setup with GeForece 8400 GS on Debian lenny/sid

Having a job at the university means that I have access to hardware that I can’t afford to buy for myself.  My coworker was getting a new video card for his workstation and they just ordered me one too.  The card is an Nvidia GeForce 8400 GS PCI Express card manufactured by Chaintech.

Downloading the Driver

I have zero experience with post AGP video cards or dual head setups, so I just went off of my corworkers recommendation that I use the non-free Nvidia driver.  I downloaded it from this page:

http://www.nvidia.com/object/linux_display_ia32_169.12.html

Installing the Driver

I ran the driver installer with the command:

sh NVIDIA-Linux-x86-169.12-pkg1.run

and it told me that it needed to be run as root and after X was shut down, so I had to switch to a console, kill X and su to root.

The installer told me that it couldn’t find any precompiled drivers for my kernel, so I would have to build them.

The installer also told me that the compiler that it found (gcc-4.2) was different than the one used to build my running kernel (gcc-4.1), so I had to set my CC environment variable to /usr/bin/gcc-4.1:

export CC=/usr/bin/gcc-4.1

It then told me that it couldn’t find the kernel source or kernel headers for my kernel (at the time 2.6.24-1).  To get the headers, I followed some of the directions for building out-of-tree kernel modules:

apt-get install linux-headers-2.6.24-2-686

Finally, I reran the driver installer, specifying the location of my kernel headers:

sh NVIDIA-Linux-x86-169.12-pkg1.run –kernel-source-path=/usr/src/linux-headers-2.6.24-1-686/

and the installation completed without a hitch.

Configuring X (for this card with dual heads)

This was the easy part because my coworker kicked me this config file:

# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by failsafeDexconf, using
# values from the debconf database and some overrides to use vesa mode.
#
# You should use dexconf or another such tool for creating a "real" xorg.conf
# For example:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "ServerFlags"
    Option "DefaultServerLayout" "layout0"
#    Option "Xinerama" "True"
EndSection

Section "InputDevice"
	Identifier	"keyboard0"
	Driver		"kbd"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"us"
EndSection

Section "InputDevice"
	Identifier	"mouse0"
	Driver		"mouse"
EndSection

Section "Device"
	Identifier	"nvidia0"
	Boardname	"GeForce 8400 GS"
	Busid		"PCI:1:0:0"
	Driver		"nvidia"
	Screen	0
#    Option "Monitor-" "monitor0"
#    Option		"NoLogo"	"True"
EndSection

Section "Monitor"
	Identifier	"monitor0"
	Vendorname	"Plug 'n' Play"
	Modelname	"Plug 'n' Play"
EndSection

Section "Screen"
	Identifier	"screen0"
	Device		"nvidia0"
	Monitor		"monitor0"
	Defaultdepth	24
	SubSection "Display"
		Depth	24
	EndSubSection
EndSection

Section "Device"
	Identifier	"nvidia1"
	Boardname	"GeForce 8400 GS"
	Busid		"PCI:1:0:0"
	Driver		"nvidia"
	Screen	1
#    Option "Monitor-" "monitor0"
EndSection

Section "Monitor"
	Identifier	"monitor1"
	Vendorname	"Plug 'n' Play"
	Modelname	"Plug 'n' Play"
EndSection

Section "Screen"
	Identifier	"screen1"
	Device		"nvidia1"
	Monitor		"monitor1"
	Defaultdepth	24
	SubSection "Display"
		Depth	24
	EndSubSection
EndSection

Section "ServerLayout"
	Identifier	"layout0"
    Screen 0 "screen0" 0 0
    Screen 1 "screen1" RightOf "screen0"
    Option "CoreKeyboard" "keyboard0"
    Option "CorePointer" "mouse0"
EndSection

Section "Module"
	Load		"glx"
	Load		"v4l"
EndSection

Section "DRI"
    Mode 0667
EndSection