How to test if my video card has 3D support?

Solution 1:

This is a topic with a lot of bad/outdated/incorrect information available.

Things which don't work:

  • Checking for "direct rendering: Yes":
    This isn't an accurate indicator. The software renderer also supports direct rendering, so even if you don't have hardware 3D support you can have direct rendering: Yes
  • Checking the FPS of glxgears:
    This isn't an accurate indicator either. Recent versions of Ubuntu will have vsync enabled, so glxgears will only run as fast as the screen refresh rate. This means glxgears will almost always print an FPS of 60 or thereabouts.

What does work:

The output of glxinfo contains the information we want.

name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
… snip …
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset
OpenGL version string: 2.1 Mesa 7.10.1
OpenGL shading language version string: 1.20
OpenGL extensions:
… snip long extensions list…

The OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset line indicates that I'm using my Intel GM45 chip to do 3D rendering.

OpenGL version string: 2.1 Mesa 7.10.1 indicates the baseline OpenGL version that this driver/hardware supports (OpenGL 2.1) and the version of Mesa being used (7.10.1).

Finally, direct rendering: Yes on top of the previous two fields indicates that the driver is working properly with a direct rendering context. This will never be No unless something is really messed up with your install (or you're doing something strange, like connecting to a remote X server).

Examples of bad glxinfo output:

LIBGL_ALWAYS_SOFTWARE=1 glxinfo
name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap,
    GLX_INTEL_swap_event
GLX version: 1.4
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_INTEL_swap_event
OpenGL vendor string: Mesa Project
OpenGL renderer string: Software Rasterizer
OpenGL version string: 2.1 Mesa 7.10.1
OpenGL shading language version string: 1.20
OpenGL extensions:
    GL_ARB_copy_buffer, GL_ARB_depth_clamp, GL_ARB_depth_texture,

Here we've got no hardware acceleration, so the Software Rasterizer is providing (slow!) 3D support.

 LIBGL_DRIVERS_PATH=foo glxinfo
name of display: :0
display: :0  screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control,
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap,
    GLX_INTEL_swap_event
GLX version: 1.4
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control,
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap,
    GLX_INTEL_swap_event
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset
OpenGL version string: 1.4 (2.1 Mesa 7.10.1)
OpenGL extensions:
    GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_fragment_program,
    GL_ARB_fragment_program_shadow, GL_ARB_multisample, GL_ARB_multitexture,

Here we've broken direct rendering by pointing LIBGL at a non-existent DRIVERS_PATH. The direct rendering pathway fails:

direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)

But indirect rendering is still working, because the display server has loaded the driver

OpenGL renderer string: Mesa DRI Mobile Intel® GM45 Express Chipset
OpenGL version string: 1.4 (2.1 Mesa 7.10.1)

(Note that the OpenGL version advertised is now OpenGL 1.4 - this is the newest OpenGL version for which there is an indirect rendering protocol).