LinuxCommandLibrary

glxgears

Benchmark OpenGL performance; display rotating gears

TLDR

Run an OpenGL test window

$ glxgears
copy

Display OpenGL renderer information
$ glxgears -info
copy

Display help
$ glxgears -h
copy

SYNOPSIS

glxgears [-auto] [-display display] [-fullscreen] [-geometry geom] [-info] [-windowid id]

PARAMETERS

-auto
    Automatically exit after rendering 100 frames

-display display
    Connect to the specified X display (e.g., ":0")

-fullscreen
    Run in fullscreen mode

-geometry geom
    Set initial window position and size (e.g., "300x300+0+0")

-info
    Print detailed OpenGL renderer, version, and extension info

-windowid id
    Embed rendering into an existing X window ID

DESCRIPTION

glxgears is a lightweight OpenGL demonstration and test program bundled with the Mesa 3D graphics library on Linux systems. It renders three colorful, intermeshed gears rotating at different speeds within an X11 window using the GLX (OpenGL Extension to the X Window System) interface.

Primarily used to verify basic 3D acceleration and OpenGL support, it displays real-time frame rate (FPS) statistics in the terminal, making it a quick diagnostic tool for graphics drivers. By default, it runs indefinitely until manually stopped with Ctrl+C, but options like -auto allow it to exit after 100 frames for scripted testing.

Though popular for benchmarking GPU performance in early hardware eras, modern usage focuses on functionality checks rather than precise metrics, as it's often CPU-bound and doesn't fully utilize contemporary GPU capabilities. It supports standard X11 visuals and can run fullscreen or in existing windows.

CAVEATS

Not a rigorous benchmark; CPU-limited on fast GPUs, fill-rate bound at low resolutions. FPS varies with window size and system load. Requires working X11 and GLX support.

TYPICAL USAGE

glxgears # Basic test, reports FPS
glxgears -fullscreen -auto # Quick fullscreen benchmark

FPS INTERPRETATION

Expect 1000+ FPS on accelerated hardware; low values (<60) indicate software rendering or driver issues.

HISTORY

Developed as part of Mesa3D demos around 2000 by the Mesa team (e.g., Brian Paul). Evolved with OpenGL standards; remains in mesa-demos package for GLX testing on X11.

SEE ALSO

Copied to clipboard