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.
Steps to check 3D acceleration in Linux:
- Open a terminal in the desktop session that needs to be tested.
If glxinfo returns Error: unable to open display, the commands are not running inside an active graphical session.
- Install the package that provides glxinfo and glxgears.
$ sudo apt install mesa-utils
This verified path uses Ubuntu 24.04, where mesa-utils installs both commands.
- Run glxinfo -B to show the current renderer and acceleration state.
$ 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.2This verified example comes from an accelerated Ubuntu 24.04 guest. Physical hardware usually shows the installed AMD, Intel, or NVIDIA renderer instead.
- Treat the session as accelerated only when direct rendering is Yes, Accelerated is yes, and the renderer names a real or virtual GPU instead of llvmpipe or another software rasterizer.
On Wayland desktops, glxinfo -B is checking the current Xwayland GLX path rather than every graphics API on the system.
- Start glxgears from the same terminal and wait for at least one frame-rate sample.
$ 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.
- Stop glxgears after the gears window animates smoothly and the terminal prints a sample.
Press Ctrl+C in the terminal to exit.
- Confirm 3D acceleration from the combined result.
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.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
