Nvidia, TwinView, and xorg.conf

by Juliet Kemp

Getting dual-head monitors going with an nvidia card on Debian is largely a pleasingly straightforward business.

Edit your /etc/apt/sources.list to include the contrib and non-free repositories, and run apt-get update. Install the driver as follows:

apt-get install nvidia-kernel-common module-assistant
m-a -i prepare
m-a a-i -i -t -f nvidia-kernel
depmod -a
apt-get install nvidia-glx nvidia-glx-dev
Use lsmod to check that the nvidia module is loaded.

The final task is to edit your xserver config, which is the bit where I encountered a slight gotcha this time around; hence this post.

If both monitors can handle the same resolution, editing the Device section of your /etc/X11/XF86Config-4 (sarge) or /etc/X11/xorg.conf (etch) as follows should work:


Section "Device"
        Identifier      "NVIDIA Corporation NV44 [Quadro NVS 285]"
        Driver          "nvidia"
        BusID           "PCI:1:0:0"
        Option          "TwinView" "true"
        #Option         "ConnectedMonitor" "FPD,FPD"
        Option          "MetaModes" "1600x1200,1600x1200; 1280x1024,1280x1024"
        Option          "SecondMonitorHorizSync" "31-80"
        Option          "SecondMonitorVertRefresh" "56-76"
        Option          "TwinViewOrientation" "RightOf"
EndSection
Make sure you use appropriate sync and refresh values (these work for HP 1702 flat panel & a standard Transtec 19" flat panel), and that the BusID is correct (lspci output - look for the line corresponding to your card. 01:00.0 translates to PCI:1:0:0 as above; 05:09.0 or 0000:05:09.0 to PCI:5:9:0, etc).

However, if your monitors don't support the same resolution, you'll need to change this line:


        Option          "MetaModes" "1024x768,1280x1024"
(you may also need to try swapping the two entries around - e.g. 1280x1024,1024x768 - depending on which one is being seen first). If you don't get this right, you'll have one screen coming up OK, and the other one coming up blank. I spent some time battling with this before the solution occurred to me; I hope therefore that this information is useful to someone else!

FWIW I'd also note that different resolution monitors is suboptimal for a TwinView setup; sometimes one has to make do with what one has, though.


5 Comments

jeremiah foster
2007-02-15 13:20:04
What other resources did you use for setting this up? I may have to do this in the future and would like to prepare. =)
Juliet
2007-02-15 15:32:55
Assuming that you have the appropriate hardware (Nvidia card - I think pretty much all the modern ones support TwinView; this particular card came with a two-monitor splitter cable from the DVI in - and 2 monitors), the process as above should Just Work. The Debian nvidia packages are pretty good, especially if used as above with module-assistant to do all the hard work for you.
Eric Gnoske
2007-05-09 21:39:05
I used your xorg.conf setup on my Dell M90 Precision that I use at home and work. Your setup worked great for the different resolutions of my two monitors (1920x1200 and 1280x1024). The restricted driver manager automatically setup the Nvidia card for me - Thanks.
Ingmar
2007-08-04 09:29:36
I tried this on my sony vaio. Didn't work out, I'm using a samsung Syncaster 206bw to take some stuff of my tiny 15.4" screen, but it didn't work out like this.
Thomas
2007-09-30 03:56:37
Brilliant! Thank you for this it really helped me!