Previous Section  < Day Day Up >  Next Section

Recipe 15.5. Enabling 3D Hardware Acceleration with XFree86/DRI

15.5.1 Problem

You want to play Tux Racer, TuxKart, or Quake 3, or do some 3D modeling, CAD, or other high-end video work. You have a supported card and you've installed the drivers, but you're still stuck in 2D.

15.5.2 Solution

Making 3D hardware video acceleration work correctly requires having a supported video adapter and editing XF86Config to load the appropriate kernel modules.

First, see if the DRI extension is working:

$ glxinfo | grep rendering

Xlib: extension "XFree86-DRI" missing on display ".0.0".

direct rendering: no

It is not, so the next step is to enter the following lines in XF86Config:

Section "Module"

...

  Load "dri"

  Load "glx"

...

EndSection

...

Section "dri"

  Mode 0666

EndSection

Save your changes and restart X.

Test the new configuration by running glxgears, or by playing Tux Racer, TuxKart, or any game that requires hardware acceleration. Or you can run glxinfo again. Look for these lines:

$ glxinfo

direct rendering:..yes

...

OpenGL vendor string: VA Linux Systems, Inc.

OpenGL renderer string: Mesa DRI 20020221 Voodoo3 x86/MMX/3DNow!

OpenGL version string: 1.2 Mesa 4.0.4

...

This shows that hardware acceleration is working, because it names your hardware. If it were not, it would say this:

OpenGL vendor string: VA Linux Systems, Inc.

OpenGL renderer string: Mesa GLX Indirect

OpenGL version string: 1.2 Mesa 4.0.4

Most times, editing XF86Config this way cures the problem. If it doesn't, go to the next recipe for troubleshooting tips.

15.5.3 Discussion

Remember that your XF86Config file can be in a number of locations, depending on your distribution:

/etc/X11/XF86Config-4
/etc/XF86Config
/usr/X11R6/etc/X11/XF86Config-4
/usr/X11R6/etc/X11/XF86Config

XFree86, starting with Version 4.0, comes with DRI and the Mesa libraries built in, so you don't have to install any additional packages. Check your version:

$ XFree86 -version

XFree86 Version 4.3.0 (Debian 4.3.0-0ds2 20030304042836 dstone@aedificator)

Release Date: 27 February 2003

X Protocol Version 11, Revision 0, Release 6.6

Build Operating System: Linux 2.4.21-pre5 i686 [ELF]

Build Date: 04 March 2003

   Before reporting problems, check http://www.XFree86.Org/        

to make sure that you have the latest version.

Module Loader present

OS Kernel: Linux version 2.4.21 (root@galaxy) (gcc version 3.2.3 20030316 

(Debian prerelease)) #1 Sun Aug 3 20:15:59 PDT 2003

If you're using XFree86 3.x, you really need to update. It's not worth trying to add DRI and the Mesa libraries to Version 3; it's better to upgrade the whole works.

15.5.4 See Also

  • XF86Config(7)

  • The DRI User Guide (http://xfree.org/)

  • The Resources page at http://xfree.org/, for documentation for your version of XFree86 and for hardware-specific information, including drivers and configurations

    Previous Section  < Day Day Up >  Next Section