What's This Thing Called "Viewperf"?


Viewperf is a portable OpenGL performance benchmark program written in C. It was developed by IBM. Later updates and significant contributions were made by SGI, Digital and other OPC project group members. Viewperf provides a vast amount of flexibility in benchmarking OpenGL performance. Currently, the program runs on most implementations of UNIX, Windows NT, Windows95, and OS/2.

The OpenGL Performance Characterization (OPC) project group has endorsed Viewperf as its first OpenGL benchmark. Performance numbers based on Viewperf were first published in the Q4 1994 issue of The GPC Quarterly.

OPC group member companies have ported the Viewperf code to their operating systems and window environments. The OPC project group maintains a single source code version of the Viewperf code that is available to the public.

Benchmarking with Viewperf

Viewperf parses command lines and data files, sets the rendering state, and converts data sets to a format that can be traversed using OpenGL rendering calls. It renders the data set for a pre-specified amount of time or number of frames with animation between frames. Finally, it outputs the results.

Viewperf reports performance in frames per second. Other information about the system under test -- all the rendering states, the time to build display lists (if applicable), and the data set used -- are also output in a standardized report.

A "benchmark" using Viewperf is really a single invocation of Viewperf with command-line options telling the Viewperf program which data set to read in, which texture file to use, what OpenGL primitive to use to render the data set, which attributes to apply and how frequently, whether or not to use display lists, and so on. One quickly realizes that there are an infinite number of Viewperf "benchmarks" (an infinite number of data sets multiplied by an almost infinite number of command-line states).

Real-World Benchmarking

OPC project group members recognize the importance of real-world benchmarks. From the beginning, the group has sought benchmarks representative of the OpenGL rendering portion of independent software vendor (ISV) applications. Along these lines, the project group has come up with what it calls a viewset. A viewset is a group of individual runs of Viewperf that attempt to characterize the graphics rendering portion of an ISV's application.

Viewsets are not developed by the OPC project group; they come from the ISVs themselves. Members of the OPC project group often "sponsor" the ISV. Sponsorship entails helping the ISV in several areas, including how to obtain the Viewperf code, how to convert data sets to a Viewperf format, how to use Viewperf, how to create Viewperf tests to characterize the application, how to determine weights for each of the individual Viewperf tests based on application usage, and finally to help offer the viewset to the OPC project group for consideration as a standard OPC viewset. Any ISV wishing to develop a viewset should contact an OPC representative listed on the GPC Organization page.

Currently, there are five standard OPC viewsets: Parametric Technology's CDRS, which contains seven different Viewperf tests, is a modeling and rendering application for computer-aided industrial design. IBM's Data Explorer (DX), which has 10 different tests, is a visualization application. Intergraph's DesignReview (DRV), which has 10 different tests, is a 3D computer model review package. Alias/Wavefront's Advanced Visualizer, with 10 tests, is an animation application. And Lightscape Technology's Lightscape Visualization System, with 4 tests, is a radiosity visualization application. All five viewsets represent relatively high-end applications. These type of applications typically render large data sets. They almost always include lighting, smooth shading, blending, line antialiasing, z-buffering, and some texture mapping.

The input to Viewperf is the command line. Here are the current command line options for Viewperf 5.0:

Program options:

-polygon -pg   <file>  : Viewpoint object to be used in the tests
-triangle -tr  <file>  : Viewpoint object to be used in the tests
-quad -qd      <file>  : Viewpoint object to be used in the tests
-mesh -mh      <file>  : Mesh object to be used in the tests
-rendermode -rm <mode> : POINT, VECTOR, LINE, POLYGON, TMESH, TFAN,
                         TRIANGLE, or QUAD - default LINE
-vcriteria -vcrit      : AUX Visual selection criteria - EXACT, MIN
                         - default MIN
-vid <id>              : Ask AUX for visual with ID = <id>
-vaccum -vac           : Ask AUX for an accumulation buffer visual
-valpha -val           : Ask AUX for an alpha buffer visual
-vdepthbuffer -vz      : Ask AUX for a depth buffer visual
-vstencil -vst         : Ask AUX for a stencil buffer visual
-indirectrender -ir    : Render indirect - default direct
-nodither -ndi         : Disable dithering
-ortho -or             : Parallel/Orthographic projection - default Perspective
-displaylist -dl       : Render with display list mode
-colorper -cp  <mode>  : FRAME = Color per Frame,
                       : PRIMITIVE = Color per Primitive,
                       : VERTEX = Color per Vertex - default FRAME
-texture -tx   <file>  : MTV image for texturing
-texgen -txg <file> <mode> : <file> is MTV image for environment mapping
                         <mode> is SPHERE_MAP, OBJECT_LINEAR, EYE_LINEAR
                         - default EYE_LINEAR
-magfilter -magf <flt> : NEAREST, LINEAR - default NEAREST
-minfilter -minf <flt> : NEAREST, LINEAR, NEAREST_MIPMAP_NEAREST,
                         LINEAR_MIPMAP_NEAREST, NEAREST_MIPMAP_LINEAR,
                         LINEAR_MIPMAP_LINEAR - default NEAREST
-texenv -te <env>      : Texture environment, MODULATE, DECAL, BLEND
                         - default DECAL
-texcomp -tc <num>     : Texture components where <num> is 1,2,3, or 4
                       : -default 3
-blend -bl             : Enable Blending
-srcblendfunc -sbf     : ZERO, ONE, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA,
                         ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA,
                         SRC_ALPHA_SATURATE - default SRC_ALPHA
-dstblendfunc -dbf     : ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, SRC_ALPHA,
                         ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA,
                         - default ONE_MINUS_SRC_ALPHA
-linewidth -lw <width> : Linewidth for wire/vector tests - default 1.0
-xwinsize -xws <side>  : Size of test windows X dimension - default 700
-ywinsize -yws <side>  : Size of test windows Y dimension - default 700
-numframes -nf <num>   : Number of frames to be rendered during measurement
                         Takes priority over -mp
-numilights -nil <num> : Turns on <num> infinite lights - default 0
-numllights -nll <num> : Turns on <num> local lights - default 0
-colormaterial -cm <side> <mode> :
                         <side> is FRONT, BACK, FRONT_AND_BACK - default FRONT
                         <mode> is AMBIENT, DIFFUSE, EMISSION, SPECULAR,
                         AMBIENT_AND_DIFFUSE - default AMBIENT_AND_DIFFUSE
-backface -bf          : Cull Backfacing primitives - default off
-frontface -ff         : Cull Frontfacing primitives - default off
-singlebuffer -sb      : Single buffer mode
-fog -fg               : Enable fog
-linesmooth -ls        : Enable line antialiasing
-polysmooth -ps        : Enable polygon antialiasing
-facetnormal -fn       : Use facet normals when lighting
-linestipple -lp       : Enable line stipple
-polystipple -pp       : Enable polygon stipple
-toggle -tg <cap>      : Toggle per primitive - BLEND, DEPTH_TEST, DITHER,
                         LIGHTING, LINE_WIDTH, LINE_STIPPLE, POLYGON_STIPPLE,
                         or MATRIX - multmatrix
-batch -bt <num>       : Batch <num> primitives together per glBegin/glEnd
                         Valid with POINT, VECTOR, TRIANGLE, and QUADS
-polymodefront -pmf    : POINT, LINE, or FILL - default FILL
-polymodeback  -pmb    : POINT, LINE, or FILL - default FILL
-flat -f               : Set shademodel to FLAT - default GOURAUD
-zbuffer -zb           : Enable zbuffer for tests - default off
-clip -c               : Align object on 3D clip boundary
-lighttwoside -l2s     : Light both sides of model
-localview -lv         : Define local viewer for lit tests
-minperiod -mp <num>   : Set minimum testing period in seconds
-mblur <num>           : Use motion blur with num being amount of decay
-aa_multi <x> <r>      : Full scene antialiasing rendered x times at an
                       : offset of r.  r should be tuned to the viewset
-walkthru -wt          : Walkthru mode
-threads -th <num>     : Sets number of threads (no arg means 1 per processor)

The -threads option is applicable only if Viewperf has been compiled with the C Preprocessor variable MP defined. Viewperf should only be compiled this way if the vendor supplied makefile has defined the MP flag (-DMP).

Here is an example of the command line from test #3 of the CDRS-03 viewset:
viewperf -mh mower-ts -dl -rm TMESH -vz -bl -zb -nil 1 -cp PRIMITIVE -mp 10 -nf 10

This command line is providing the following directions:

The following significant defaults are in effect during this test: direct rendering, perspective viewing, no texture mapping, window size is 700 x 700 pixels, no culling, double buffering, smooth shading, no clipping, and single-sided lighting.

Upon entering the command line, the system under test will run the benchmark for at least 10 seconds or 10 frames. This is to insure a valid test result. During the test, the Viewperf code renders the data set, mower-ts.msh, which is half of the shell of a lawnmower, rotating it about the center of the window with the above specified characteristics.

What follows is the output of Viewperf when this test, CDRS-03 Test #3, is run on an IBM RISC System/6000 Model 43P-140 with the GXT800PT graphics option.

    Viewperf Version                                   5.0
    Viewperf Arguments                                 -mh mower-ts -dl -rm TMESH -vz -bl -zb -nil 1 -cp PRIMITIVE -mp 10 
    Month                                              12
    Day                                                12
    Year                                               1996
    Host                                               mayhem
    Operating System                                   AIX
    Operating System Version                           4.1
    Host Vendor                                        IBM
    Host Model                                         unknown (CPU_id=0X4C)
    Host CPU                                           PowerPC 604
    Host CPU Count                                     1
    Host Memory Size (MB)                              256
    Host Primary Cache Size (KB)                       32/32 (D/I)
    Host Secondary Cache Size (KB)                     1024
    Window System                                      X Window System V11
    Driver Version                                     NA
    OpenGL Vendor                                      IBM
    OpenGL Version                                     1.0.0
    OpenGL Extensions                                  GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_rescale_normal GL_EXT_abgr GL_EXT_blend_logic_op GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_polygon_offset GL_EXT_subtexture GL_EXT_texture3D
    OpenGL Renderer                                    GXT800 Texture
    OpenGL Client Vendor                               IBM
    OpenGL Client Version                              1.1
    OpenGL Client Extensions                           GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context 
    GLU Version                                        1.2.1 AIX
    GLU Extensions                                     
    Direct Rendering                                   False
    Double Buffer                                      True
    Stereo                                             False
    RGBA                                               True
    Color Index Size                                   -1
    Red Size                                           8
    Green Size                                         8
    Blue Size                                          8
    Alpha Size                                         8
    Accum Red Size                                     0
    Accum Green Size                                   0
    Accum Blue Size                                    0
    Accum Alpha Size                                   0
    Depth Size                                         24
    Stencil Size                                       4
    Auxiliary Buffer Count                             0
    Frame BufferLevel                                  0
    Visual ID                                          0X28
    Visual Class                                       TrueColor
    Window Width (pixels)                              700
    Window Height (pixels)                             700
    Screen Width (pixels)                              1280
    Screen Height (pixels)                             1024
    Display                                            :0.0
    OpenGL Server Vendor                               IBM
    OpenGL Server Version                              1.1
    OpenGL Server Extensions                           GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context 
    GLX Server Version                                 1.1
    GLX Server Extensions                              GLX_EXT_visual_info GLX_EXT_visual_rating GLX_EXT_import_context 
    Screen Number                                      0
    Shared Memory Connection                           True
    Visual Selection Criteria                          MINIMUM
    Number of Execution Threads                        1
    Geometry File                                      ./mower-ts
    Input Mode                                         -mh 
    Minimum Test Period                                10.000000
    Number of Frames                                   0
    Number of Primitives                               71
    Number of Vertices per Frame                       31380
    Number of Vertices per Primitive                   441.971831
    Toggle Mode                                        NONE
    Batching Count                                     0
    Render Mode                                        TMESH
    Color per                                          COLOR_PER_PRIMITIVE
    Orthographic Projection                            FALSE
    Display List                                       TRUE
    Clip Geometry                                      FALSE
    Walkthrough Mode                                   FALSE
    Back Face Cull                                     FALSE
    Front Face Cull                                    FALSE
    Front Polygon Mode                                 FILL
    Back Polygon Mode                                  FILL
    Polygon Stipple Enable                             FALSE
    Polygon Antialiasing Enable                        FALSE
    Line Width                                         1.000000
    Line Stipple Enable                                FALSE
    Line Antialiasing Enable                           FALSE
    Number of Infinite Lights                          1
    Number of Local Lights                             0
    Color Material Enable                              TRUE
    Color Material Face                                FRONT
    Color Material Mode                                AMBIENT_AND_DIFFUSE
    Facet Normals                                      FALSE
    Two Sided Lighting Enable                          FALSE
    Local Viewer Enable                                FALSE
    Flat Shading                                       FALSE
    Fog Enable                                         FALSE
    Texture Enable                                     FALSE
    Texture Generation Mode                            NO_TEXTURE_GENERATION
    Texture File                                       NONE
    Texture Minification Filter                        NEAREST
    Texture Magnification Filter                       NEAREST
    Texture Environment Mode                           DECAL
    Texture Components                                 3
    Depth Test Enable                                  TRUE
    Blend Enable                                       TRUE
    Source Blend Function                              SRC_ALPHA
    Destination Blend Function                         ONE_MINUS_SRC_ALPHA
    Dithering Enable                                   TRUE
    Motion Blur Amount                                 0.000000
    Full Scene Antialiasing Redraws                    0
    Full Scene Antialiasing Jitter Amount              0.000000
   0.140	sec (DL Build)	--	-mh mower-ts -rm TMESH -cp PRIMITIVE -dl -zb -nil 1 -bl -vz 

		Number of frames run: 174, Test period: 9.980000 (sec)
    17.4	frames/sec	--	-mh mower-ts -rm TMESH -cp PRIMITIVE -dl -zb -nil 1 -bl -vz 
=============================================================

The output provides all the Viewperf state information, as well as the configuration parameters for the system under test. The display list build time was 0.14 seconds, the number of frames was bumped up to 174 frames, and the actual test time was 9.98 seconds.

Viewperf does a test to see how many frames need to be rendered to meet the minimum time period. In this case, the calibration calculates the number of frames necessary to meet the minimum, bumps up the number of frames if the minimum is not met, then reruns the test.

The last line is the number of frames per second, which is the fundamental metric for each test. This is the result that is printed in the summary and individual report pages within the GPC News OPC section. Also printed in the summary and individual report pages is a single composite number for each viewset. This composite number is derived using a weighted geometric mean methodology.

Rob Putney is an advisory programmer in IBM's RS/6000 Division in Austin, Texas. He can be reached by phone at 512-838-3639 or by e-mail to: rputney@vnet.ibm.com.

[GPC Home] [OPC Project] [PLB Project] [XPC Project]