Chapter 26. Configuring Frame Lock and Genlock
Prev | Part I. Installation and Configuration Instructions | Next

## Chapter 26. Configuring Frame Lock and Genlock

NOTE: Frame Lock and Genlock features are supported only on specific hardware, as noted below.

Visual computing applications that involve multiple displays, or even multiple windows within a display, can require special signal processing and application controls in order to function properly. For example, in order to produce quality video recording of animated graphics, the graphics display must be synchronized with the video camera. As another example, applications presented on multiple displays must be synchronized in order to complete the illusion of a larger, virtual canvas.

This synchronization is enabled through the frame lock and genlock capabilities of the NVIDIA driver. This section describes the setup and use of frame lock and genlock.

### Definition of Terms

GENLOCK: Genlock refers to the process of synchronizing the pixel scanning of one or more displays to an external synchronization source. NVIDIA Genlock requires the external signal to be either TTL or composite, such as used for NTSC, PAL, or HDTV. It should be noted that the NVIDIA Genlock implementation is guaranteed only to be frame-synchronized, and not necessarily pixel-synchronized.

FRAME LOCK: Frame Lock involves the use of hardware to synchronize the frames on each display in a connected system. When graphics and video are displayed across multiple monitors, frame locked systems help maintain image continuity to create a virtual canvas. Frame lock is especially critical for stereo viewing, where the left and right fields must be in sync across all displays.

In short, to enable genlock means to sync to an external signal. To enable frame lock means to sync 2 or more display devices to a signal generated internally by the hardware, and to use both means to sync 2 or more display devices to an external signal.

SWAP SYNC: Swap sync refers to the synchronization of buffer swaps of multiple application windows. By means of swap sync, applications running on multiple systems can synchronize the application buffer swaps between all the systems. In order to work across multiple systems, swap sync requires that the systems are frame locked.

G-SYNC DEVICE: A G-Sync Device refers to devices capable of Frame lock/Genlock. This can be a graphics card (Quadro FX 3000G) or a stand alone device (Quadro FX G-Sync). See "Supported Hardware" below.

### Supported Hardware

Frame lock and genlock are supported for the following hardware:

Card |
Quadro FX 3000G |
Quadro FX G-Sync, used in conjunction with a Quadro FX 4400, Quadro FX 4500, or Quadro FX 5500 |
Quadro FX G-Sync II, used in conjunction with a Quadro FX 4600, or Quadro FX 5600 |

### Hardware Setup

Before you begin, you should check that your hardware has been properly installed. If you are using the Quadro FX 3000G, the genlock/frame lock signal processing hardware is located on the dual-slot card itself, and after installing the card, no additional setup is necessary.

If you are using the Quadro FX G-Sync card in conjunction with a graphics card, the following additional setup steps are required. These steps must be performed when the system is off.

1. On the Quadro FX G-Sync card, locate the fourteen-pin connector labeled "primary". If the associated ribbon cable is not already joined to this connector, do so now. If you plan to use frame lock or genlock in conjunction with SLI FrameRendering or Multi-GPU FrameRendering (see Chapter 25, Configuring SLI and Multi-GPU FrameRendering) or other multi-GPU configurations, you should connect the fourteen-pin connector labeled "secondary" to the second GPU. A section at the end of this appendix describes restrictions on such setups.

2. Install the Quadro FX G-Sync card in any available slot. Note that the slot itself is only used for support, so even a known "bad" slot is acceptable. The slot must be close enough to the graphics card that the ribbon cable can reach.

3. Connect the other end of the ribbon cable to the fourteen-pin connector on the graphics card.

You may now boot the system and begin the software setup of genlock and/or frame lock. These instructions assume that you have already successfully installed the NVIDIA Accelerated Linux Driver Set. If you have not done so, see Chapter 4, Installing the NVIDIA Driver.

### Configuration with nvidia-settings GUI

Frame lock and genlock are configured through the nvidia-settings utility. See the `nvidia-settings(1)` man page, and the nvidia-settings online help (click the "Help" button in the lower right corner of the interface for per-page help information).

From the nvidia-settings frame lock panel, you may control the addition of G-Sync (and display) devices to the frame lock/genlock group, monitor the status of that group, and enable/disable frame lock and genlock.

After the system has booted and X Windows has been started, run nvidia-settings as

        % nvidia-settings

You may wish to start this utility before continuing, as we refer to it frequently in the subsequent discussion.

The setup of genlock and frame lock are described separately. We then describe the use of genlock and frame lock together.

### Genlock Setup

After the system has been booted, connect the external signal to the house sync connector (the BNC connector) on either the graphics card or the G-Sync card. There is a status LED next to the connector. A solid red LED indicates that the hardware cannot detect the timing signal. A green LED indicates that the hardware is detecting a timing signal. An occasional red flash is okay. The G-Sync device (graphics card or G-Sync card) will need to be configured correctly for the signal to be detected.

In the frame lock panel of the nvidia-settings interface, add the X Server that contains the display and G-Sync devices that you would like to sync to this external source by clicking the "Add Devices..." button. An X Server is typically specified in the format `system:m`, e.g.:

        mycomputer.domain.com:0

or

        localhost:0

After adding an X Server, rows will appear in the "G-Sync Devices" section on the frame lock panel that displays relevant status information about the G-Sync devices, GPUs attached to those G-Sync devices and the display devices driven by those GPUs. In particular, the G-Sync rows will display the server name and G-Sync device number along with "Receiving" LED, "Rate", "House" LED, "Port 0"/"Port 1" Images, and "Delay" information. The GPU rows will display the GPU product name information along with the GPU ID for the server. The Display Device rows will show the display device name and device type along with server/client check boxes, refresh rate, "Timing" LED and "Stereo" LED.

Once the G-Sync and display devices have been added to the frame lock/genlock group, a Server display device will need to be selected. This is done by selecting the "Server" check box of the desired display device.

If you are using a G-Sync card, you must also click the "Use House Sync if Present" check box. To enable synchronization of this G-Sync device to the external source, click the "Enable Frame Lock" button. The display device(s) may take a moment to stabilize. If it does not stabilize, you may have selected a synchronization signal that the system cannot support. You should disable synchronization by clicking the "Disable Frame Lock" button and check the external sync signal.

Modifications to genlock settings (e.g., "Use House Sync if Present", "Add Devices...") must be done while synchronization is disabled.

### Frame Lock Setup

Frame Lock is supported across an arbitrary number of Quadro FX 3000 or Quadro FX G-Sync systems, although mixing the two in the same frame lock group is not supported. Additionally, each system to be included in the frame lock group must be configured with identical mode timings. See Chapter 19, Programming Modes for information on mode timings.

Connect the systems through their RJ45 ports using standard CAT5 patch cables. These ports are located on the frame lock card itself (either the Quadro FX 3000 or the Quadro FX G-Sync card). Do not connect a frame lock port to an ethernet card or hub. Doing so may permanently damage the hardware. The connections should be made in a daisy-chain fashion: each card has two RJ45 ports, call them 1 and 2. Connect port 1 of system A to port 2 of system B, connect port 1 of system B to port 2 of system C, etc. Note that you will always have two empty ports in your frame lock group.

The ports self-configure as inputs or outputs once frame lock is enabled. Each port has a yellow and a green LED that reflect this state. A flashing yellow LED indicates an output and a flashing green LED indicates an input. A solid green LED indicates that the port has not yet configured.

In the frame lock panel of the nvidia-settings interface, add the X server that contains the display devices that you would like to include in the frame lock group by clicking the "Add Devices..." button (see the description for adding display devices in the previous section on GENLOCK SETUP. Like the genlock status indicators, the "Port 0" and "Port 1" columns in the table on the frame lock panel contain indicators whose states mirror the states of the physical LEDs on the RJ45 ports. Thus, you may monitor the status of these ports from the software interface.

Any X Server can be added to the frame lock group, provided that

1. The system supporting the X Server is configured to support frame lock and is connected via RJ45 cable to the other systems in the frame lock group.

2. The system driving nvidia-settings can locate and has display privileges on the X server that is to be included for frame lock.

A system can gain display privileges on a remote system by executing

        % xhost +

on the remote system. See the xhost(1) man page for details. Typically, frame lock is controlled through one of the systems that will be included in the frame lock group. While this is not a requirement, note that nvidia-settings will only display the frame lock panel when running on an X server that supports frame lock.

To enable synchronization on these display devices, click the "Enable Frame Lock" button. The screens may take a moment to stabilize. If they do not stabilize, you may have selected mode timings that one or more of the systems cannot support. In this case you should disable synchronization by clicking the "Disable Frame Lock" button and refer to Chapter 19, Programming Modes for information on mode timings.

Modifications to frame lock settings (e.g. "Add/Remove Devices...") must be done while synchronization is disabled.

nvidia-settings will not automatically enable Frame Lock via the nvidia-settings.rc file. To enable Frame Lock when starting the X server, a line such as the following can be added to the `~/.xinitrc` file:

        # nvidia-settings -a [gpu:0]/FrameLockEnable=1

### Frame Lock + Genlock

The use of frame lock and genlock together is a simple extension of the above instructions for using them separately. You should first follow the instructions for Frame Lock Setup, and then to one of the systems that will be included in the frame lock group, attach an external sync source. In order to sync the frame lock group to this single external source, you must select a display device driven by the GPU connected to the G-Sync card (through the primary connector) that is connected to the external source to be the signal server for the group. This is done by selecting the check box labeled "Server" of the tree on the frame lock panel in nvidia-settings. If you are using a G-Sync based frame lock group, you must also select the "Use House Sync if Present" check box. Enable synchronization by clicking the "Enable Frame Lock" button. As with other frame lock/genlock controls, you must select the signal server while synchronization is disabled.

### Configuration with nvidia-settings command line

Frame Lock may also be configured through the nvidia-settings command line. This method of configuring Frame Lock may be useful in a scripted environment to automate the setup process. (Note that the examples listed below depend on the actual hardware configuration and as such may not work as-is.)

To properly configure Frame Lock, the following steps should be completed:

1. Make sure Frame Lock Sync is disabled on all GPUs.

2. Make sure all display devices that are to be frame locked have the same refresh rate.

3. Configure which (display/GPU) device should be the master.

4. Configure house sync (if applicable).

5. Configure the slave display devices.

6. Enable frame lock sync on the master GPU.

7. Enable frame lock sync on the slave GPUs.

8. Toggle the test signal on the master GPU (for testing the hardware connectivity.)

For a full list of the nvidia-settings Frame Lock attributes, please see the `nvidia-settings(1)` man page. Examples:

1. 1 System, 1 Frame Lock board, 1 GPU, and 1 display device syncing to the house signal:

         # - Make sure frame lock sync is disabled
         nvidia-settings -a [gpu:0]/FrameLockEnable=0
         nvidia-settings -q [gpu:0]/FrameLockEnable

         # - Query the enabled displays on the gpu
         nvidia-settings -q [gpu:0]/EnabledDisplays

         # - Check that the refresh rate is the one we want
         nvidia-settings -q [gpu:0]/RefreshRate

         # - Set the master display device to CRT-0.  The desired display
         #   device(s) to be set are passed in as a hexadecimal number
         #   in which specific bits denote which display devices to set.
         #   examples:
         #
         #   0x00000001 - CRT-0
         #   0x00000002 - CRT-1
         #   0x00000003 - CRT-0 and CRT-1
         #
         #   0x00000100 - TV-0
         #   0x00000200 - TV-1
         #
         #   0x00020000 - DFP-1
         #
         #   0x00010101 - CRT-0, TV-0 and DFP-0
         #
         #   0x000000FF - All CRTs
         #   0x0000FF00 - All TVs
         #   0x00FF0000 - All DFPs
         #
         #   Note that the following command:
         #
         #     nvidia-settings -q [gpu:0]/EnabledDisplays
         #
         #   will list the available displays on the given GPU.

         nvidia-settings -a [gpu:0]/FrameLockMaster=0x00000001
         nvidia-settings -q [gpu:0]/FrameLockMaster

         # - Enable use of house sync signal
         nvidia-settings -a [framelock:0]/FrameLockUseHouseSync=1

         # - Configure the house sync signal video mode
         nvidia-settings -a [framelock:0]/FrameLockVideoMode=0

         # - Set the slave display device to none (to avoid
         #   having unwanted display devices locked to the
         #   sync signal.)
         nvidia-settings -a [gpu:0]/FrameLockSlaves=0x00000000
         nvidia-settings -q [gpu:0]/FrameLockSlaves

         # - Enable frame lock
         nvidia-settings -a [gpu:0]/FrameLockEnable=1

         # - Toggle the test signal
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=1
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=0

2. 2 Systems, each with 2 GPUs, 1 Frame Lock board and 1 display device per GPU syncing from the first system's first display device:

         # - Make sure frame lock sync is disabled
         nvidia-settings -a myserver:0[gpu:0]/FrameLockEnable=0
         nvidia-settings -a myserver:0[gpu:1]/FrameLockEnable=0
         nvidia-settings -a myslave1:0[gpu:0]/FrameLockEnable=0
         nvidia-settings -a myslave1:0[gpu:1]/FrameLockEnable=0

         # - Query the enabled displays on the GPUs
         nvidia-settings -q myserver:0[gpu:0]/EnabledDisplays
         nvidia-settings -q myserver:0[gpu:1]/EnabledDisplays
         nvidia-settings -q myslave1:0[gpu:0]/EnabledDisplays
         nvidia-settings -q myslave1:0[gpu:1]/EnabledDisplays

         # - Check the refresh rate is the same for all displays
         nvidia-settings -q myserver:0[gpu:0]/RefreshRate
         nvidia-settings -q myserver:0[gpu:1]/RefreshRate
         nvidia-settings -q myslave1:0[gpu:0]/RefreshRate
         nvidia-settings -q myslave1:0[gpu:1]/RefreshRate

         # - Make sure the display device we want as master is masterable
         nvidia-settings -q myserver:0[gpu:0]/FrameLockMasterable

         # - Set the master display device (CRT-0)
         nvidia-settings -a myserver:0[gpu:0]/FrameLockMaster=0x00000001

         # - Disable the house sync signal on the master device
         nvidia-settings -a myserver:0[framelock:0]/FrameLockUseHouseSync=0

         # - Set the slave display devices
         nvidia-settings -a myserver:0[gpu:1]/FrameLockSlaves=0x00000001
         nvidia-settings -a myslave1:0[gpu:0]/FrameLockSlaves=0x00000001
         nvidia-settings -a myslave1:0[gpu:1]/FrameLockSlaves=0x00000001

         # - Enable frame lock on server
         nvidia-settings -a myserver:0[gpu:0]/FrameLockEnable=1

         # - Enable frame lock on slave devices
         nvidia-settings -a myserver:0[gpu:1]/FrameLockEnable=1
         nvidia-settings -a myslave1:0[gpu:0]/FrameLockEnable=1
         nvidia-settings -a myslave1:0[gpu:1]/FrameLockEnable=1

         # - Toggle the test signal
         nvidia-settings -a myserver:0[gpu:0]/FrameLockTestSignal=1
         nvidia-settings -a myserver:0[gpu:0]/FrameLockTestSignal=0

3. 1 System, 4 GPUs, 2 Frame Lock boards and 2 display devices per GPU syncing from the first GPU's display device:

         # - Make sure frame lock sync is disabled
         nvidia-settings -a [gpu:0]/FrameLockEnable=0
         nvidia-settings -a [gpu:1]/FrameLockEnable=0
         nvidia-settings -a [gpu:2]/FrameLockEnable=0
         nvidia-settings -a [gpu:3]/FrameLockEnable=0

         # - Query the enabled displays on the GPUs
         nvidia-settings -q [gpu:0]/EnabledDisplays
         nvidia-settings -q [gpu:1]/EnabledDisplays
         nvidia-settings -q [gpu:2]/EnabledDisplays
         nvidia-settings -q [gpu:3]/EnabledDisplays

         # - Check the refresh rate is the same for all displays
         nvidia-settings -q [gpu:0]/RefreshRate
         nvidia-settings -q [gpu:1]/RefreshRate
         nvidia-settings -q [gpu:2]/RefreshRate
         nvidia-settings -q [gpu:3]/RefreshRate

         # - Make sure the display device we want as master is masterable
         nvidia-settings -q myserver:0[gpu:0]/FrameLockMasterable

         # - Set the master display device (CRT-0)
         nvidia-settings -a [gpu:0]/FrameLockMaster=0x00000001

         # - Disable the house sync signal on the master device
         nvidia-settings -a [framelock:0]/FrameLockUseHouseSync=0

         # - Set the slave display devices
         nvidia-settings -a [gpu:0]/FrameLockSlaves=0x00000002 # CRT-1
         nvidia-settings -a [gpu:1]/FrameLockSlaves=0x00000003 # CRT-0 and CRT-1
         nvidia-settings -a [gpu:2]/FrameLockSlaves=0x00000003 # CRT-0 and CRT-1
         nvidia-settings -a [gpu:3]/FrameLockSlaves=0x00000003 # CRT-0 and CRT-1

         # - Enable frame lock on master GPU
         nvidia-settings -a [gpu:0]/FrameLockEnable=1

         # - Enable frame lock on slave devices
         nvidia-settings -a [gpu:1]/FrameLockEnable=1
         nvidia-settings -a [gpu:2]/FrameLockEnable=1
         nvidia-settings -a [gpu:3]/FrameLockEnable=1

         # - Toggle the test signal
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=1
         nvidia-settings -a [gpu:0]/FrameLockTestSignal=0

### Leveraging Frame Lock/Genlock in OpenGL

With the GLX_NV_swap_group extension, OpenGL applications can be implemented to join a group of applications within a system for local swap sync, and bind the group to a barrier for swap sync across a frame lock group. A universal frame counter is also provided to promote synchronization across applications.

### Frame Lock Restrictions:

The following restrictions must be met for enabling frame lock:

1. All display devices set as client in a frame lock group must have the same mode timings as the server (master) display device. If a House Sync signal is used (instead of internal timings), all client display devices must be set to have the same refresh rate as the incoming house sync signal.

2. All X Screens (driving the selected client/server display devices) must have the same stereo setting. See Appendix B, X Config Options for instructions on how to set the stereo X option.

3. The frame lock server (master) display device must be on a GPU on the primary connector to a G-Sync device.

4. If connecting a single GPU to a G-Sync device, the primary connector must be used.

5. In configurations with more than one display device per GPU, we recommend enabling frame lock on all display devices on those GPUs.

6. Virtual terminal switching or mode switching will disable frame lock on the display device. Note that the glXQueryFrameCountNV entry point (provided by the GLX_NV_swap_group extension) will only provide incrementing numbers while frame lock is enabled. Therefore, applications that use glXQueryFrameCountNV to control animation will appear to stop animating while frame lock is disabled.

### Supported Frame Lock Configurations:

The following configurations are currently supported:

1. Basic Frame Lock: Single GPU, Single X Screen, Single Display Device with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

2. Frame Lock + TwinView: Single GPU, Single X Screen, Multiple Display Devices with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

3. Frame Lock + Xinerama: 1 or more GPU(s), Multiple X Screens, Multiple Display Devices with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

4. Frame Lock + TwinView + Xinerama: 1 or more GPU(s), Multiple X Screens, Multiple Display Devices with or without OpenGL applications that make use of Quad-Buffered Stereo and/or the GLX_NV_swap_group extension.

5. Frame Lock + SLI SFR, AFR, or AA: 2 GPUs, Single X Screen, Single Display Device with either OpenGL applications that make use of Quad-Buffered Stereo or the GLX_NV_swap_group extension. Note that for Frame Lock + SLI Frame Rendering applications that make use of both Quad-Buffered Stereo and the GLX_NV_swap_group extension are not supported. Note that only 2-GPU SLI configurations are currently supported.

6. Frame Lock + Multi-GPU SFR, AFR, or AA: 2 GPUs, Single X Screen, Single Display Device with either OpenGL applications that make use of Quad-Buffered Stereo or the GLX_NV_swap_group extension. Note that for Frame Lock + Multi-GPU Frame Rendering applications that make use of both Quad-Buffered Stereo and the GLX_NV_swap_group extension are not supported.

Prev | Up | Next
Chapter 25. Configuring SLI and Multi-GPU FrameRendering | Home | Chapter 27. Configuring SDI Video Output