Checking 3D acceleration in Linux confirms whether the current desktop session is drawing OpenGL through a GPU or virtual GPU instead of falling back to software rendering on the CPU. That is a decisive first check when desktop effects stutter, graphical applications feel slow, or a virtual machine is expected to have accelerated graphics.
Desktop OpenGL rendering is exposed through GLX on X11 and through Xwayland on many Wayland desktops. The glxinfo -B summary reports the active renderer, direct-rendering state, and whether the current GLX path is accelerated, while glxgears opens a simple animated window in that same session so the rendering path can be confirmed visually.
This verified flow uses Ubuntu 24.04 with the GNOME desktop. Run it from the local logged-in graphical session, not from a text console or a headless SSH shell, because both commands need access to the active display server. A renderer such as llvmpipe, softpipe, or Software Rasterizer indicates software rendering even if a test window still opens.
If glxinfo returns Error: unable to open display, the commands are not running inside an active graphical session.
$ sudo apt install mesa-utils
This verified path uses Ubuntu 24.04, where mesa-utils installs both commands.
$ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Mesa (0x1af4)
Device: virgl (Apple M1 Max (Compat)) (0x1010)
Version: 25.0.7
Accelerated: yes
##### snipped #####
OpenGL renderer string: virgl (Apple M1 Max (Compat))
OpenGL core profile version string: 4.0 (Core Profile) Mesa 25.0.7-0ubuntu0.24.04.2
This verified example comes from an accelerated Ubuntu 24.04 guest. Physical hardware usually shows the installed AMD, Intel, or NVIDIA renderer instead.
On Wayland desktops, glxinfo -B is checking the current Xwayland GLX path rather than every graphics API on the system.
$ glxgears Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate. 877 frames in 5.0 seconds = 175.371 FPS
glxgears is a sanity check, not a benchmark. Frame-rate numbers vary with vertical sync, display settings, and virtualization.
Press Ctrl+C in the terminal to exit.
A working result shows an accelerated renderer in glxinfo -B and a live glxgears window in the same desktop session. If either check fails, the current desktop OpenGL path is not fully accelerated.