X.Org/Dual Monitors/Nvidia

= Separate screens = Graphics chips that support TwinView can also be configured to treat each connected display device as separate X screens.

Advantages of Separate Screens:
 * Properties that may vary between X screens may vary between displays (eg: depth, root window size, etc).
 * Hardware that can only be used on one display at a time (eg: video overlays, hardware accelerated RGB overlays) can be exposed on the first X screen (these cannot be used at all when in TwinView)
 * The 1-to-1 association of display devices to X screens is more historically in line with X. This allows for more exotic configurations with multiple graphic cards.

To set up multiple screens, set up your card following the nvidia guide, then follow general X.Org/Dual Monitors instructions.

= Twinview =

TwinView is a configuration for two monitors connected to one card, that will appear as one screen to the X server.

Advantages to TwinView:
 * Reduced overhead through avoiding X11's Xinerama extension,
 * Software OpenGL will be used with windows spanning two or more X screens.

Metamodes for 3D Games
Most 3D apps are not prepared for a double-width resolution (including, for example, UT2004) and will annoyingly appear in the middle of the virtual screen, across the split, unless you specify a MetaMode at the correct resolution for only one monitor.

Note the MetaModes option, which is a semicolon-delimited list of the modes of one or both monitors. For full screen games, you will probably want at least one single-monitor MetaMode (eg: 1280x1024;) that the game can use. Replace "UseEdidFreqs" with appropriate horizontal and vertical refresh rates if your monitors don't report these values correctly.

Auto monitor detection issue
A possible downside with the above config is that it generally requires both monitors are turned on when issuing the command "startx" or when gdm loads. If X doesn't find both monitors, it falls back to the non-twin view setup and you'll have to restart x with the second monitor turned on.

Connecting a second monitor after X startup
A way around this is to add to section device to override detection of attached displays. If you use DVI cables with your LCD monitor then replace crt with dfp (digital flat panel). The inverse is important: if you use your LCD in analog mode (non-dvi cable) you should refer to the monitor as "CRT". You can also change the order here.

Since the monitor is not connected on startup and can not be queried for frequencies(no edid), you will probably have to specify them. You can use the above "SecondMonitorHorizSync" option, the "HorizSync" option(see nvidia's README) or you might have to put the vertical refresh in the Metamodes option(see the "_60" in the MetaModes option below). If you don't know which monitor you'll use, you can change the settings later on with the nvidia-settings utility.

If you occasionally lose your mouse to the second (non-connected) monitor or if you want to save some energy(laptop users), you can disable the second monitor on entering X. In order to do that, you have to have a MetaMode where the second monitor is switched off, i.e. something like:

If you use nvidia-drivers-100.14.19(and possibly others), xrandr will show you something like this

Screen 0: minimum 1440 x 900, current 2720 x 1024, maximum 2720 x 1024 default connected 2720x1024+0+0 0mm x 0mm 2720x1024     50.0* 1440x900      51.0

Now you can switch the second monitor on and off with

and

Kde 3.5.7 and compiz-fusion play along nicely as long as they are started when both displays are activated(not necessarily connected).

For KDE/GNOME: Make sure that either Qt or Metacity has the xinerama flag enabled. This is something to watch out for when moving from a single to dual head configuration as its easy to overlook.

Model your Device section after this one:

Use the standard dual-head ServerLayout, Screen, and Monitor sections. Note that TwinView has not been used. KDE4 will not support output on :0, you will need to run a window manager like CTWM or similar on the second screen.