LinuxCommandLibrary

glxheads

Run OpenGL application across multiple displays

SYNOPSIS

glxheads [-display display]

PARAMETERS

-display display
    Specify X display name (e.g., :0); defaults to $DISPLAY

DESCRIPTION

glxheads is a diagnostic utility from the Mesa 3D graphics library that queries the X Window System server for all available GLX heads. GLX (GLX Extension to the X Window System) heads represent physical display outputs (like monitors or projectors) capable of hardware-accelerated OpenGL rendering.

This command is essential for developers and users troubleshooting multi-head (multi-monitor) setups, verifying direct rendering infrastructure (DRI) support per display, or scripting OpenGL applications to bind to specific heads. It outputs a simple list of heads, each with an index, associated screen, and capability flags (e.g., 0x20 indicating overlay support).

Typical use case: Run on a system with NVIDIA Optimus or multi-GPU to confirm which displays support GLX acceleration. Requires a running X server with GLX extension loaded, provided by open-source Mesa drivers or proprietary ones like NVIDIA/AMD.

The tool is lightweight, non-interactive, and outputs to stdout, making it ideal for parsing in scripts.

CAVEATS

X11-only; fails on Wayland without XWayland. Needs GLX extension and DRI drivers for full info. Root not required.

SAMPLE OUTPUT

HEAD 0 0x20 0
HEAD 1 0x20 1
(Head index, flags, screen)

HISTORY

Part of Mesa Demos since ~2004 (Mesa 6.0+); maintained for X11 OpenGL diagnostics as GLX fades with Vulkan.

SEE ALSO

Copied to clipboard