Chapter 3. Using OpenGL Multipipe

As described in Chapter 1, OpenGL Multipipe consists of three main components: an X proxy layer, a proxy 3D render library, and 3D render servers. This chapter describes how to effectively use these components with your graphics applications. The following sections describe the pertinent tasks:

For information about other features of OpenGL Multipipe specific to this release, see the release notes in the following file:

/usr/share/omp/release_notes/user/relnotes.html

Setting up the OpenGL Multipipe Environment

To begin using OpenGL Multipipe, you must enable an X proxy layer. This will cause all applications to see a single logical pipe. To deactivate OpenGL Multipipe, just disable the X proxy layer. Some of the steps required to enable or disable OpenGL Multipipe may require root access. This section notes this requirement in the applicable steps.

This section describes the following tasks:

Configuring OpenGL Multipipe with DMX as the X Proxy Layer

DMX will group multiple screens into a logical display. This section describes how you initialize DMX and how to create DMX configuration files.

Initializing DMX

To initialize DMX, do the following:

  1. Run DMX on top of the existing X server(s).

    You may do this manually after logging into your desktop or you may configure an .xsession script to run DMX immediately upon login.

    To manually initialize DMX, enter the following (root access not needed) in a command shell:

    $ 
    ompstartdmx
    

    You can use the flag –help for more information about the starting options. If you specify no flags, DMX starts on top of the existing X server and will configure a single large screen that overlays the existing n screens such that screen 0 will be the leftmost and screen n –1 will be the rightmost. To use a different configuration, such as a vertical configuration, you must provide a DMX configuration file. The following section “Creating DMX Configuration Files”describes how to create such a configuration file.

    Only the client xterm will be started as the session. For more details, see the later subsection “Notes About the Behavior of ompstartdmx”.

    Configuring DMX to Run Automatically on Linux

    This following describes how you configure DMX to run automatically upon login using GDM or KDM.

    At the login screen, choose one of the following from the Session menu:

    • GNOME-OpenGL-Multipipe

    • KDE-OpenGL-Multipipe

    Choosing one of these will start DMX with GNOME or KDE, respectively. The session will use the default DMX configuration. If you want to customize the ompstartdmx options (for example, to use a special DMX configuration file), modify the scripts in the following directory corresponding to your choice of window manager:

    • /usr/share/omp/X11/bin/GNOME-OpenGL-Multipipe

    • /usr/share/omp/X11/bin/KDE-OpenGL-Multipipe

    If you want to add another new session script, you should add a new desktop session configuration file in the following directory corresponding to your choice of window manager:

    • /opt/kde3/share/apps/kdm/sessions

    • /opt/gnome/share/xsessions

    You can copy and change one of the sgiomp_gnome.desktop or sgiomp_kde.desktop files in that directory.

After DMX has initialized, you will see a new session covering all the screens. At this point, you can start using OpenGL Multipipe (see “Running Applications with OpenGL Multipipe”).

Notes About the Behavior of ompstartdmx

This section lists some noteworthy items about the behavior and command-line options of the ompstartdmx script:

  • The window manager is the default window manager for GNOME or KDE. Use their standard tools to set your preferred window manager.

  • The ompstartdmx script will return control only when the session ends.

  • The valid options for the –session flag are as follows:

    [ -session {gnome | kde | noaware | scriptname} ]
    

    Option 

    Behavior

    session unspecified 

    Starts a single xterm as the session. The session ends when this xterm dies.

    gnome 

    Starts a GNOME session with aware support if GNOME is installed; otherwise, xterm will be used.

    kde 

    Starts a KDE session with aware support if KDE is installed; othersise, xterm will be used.

    noaware 

    Launches without aware window management the default session that would run with the startx command.

    scriptname 

    Runs the script as the session. When the script returns control, the session ends. Note:The ompstartdmx script does not launch any window manager; the session script must do so.

  • Use logout or Ctrl-Alt-q to end the session.

DMX Limitations on Linux

When using a GNOME session with an aware window manager, the session will not be saved; the default session will be used at each login. This happens because the gnome-wm script does not pass the session ID parameter to any aware window manager, only to those which are supported by the GNOME environment (sawfish, metacity, twm, and their like). When using a KDE or GNOME session without aware window management, the session will be saved and restord at the next login.

Creating DMX Configuration Files

A DMX configuration file is simply a text file that describes the configuration of a virtual display, the real displays it manages, and the geometry of the virtual screen. This section provides some short examples of configuration files. These and other example configuration files may be found in the directory /usr/share/omp/examples/dmx .

To start DMX with one of these configurations, do the following:

  1. Save the configuration to a text file with any name—for example, updown.dmx.

  2. Invoke ompstartdmx with the option –cfgfile, as shown in the following entry:

    $ ompstartdmx -cfgfile updown.dmx
    

    It is also possible to place many configurations in a single file. In this case, you can choose one configuration from the file by specifying both the –cfgfile and –cfgname options, as shown in the following:

    $ ompstartdmx -cfgfile allmyconfigs.dmx -cfgname updown
    

The following example configuration file specifies a vertical layout:

virtual updown 1280x2048 {
    display :0.0 1280x1024;
    display :0.1 1280x1024 @0x1024;
}

This configuration file defines a virtual screen configuration named updown of size 1280x2048. The virtual screen includes the following two real back-end displays:

Display :0.0 

It has a size of 1280x1024 and is located at location 0x0 in the virtual screen space.

Display :0.1 

It has a size of 1280x1024 and is located at 0x1024 in the virtual screen space.

You may also define some overlap between each of the screens, as in the following horizontal layout:

virtual overlap 2460x1024 {
    display :0.0 1280x1024;
    display :0.1 1280x1024 @1180x0;
}

This configuration file defines two screens of 1280x1024, each with 100 pixels of overlap, resulting in a virtual screen size of 2460x1024.

The display value specified can be any valid display value, including a display value that specifies a remote machine, as in the following example:

virtual remote 2560x1024 {
    display localhost:0.0 1280x1024;
    display remotehost:0.1 1280x1024 @1280x0;
}

There is also a graphical tool to create and edit configuration files. You can find documentation for this tool in /usr/share/omp/doc/user/xdmxconfig.1.html. The tool is installed in /usr/share/omp/X11/bin/xdmxconfig.

More information about the configuration file format can be found in the file /usr/share/omp/doc/user/Xdmx.1.html.

Setting Other Configuration Options

Starting with version 2.5, OpenGL Multipipe uses X11 resources to specify configuration options. This approach allows you to define values per application, per user, and system-wide. This section describes setting these options in the following subsections:

Specifying Resource Names

The full name of each OpenGL Multipipe resource has the following format:

OMP.app_name.resource_name

The app_name field is the application name, defined to be the last component in the running executable path name. The resource_name is one of the available OpenGL Multipipe resources.

You can specify a resource with loose binding—that is, matching the resource for all applications—by using an asterisk in the following manner:

OMP*resource_name

For more information on the X11 resources and their scope, see the X(1) and XrmInitialize(3) man pages.

The Resource Search Path

The following ordered list of resource files indicates the search path OpenGL Multipipe uses to assign values to the resources:

  1. Resources set with omprun

  2. Resources set with xrdb

  3. $HOME/.Xdefaults

  4. /usr/share/omp/app-defaults/app_name

  5. /usr/share/omp/config

The first match found will be used. However, resources set with the full-name format will always precede resources set with loose binding even if the full-name format is found later in the search path. Resources set with the omprun command always have precedence. For information of the use of the omprun command, see section “Setting Run-Time Options”.

If a resource is not specified in the preceding search path, then the defined default value for that resource will be used.

When you set the environment variable SGIOMP_PRINT_CONFIG to 1, OpenGL Multipipe prints the configuration values it uses to stdout when an application runs through OpenGL Multipipe. This is useful to ensure that any overrides you have specified are being honored.

Resource Types

Each resource value can have one of the following types:

Type 

Description

Bool 

A boolean value. Valid values are 0, 1, off, or on.

Enum 

Enumeration: one of a specified list of tokens.

Float 

A floating point value.

FloatList 

A comma-separated list of floating point values.

Int 

An integer number.

IntList 

A comma-separated list of integer values.

Enum 

An enumeration: one of a specified list of tokens.

Resources and Their Default Values

Table 3-1 lists all resources with their default values.

Notes:

  • A resource name is not identical to the name of the associated command-line option of omprun.

  • The default values might be changed in future releases.

    Table 3-1. X11 Resources and Defaults

    Resource[a]

    Value Type

    Default Value

    aa2Jitter.X

    FloatList

    0.24649, -0.24649

    aa2Jitter.Y

    FloatList

    0.249999, -0.249999

    aa4Jitter.X

    FloatList

    -0.208147, 0.203849, -0.292626, 0.296924

    aa4Jitter.Y

    FloatList

    0.353730, -0.353780, -0.149945, 0.149994

    activeScreens

    IntList

    The list of all back-end screens of the meta X server

    culling

    (cull)

    Bool

    off

    culling.cullUserClipPlanes

    Bool

    off

    culling.minPixels

    (minpixels)

    Int

    1

    culling.showStat

    (cullshow)

    Enum:
    off
    bbox
    stats
    all

    off

    culling.texCulling

    Bool

    off

    dlSplit

    (dlsplit)

    Bool

    off

    dlSplit.maxBoundAspectRatio

    Int

    8

    dlSplit.maxDepth

    Int

    8

    dlSplit.maxStripLen

    Int

    -1

    dlSplit.maxTotalTris

    Int

    400000

    dlSplit.maxTris

    (dlsplitmaxtris)

    Int

    800

    dlSplit.showRandomColors

    (dlsplitshow)

    Bool

    off

    drawPixelsClipping

    Bool

    on

    masterMode

    (mstrmode)

    Enum:
    render
    track
    off

    track when omprun is used
    off, otherwise

    masterScreen

    Int

    0

    maxFramesLatency

    (latency)

    Int

    4

    pbuffers.disable

    Bool

    off

    pbuffers.layout

    Enum:
    duplicate horizSplit vertSplit rectSplit

    duplicate

    shmQueueSize

    Int

    DisplayWidth * DisplayHeight * 4

    slaveCPUs

    IntList

    Empty

    swapSyncMode

    (nosync,swapready)

    Enum:
    none
    soft
    barrier

    soft

    syncOnFlushMode

    Enum:
    never
    always
    frontBuffer

    frontBuffer

    texShm

    Bool

    off (unless culling.texCulling is on)

    useTmpfs

    Bool

    on

    useTmpfs.shmPlacement

    Enum:
    master
    slaves
    all_omp
    global
    os

    os

    viewportClippingMode

    (novpclip)

    Enum:
    none
    scissor
    viewport subwin

    subwin for Xdmx displays

    [a] The associated omprun command-line options are shown in parentheses, where applicable.


Resource Descriptions

This section briefly describes each of the OpenGL Multipipe tunable resources:

aa2Jitter.X and aa2Jitter.Y
Controls the jittering offset for each input pipe when the hardware compositor configured for pixel averaging with two pipes. The value must include two values for both X and Y to specify the frustum offset in pixels on the x and y axes to be applied for the first and second pipe participating in the pixel averaging.

aa4Jitter.X and aa4Jitter.Y
Controls the jittering offset for each input pipe when the hardware compositor configured for pixel averaging with four pipes. The value must include four values for both X and Y to specify the frustum offset in pixels on the x and y axes to be applied for the first, second, third, and fourth pipes participating in the pixel averaging.

activeScreens
Specifies the back-end screens to be active. OpenGL Multipipe will render OpenGL primitives only on those pipes. For example, when Xdmx manages three physical screens (pipes), setting the activeScreens resource to 0,1 will make OpenGL rendering to be visible on screens 0 and 1 only. On screens 2 and 3, the OpenGL part of the application windows will be either black or garbage. By default, all managed screens will be active with respect to OpenGL.

culling
Specifies the enable switch for the geometry culling feature of OpenGL Multipipe. It can be either off or on. When this resource is enabled OpenGL Multipipe will draw to each pipe only the geometry primitives that are visible on that pipe. The default value for this switch is off. For more information, see section “Geometry Culling” in Chapter 5.

culling.cullUserClipPlanes
Enables culling against user-defined clip planes when one of GL_CLIP_PLANEi is enabled. The default value is off, in which case OpenGL Multipipe will cull only against the viewing frustum.

culling.minPixels
Specifies approximate culling—that is, the minimum object size in pixels that should be drawn. All objects smaller than this size will be culled. For more information, see section “Small Object Culling” in Chapter 5.

culling.showStat
Enables the drawing of culling statistics. The following are the possible values:

off 

No statistics are drawn (the default).

bbox 

The bounding box for each geometry object is drawn in blue.

stats 

Cull percentage statistics are drawn for each screen (only for doubly buffered windows).

all 

Both bounding boxes and culling percentage statistics are drawn.

culling.texCulling
Enables or disables texture culling. When texture culling is enabled, texture loads will be postponed until the texture is really viewable on each specified pipe. In that case only, the relevent part from the texture will be downloaded to the pipe. The resource OMP*culling should be turned on for this feature. For more information and current limitations of this feature, see the release notes.

dlSplit
Allows OpenGL Multipipe to split a display list into smaller display lists based on a geometry spatial sort to acheive better culling. The smaller display lists can be distributed among the rendering pipes. This feature is usually used when culling is turned on. The valid values for dlSplit are on and off; the default is off. For more information, see section “Display List Partitioning” in Chapter 5.

dlSplit.maxBoundAspectRatio
Controls the initial cube cell size and, hence, the initial number of grid divisions produced by the dlSplit algorithm. As part of the dlSplit algorithm, the display list geometry is spatially sorted into an oct tree data structure by iteratively dividing the geometry bound to the grid of cube cells. Normally, the cell size is taken to be equal to the smallest bounding box dimension. However, for models where the aspect ratio of the bounding box is large (for example, 2D surfaces), the algorithm would produce a large number of initial cells, which would lead to a high-memory footprint. The default value is 8.

Note that setting maxBoundAspectRatio to a value less than or equal to 1.0 suppresses the splitting operation. Negative values are not allowed.

dlSplit.maxDepth
Limits the number of recursive subdivisions by the dlSplit algorithm, which is an adaptive subdivision algorithm. After the specified number of recursive subdivisions are made, the process will end even if it does not meet the dlSplit.maxTris criterion. The default value is 8.

dlSplit.maxStripLen
Controls the amount of triangulation. By default with dlSplit enabled, geometry is triangulated into separate triangles before applying the splitting algorithm. This resource can be used to preserve the application-supplied strips so that fewer vertices are generated at the cost of less efficient splitting. When the value of this resource is set to -1 (the default), all geometry will be triangulated before applying the dlSplit algorithm. When set to 0, each strip given by the application will be considered atomic for splitting purposes and will not be triangulated. When set to a positive value, each application-supplied strip will not be triangulated but will be split into multiple strips of dlSplit.maxStripLen vertices, of which each will then be considered atomic for splitting purposes.

dlSplit.maxTotalTris
Limits the number of triangles that will be considered by the dlSplit algorithm at each iteration. If a display list contains more triangles than the specified number, then the splitting algorithm will be applied multiple times, once for each group that contains the specified number of triangles. The default value is 400000.

dlSplit.maxTris
Limits the number of triangles to the specified maximum for each bounding box of subordinate display lists. Display lists that have fewer triangles (or other primitives) than the specified number will not be split by the dlSplit algorithm. The default value is 800.

dlSplit.showRandomColors
Allows OpenGL Multipipe to randomly assign a different color for each divided geometry partition. For testing and debugging purposes, this coloring allows you to better see the divisions made by the dlSplit algorithm. This may not work for all applications as it simply uses glColor() to set the color for each partition. The default is off.

drawPixelsClipping
Controls whether the glDrawPixels() operation will be clipped such that only the viewable rectangle of pixels will be sent to each pipe.

masterMode
Specifies if and how the master process needs to use one of the graphics pipes. The following are the valid values:

render 

The master process will render to the master local pipe and no slave draw process will be forked for this pipe.

track 

The master process will use its local pipe for state tracking only so that each glGet() call will be executed on the local pipe.

off 

The master will not use any physical pipe for either rendering or state tracking. Some OpenGL states are being tracked by the master in software while other states will be queried from one of the slaves when a glGet() call is being executed.

For more detailed description of the different master modes, see section “Master Rendering Modes” in Chapter 5.

When the omprun command is not being used on platforms where the omprun command is optional, the master mode is forced to be off, regardless of this resource value. Therefore, this resource is usually set only by the omprun command using its –mstrmode option.

masterScreen
Specifies which managed screen (pipe) will be used by the master application for either rendering or state tracking when running OpenGL Multipipe in master mode render or track (available only when using the omprun command). By default, it will be the first managed screen of the Xdmx server.

maxFramesLatency
Specifies the maximum latency (in frames) allowed between the application and rendering slaves. The application process might pack a few frames ahead in the framebuffer while the slave processes are still drawing the previous frames. This introduces some latency between the application and the real drawing by the slave but helps overall throughput of master and slaves. The latency is always 0 when using masterMode render and is undefined if swapSyncMode is set to none. The default value for this resource is 4. For more information, see section “Frame Latency Control” in Chapter 5.

pbuffers.disable
Disables pbuffers support. When this resource is enabled, all pbuffer-capable framebuffer configurations will be filtered out and will not be exposed to the application. The default value is off.

pbuffers.layout
Controls how the rendering into a pbuffer is split among the rendering slaves. Each rendering slave can be configured to draw only to a sub-region of each pbuffer. The following are the valid values:

duplicate
All slaves renders to all regions of the pbuffer, That makes the content of the pbuffer to be duplicated on all rendering pipes. Use this configuration when your application uses glCopy*() to copy the pixels from the pbuffer to some other pixel buffer on the pipe. The other options might be better if you are using glReadPixels() to read back the pbuffer content into your process memory. This is the default value.

horizSplit
The area of the pbuffer is split into N horizontal strips, where N is the number of pipes. Each slave then limits the rendering to only one strip.

vertSplit
The area of the pbuffer is split into N vertical strips, where N is the number of pipes. Each slave then limits the rendering to only one strip.

rectSplit
The area of the pbuffer is split into N even rectangular areas as much as possible. For example, for a four-pipe configuration, it will be split into 2x2 tiles, where each tile is of size (w/2)x(h/2) and w and h are the pbuffer width and height, respectively. Each pipe then renders to only one tile.

shmQueueSize
Sets the size in bytes for the shared memory block that will be used for master-to-slaves communication. When this resource is not specified, the default value depends on the overall resolution of the meta display as determined by the following:

( DisplayWidth * DisplayHeight * 4 ) + 32

This allows a single full-screen glDrawPixels() command to fit in the shared memory since one single OpenGL command cannot be split into multiple packets. Depending on your application, you may want to set this value to be smaller or larger. When a shared memory size larger than the default or the specified size is needed, the application will exit with an error message specifiying the minimum shared memory size needed for that application.

slaveCPUs
Specifies the CPUs to assign to the draw slave processes for each of the active screens. If there are more active screens than the size of the specified CPU list, then the remaining draw processes will not be assigned to any particular CPU. By default, the draw processes will not be assigned to any particular CPU.

swapSyncMode
Specifies what method OpenGL Multipipe will use to synchronize swap buffers on all pipes. The following are the valid values:

none  

No swap synchronization is being performed. Each rendering slave runs freely.

soft 

Software synchronization is performed using a software barrier to force all slaves to issue the glXSwapBuffers() request at the same time.

barrier 

OpenGL Multipipe uses the hardware ImageSync or Swap Ready line whenever possible (when no other application is using the hardware barrier). Otherwise, software synchronization will be used.

 

For more information on the synchronization of swap buffers, see section “Buffer Swap Synchronization” in Chapter 5.

syncOnFlushMode
Specifies if the rendering slaves need to be synchronized with each other after the execution of the glFlush() command. This is commonly required by single-buffer applications that never calls swap; this leaves the slaves asynchronous with each other. The following are the valid values for this resource:

never 

Never synchronize the slaves after glFlush().

always 

Always synchronize the slaves after glFlush().

frontBuffer 

Synchronize the slaves after glFlush() only when it is operated on a single-buffer drawable or when drawing to the front buffer. (Default)

texShm
Controls the caching of textures in shared memory. When this switch is turned on, OpenGL Multipipe will cache a copy of each texture in shared memory that remains valid until the texture is used by all pipes. Once the texture has been downloaded to driver memory of all pipes, the shared memory cache is purged. This feature works together with texture culling (see the culling.texCulling resource). When culling.texCulling is turned on, the texShm resource is implicitly turned on. The default for the texShm resource is off.

useTmpfs
Allocates shared memory under the tmpfs filesystem (mounted under /dev/shm) rather than using mmap to map a file under the /tmp directory. Note that the /dev/shm filesystem needs to have enough space to allocate the shared memory. The default value is on.

useTmpfs.shmPlacement
Governs how OpenGL Multipipe allocates shared memory across a non-uniform memory access (NUMA) architecture. In a NUMA architecture, some memory areas have different latencies and bandwidths. This memory placement control requires that the OMP*useTmpfs resource will be set to on.

The following are the valid values for this resource:

master 

Shared memory will be allocated on the application memory node.

slaves 

Shared memory will be allocated on the slaves memory nodes in a round-robin fashion.

all_omp 

Shared memory will be allocated on memory nodes used by OpenGL Multipipe processes (master and slaves) in a round-robin fashion.

global 

Shared memory will be allocated across all the system memory nodes in a round-robin fashion.

os 

Shared memory will be allocated according to the system default.


Note: If resource is set to master, slaves, or all_omp, you should place OpenGL Multipipe processes on specific CPUs using the OMP*slaveCpus resource. Otherwise, the behavior of this resource reverts to the default, that of os.


viewportClippingMode
Specifies viewport clipping mode. Each rendering slave may limit the rendering region to only the portion of the window that is visible on its rendering pipe. This is required to support large viewport areas, which are allowed by a single pipe, and it also helps to scale fill rate performance. The viewportClippingMode resource selects the method OpenGL Multipipe uses to limit this rendering region. The following are the valid values:

none 

No viewport clipping is performed. Each hardware pipe clips the window to the pipe's boundary.

scissor 

OpenGL Multipipe uses glScissor() to limit the rendering to the viewing area only.

viewport 

OpenGL Multipipe defines a different viewport for each rendering slave.

subwin 

OpenGL Multipipe creates a separate child window for each rendering slave. The window size is the viewable region of the application window on the slave's pipe. This option is supported on DMX configurations only.When this resource is not specified, the default depends on the meta X server that is being used. For Xdmx the default is subwin. For more information, see section “Viewport Clipping” in Chapter 5.

Verifying That the OpenGL Multipipe Environment is Enabled

The OpenGL Multipipe environment is enabled if DMX is enabled.

To verify that DMX is enabled, ensure that your DISPLAY environment variable is pointing to the correct display (usually :1.0) and enter the following commands in a command shell:

$ xdpyinfo | grep DMX

If DMX appears as the result of the prior commands, DMX is enabled.


Note: If DMX-DRI appears as the result of the prior commands, not only is DMX enabled but the use of the omprun command will be optional as well. See section “Running Applications with OpenGL Multipipe”.


Disabling the OpenGL Multipipe Environment

To disable the OpenGL Multipipe environment, end a DMX session by simply logging out. You may also force the DMX server to exit by pressing Ctrl+Alt+q. If you ran ompstartdmx from the command line, you will be returned to your regular X session after the session ends.

If you chose DMX as a login option or modified your .xsession file to start your DMX session, you will return to the login screen after the DMX session ends.

To permanently disable DMX from starting upon login, reverse the DMX-related changes you made to your .xession file or delete (or rename) your $HOME/.xsession file. On Linux systems, simply select another default login option.

Running Applications with OpenGL Multipipe

Plain X applications will generally run under an X proxy layer without assistance. OpenGL (3D) applications need to use the OpenGL Multipipe 3D proxy library to handle 3D rendering correctly and efficiently on all screens.

To use the OpenGL Multipipe 3D proxy library with OpenGL applications, just run the program using the omprun script:

$ omprun app_name app_args

This will preload the OpenGL Multipipe proxy libraries to intercept OpenGL calls.

The following is an example:

$ omprun ivview /usr/share/data/models/Banana.iv


Note: The use of the omprun script is optional on Silicon Graphics Prism systems running the latest recommended operating system versions ( SGI ProPack 4 Service Pack 3 ). On these platforms, you can invoke the application in the normal fashion and the application will automatically utilize the full OpenGL Multipipe environment (master-slave 3D proxy layer) if the DMX proxy layer is detected. Later references to the use of the omprun script in this guide should be considered optional on these platforms, unless otherwise noted.

OpenGL Multipipe causes an OpenGL application to use the intermediate 3D proxy libraries instead of the normal OpenGL library. This enables the OpenGL application to behave correctly when its windows are moved across parts of the logical screen. Such an application is considered to be started in multipipe-unaware mode (or simply, unaware mode), since it is not aware of the underlying graphics hardware structure.

Technically, the omprun command sets LD_PRELOAD,the link editor environment variable, to use the libOMPmaster.so library of matching format prior to using the libGL.so library. When the omprun command is not used on systems where it is is optional, OpenGL Multipipe utilizes the X server's DRI extension, a mechanism in the libGL.so library, and a special SGIOMPdmx_dri.so module to intercept and route an application's OpenGL calls to the OpenGL Multipipe library libOMPmaster.so.

For more information on using omprun, see the omprun(1) man page or use the –help command-line option of omprun as follows:

$ omprun –help

The following sections describe run-time options and how to best run different types of graphics applications:

For more information on running applications with OpenGL Multipipe, see the release notes, /usr/share/omp/release_notes/user/relnotes.html.

Setting Run-Time Options

Even though the use of the omprun script is optional on Silicon Graphics Prism platforms, you may want to use the command to invoke the application to set run-time options, some of which can override configuration options set otherwise. The configuration options are described in section “Setting up the OpenGL Multipipe Environment”.

Table 3-2 shows the run-time options for omprun along with the related configuration resources. For more information about the various options, see the omprun(1) man page or use the –help command-line option of omprun.

Table 3-2. omprun Command-Line Options

omprun Option

Configuration Resource

Description

–cull

culling: on

Enable geometry culling.

–cullshow
bbox
stats
all

culling.showStat
bbox
stats
all

Show culling information.

–dlsplit

dlSplit: on

Enable display list spatialization.

–dlsplitmaxtris

dlsplit.maxTris

Set the display list spatialization threshold.

–dlsplitshow

dlsplit.showRandomColors: on

Show random colors.

–dmxglx

N/A

Use GLX instead of master and slaves.

–latency

maxFramesLatency

Set latency (how far ahead of the slaves the master works).

–minpixels

culling.minPixels

Set the small object culling threshold.

–mstrmode
render
track
off

masterMode
render
track
off

Set the master rendering mode.

–nodlopen

N/A

Disable dlopen/dlsym overriding.

–nosync

swapSyncMode: none

Disable all slave synchronization.

–novpclip

viewportClippingMode: off

Disable viewport clipping.

–pthread

N/A

Force the master to use the pthread API.

–swapready

swapSyncMode: barrier

Use hardware swap barrier.


Running OpenGL Single-Pipe Applications

OpenGL single-pipe applications are the targeted applications for OpenGL Multipipe. To run such applications, simply enable the OpenGL Multipipe environment and invoke the application using the omprun script.

Under DMX, OpenGL applications started without the omprun script will display correctly on all screens, using the GLX indirect rendering support in DMX. However, using the omprun script will provide better performance for OpenGL applications.

Hint: For an easy way to run a number of single-pipe OpenGL applications under OpenGL Multipipe without the need to always explicitly invoke omprun, start a command shell under omprun, as shown in the following :

$ omprun xterm
<omprun xterm>$ app_name app_args

Any application started from this new command shell will be started automatically in transparent multipipe mode.

Running Pure X Applications

As noted in Chapter 1, “OpenGL Multipipe Overview”, the X proxy layer enables pure X applications to run transparently over multiple pipes. To run pure X applications, simply enable DMX before invoking them and they will run correctly. You do not need to use the omprun script for these applications.

Running Multipipe Applications in Multipipe-Aware Mode

Multipipe applications are intentionally written to take advantage of systems that have multiple graphics pipes. If they know about the underlying graphics hardware, they can explicitly address and take advantage of the individual graphics pipes. Typically, multipipe applications are written using OpenGL Performer or OpenGL Multipipe SDK.

It is best not to run such applications under OpenGL Multipipe, which hides the hardware configuration of the system from the applications. To run at full potential, these applications should be aware of the different graphics pipes in the system. To allow such applications to see the real graphics hardware does not require you to disable OpenGL Multipipe.

The OpenGL Multipipe layer may be bypassed on a per-application basis. This allows a multipipe application to be fully aware of the multipipe environment while other applications, aware of only a single large pipe, continue to run under OpenGL Multipipe. Applications that bypass the OpenGL Multipipe layer are said to run in multipipe-aware mode (or simply, aware mode), because they are aware of the different graphics pipes handled by the X server.

To run a multipipe application in aware mode while other single-pipe applications run concurrently in unaware mode, set the DISPLAY environment variable to point to the desired backend display that is managed by the X proxy layer (for example, :0.1), and then start the multipipe application with the –aware command-line option of the omprun script, as in the following example:

$ setenv DISPLAY :0.0
$ omprun -aware perfly

Under DMX, it is especially important to set the DISPLAY environment variable because the DMX meta display has a completely different display name than its component backend displays. By default, the DMX display is :1 and the backend aware display is :0.

Hint: For an easy way to run a number of commands in aware mode, start a command shell in aware mode.

$ setenv DISPLAY :0.0
$ omprun -aware xterm
<aware xterm>$ app_name app_args

Any application started from this new command shell will be started automatically in aware mode.

Using SGI Scalable Graphics Hardware with OpenGL Multipipe

You may configure SGI Scalable Graphics Compositor hardware for use with OpenGL Multipipe to improve geometry and fill performance for an application. This requires no changes to the application. Using the following topics, this section describes how to configure DMX for this purpose as well as settings for OpenGL Multipipe to improve performance and usability in composited logical screen mode:

Configuring Composited Screens with DMX

To configure completely overlapped screens under DMX, simply create a DMX configuration file to manage the screens of the backend X server in the desired order. Do not specify an offset or a 0x0 offset after the screen specifications. The following is an example configuration file:

virtual totaloverlap 1280x1024 {
    display :0.0 1280x1024;
    display :0.1 1280x1024;
    display :0.2 1280x1024 @0x0; # “@0x0” is optional
    display :0.3 1280x1024;
}

For more information on DMX configuration files, see section “Creating DMX Configuration Files”.

Specifying Static Composited Regions with ompstartdmx

You can specify a static tiling mode for a hardware compositor during DMX startup. The ompstartdmx script will start both the hardware compositor and DMX with the specified tiling mode.

The –compositor option on the  ompstartdmx script allows you to specify the desired static tiling mode, as shown in the following example:

$ ompstartdmx -compositor mode

The following values are available for mode:

Mode 

Description

quad 

A quad tiling

vert2 

Two vertical stripes

vert3 

Three vertical stripes

vert4 

Four vertical stripes

horiz2 

Two horizontal stripes

horiz3 

Three horizontal stripes

horiz4 

Four horizontal stripes

You can also set up the video format using the –compositor option, as shown in the following entry:

$ ompstartdmx -compositor quad,1280x1024_75

The video format must be supported by both the hardware compositor and the pipes, and all pipes must have the same video format. Otherwise, ompstartdmx exits with an error. The default video format is the current one for the pipes.

Using Pixel Averaging Composition Mode for Full-Scene Antialiasing

You can set up the hardware compositor for pixel averaging during DMX startup. In pixel averaging mode, the following occurs:

  1. OpenGL Multipipe applies a different sub-pixel jittering offset for each pipe's frustum.

  2. The hardware compositor averages the pixel values.

  3. The resulting image on the compositor output is antialiased.

The hardware compositor can be configured for pixel averaging mode with either two or four input pipes. For proper operation, configure all pipes connected to the compositor to be fully overlapped.


Note: When using two pipes, connect them to compositor channels 0 and 2, not 0 and 1.

If you are starting a session with only one compositor attached, then the simplest way to use pixel averaging is to use the -compositor option on the ompstartdmx script, as follows:

$ ompstartdmx -compositor {aa2 | aa4}

This command entry sets up a DMX configuration file with full overlap for two or four pipes and configures the compositor and OpenGL Multipipe for pixel averaging.

If you are using more than one compositor or you are use your own DMX configuration file, you must use a compositor configuration file, described in the “Using Multiple Compositors” section in the release notes.

You can configure the jittering offset values per application using the following X resources:

  • OMP*aa2Jitter.X and OMP*aa2Jitter.Y (for two-pipe pixel averaging)

  • OMP*aa4jitter.X and OMP*aa4Jitter.Y (for four-pipe pixel averaging)

For more information on the resources, see section “Resource Descriptions”.

Using Time-Based Compositing

You can set up an OpenGL Multipipe session in time-based composition mode. In that mode, either two or four pipes can be connected to each compositor. This allows two or four different rendering slaves to render two or four different frames in parallel. The hardware compositor will be configured to display one pipe at a time in a round-robin fashion. All frames will be seen on the compositor output while each rendering slave renders only every fourth or second frame depending on whether two or four pipes are attached to each compositor. In theory, this approach might scale the rendering performance by a factor of 4 (for the 4-pipe case). However, the following conditions should be met in order to get that performance improvement:

  • Trivially, the application must be graphics-bounded (rather than host-bounded). Otherwise, scaling the rendering performance would not get any better overall performance. Usually, immediate mode applications tend to be host-bounded. Applications that draw static geometry in retained mode (for example, using display lists or vertex buffer objects) are more likely to scale.

  • The application must use doubly buffered windows. Switching between one pipe to the next is done at the end of each frame when the application is calling glXSwapBuffers(). Singly buffered applications may run inside an OpenGL Multipipe session with time-based compositing but would not gain any performance improvement.

  • The application should allow at least four (or two in a two-pipe configuration) frames of latency between the application and the visible compositor output. This minimum is required in order to render more than one frame in parallel. The maximum allowed frame latency can be controlled with the OMP* maxFrameLatency resource. Its default value is 4, which is acceptable for time-based decomposition. However, setting this value to be lower will affect the rendering parallelism and, hence, performance.

Some operations causes OpenGL Multipipe to synchronize the application with the rendering slaves, which zero out any possible latency between the application and rendering slaves. Consequently, the application needs to be free of operations where synchronization will occur under the following conditions:

  • When the application is calling glFinish()

  • When the application is calling glXWaitGL()

  • When the application is calling glXQueryDrawable()

  • When the application is doing a glGet*() operation while the OpenGL Multipipe master mode is off (the default mode when not using the omprun command) and the specific queried OpenGL state is not being tracked by the OpenGL Multipipe internal state tracker

  • When the application is calling glReadPixels()

  • When switching between two different GLX contexts

If you are starting a session with only one compositor attached, then the simplest way to use time-based decomposition is to use the -compositor option on the  ompstartdmx command as follows:

$ ompstartdmx -compositor {time2 | time4}

This command sets up a suitable DMX configuration file and starts an OpenGL Multipipe time-based composition session using the first 2 or 4 pipes connected to the compositor attached to hyperpipe network 0 in the system.

If you are using more than on compositor or need to use your own DMX configuration file, you must use a compositor configuration file, described in the “Using Multiple Compositors” section in the release notes.

After the OpenGL Multipipe session has been initialized, every doubly buffered OpenGL application running in the session will be joined to the time-based composition group. All such applications will share the same swap group. This means that all such applications will need to swap at the same time. When one application reaches the glXSwapBuffers() point, it will wait for all the other applications to reach their swap point before proceeding with the swap request. The result is that one application might block the another.

It is possible to run a doubly buffered OpenGL application under this session without being attached to the time-based composition group by running the application with omprun -novpclip app_name or by setting the OMP* viewportClippingMode resource value for that application to none. In this case, the application will not join the swap group and will not block other applications but will not gain any better performance either. The same applies for any singly buffered applications.

Applications attached to the time-based composition group will be forced to synchronize on vertical sync. Therefore, the maximum expected frame rate cannot be higher than the monitor refresh rate.

Using Multiple Compositors in an OpenGL Multipipe Session

OpenGL Multipipe allows you to configure multiple compositors by specifing a special compositor configuration file with the -compositor option for the ompstartdmx command, as shown in the following:

$ ompstartdmx -compositor config-file

The compositor configuration file config-file describes the desired mode of operation for each compositor in the session. The format and use of the configuration file is described in the “Using Multiple Compositors” section in the release notes.

Enabling Duplicate Cursor Images in Overlap Regions

When an X proxy layer is used to overlap screen regions on an edge-blended display or a compositor-based system, the cursor will seem to disappear when it enters the overlapped or uncomposited regions of the display. In X, a mouse belongs to one screen of the X server at a time. Therefore, it is normally not possible to draw the mouse multiple times (on different screens) in the overlap region.

To prevent the cursor from disappearing in these cases, you need to create additional or duplicate cursor images (not real cursors) where two or more screens overlap. There is still just one real cursor position on the display.

There are two ways to enable duplicate cursors under DMX:

  • Managing an appropriate subarea of each composited input pipe instead of the whole screen area

  • Managing multiple backend X servers

Managing Screen Subregions with DMX

You can use a DMX configuration file to cause DMX to manage less than a whole backend screen. When the subregions of each screen are visually assembled using a congruent static compositor tiling, the resulting logical screen will look and behave identically to the DMX displays with fully overlapping screens described previously. The following configuration file entry illustrates this feature:

virtual quadtilesubregions 1280x1024 {
    display :0.0 640x512+0+0     @0x0;
    display :0.1 640x512+640+0   @640x0;
    display :0.2 640x512+0+512   @0x512;
    display :0.3 640x512+640+512 @640x512;
}

Managing Multiple Backend X Servers with DMX

The X mouse cursor can be made visible in the partially or fully overlapped screen regions needed for edge-blended or composited displays. As long as the logically overlapping areas of the DMX display are composed by screens of different backend X servers, DMX can utilize the mouse cursor that is available on each backend X server.

Instead of having DMX manage multiple screens of a single backend X server, you can start multiple backend X servers and specify a DMX configuration that logically overlaps areas from different backend X servers, as shown in the following:

virtual totaloverlapmulti 1280x1024 {
   display :0.0 1280x1024;
   display :1.0 1280x1024;
   display :2.0 1280x1024;
   display :3.0 1280x1024;
}


Note: The multiserver technique can be combined with the technique of managing screen subregions to create a logical display on which mouse cursors are visible in all overlapped and composited regions.


Managing Windows for Aware Applications

To allow window manager support for applications started in aware mode, OpenGL Multipipe provides aware window management. A window manager wrapper is provided that is much like omprun for GL applications.

When the window manager wrapper is not used, applications started in aware mode (using omprunaware app_name) will bypass the window manager. This means that their windows cannot be moved, resized, iconified, or otherwise managed. This includes the regular decoration provided by the window manager. The windows will not have this decoration. This occurs because an unaware window manager does not know about all of the real screens that the X proxy layer is managing. It cannot manage aware windows that were not created through X proxy layer.

If you invoke ompstartdmx with the standard arguments (or if DMX is configured to start automatically when you log in), a window manager of your choice will be automatically started with the window manager wrapper so that it is able to manage aware windows. You can change the DMX default window manger by using the ompstartdmxwm option. You may follow the steps in the following subsections if you want to run a different window manager to manage aware windows.

This section describes the following topics:

Starting an Aware Window Manager

To start an aware window manager, perform the following steps:

  1. Exit or kill any unaware window manager that is currently managing the display.

    If possible, exit your window manager without logging out. One way to do this is to find the process number for your window manager and kill it manually, as the following illustrates:

    $ ps -e | grep my_window_manager
    23878 ? 0:42 my_window_manager
    $ kill 23878
    

    Some window managers may not allow you to exit the window manager and remain logged in. If this is the case, you will need to start the aware window manager from a .xsession file. See the section “Setting an Aware Window Manager as the Default” for more information.

  2. Start the specialized window manager.

    Enter the following:

    $ ompwrapwm twm
    

The ompwrapwm script starts the window manager twm in aware window management mode under DMX. If the display server is determined to be compatible, the script starts the window manager with aware window management support enabled. If the display server is not compatible, the script will exit. The script can be made to start the window manager in unaware mode (with aware window management disabled) as a contingency.

For more information on using the ompwrapwm script, see its man page or use the -help command-line option of the script as follows:

$ ompwrapwm -help

Notes:

  • You can use any window manager with the ompwrapwm script. KDE is the recommended window manager.

  • Starting an application in aware mode and then starting the window manager will result in the application's windows being unmanaged by the aware window manager. An aware window manager must be started prior to running an application in aware mode in order for its windows to be managed.

Exiting an Aware Window Manager

To exit an aware window manager, simply log out and log back in. The default window manager will again manage your display.

Setting an Aware Window Manager as the Default

An alternate way to run an aware window manager is to invoke the ompwrapwm  my_window_mgr script in your $HOME/.xsession file. You must set up a default aware window manager under DMX. See section “Initializing DMX”.