Configuring XFree86 for acceleration using DRI

Configuring XFree86 for acceleration using Direct Rendering Infrastructure (DRI)

Ooohh… So you have one of those state of the art Radeons fitted into your system, and your hands are twitching to get to that mouse and kick up your favourite game in Linux right? But wasn’t gaming on Linux supposed to be the sacred right of only those who possess NVidia cards? Guess what? The DRI team thinks otherwise. Read on to know what it takes to get graphic acceleration up and running with this wonderful addition to the experience of using X.

XFree86 Release 4 included the long-awaited integration of the DRI (Direct Rendering Infrastructure). This upgrade into the code base gives XFree86 the abilities of accelerated direct 3-D graphics rendering, used widely in games and other visualization programs.

As opposed to the NVidia unified driver set, these drivers are open source and hence built into the kernel. As a result, u dont have the headache of reinstalling the driver for every single kernel update on your system. Now aint that kool ?!!! ATI is a strong supporter of the DRI project and the fact that it releases its hardware specs to the development team, allows them to develop high performance drivers for the Linux platform

The Linux kernel 2.4.19 provides DRI support for the following cards:
3dfx Banshee/Voodoo3
ATI Rage 128
ATI Radeon
Intel I810
Intel 830M
Matrox g200/g400
SiS
The magic about DRI is that, like any other open source drivers these drivers too, if not shipped with the kernel itself, can be downloaded from the manufacturer’s website and built into the kernel. Well then, if you have any of the above cards, or any other card that adheres to the DRI spec, then here’s how you get your favourite game up and running.

Step 1 (Install Mesa)

Mesa is a free, open source, Open GL 1.3 compatible 3D library. Mesa usually ships with most distros, so if you have an RPM managed distro all you need do, is find that blessed package and type in the following command to install it

# rpm -ivh Mesa-4.x.x.rpm

On Slackware it would be

# installpkg Mesa-4.x.x.tgz

If you were not fortunate enough to get the binary package, then download the tarball for the sources and do the following

# tar -zxvf Mesa-4.x.x.tar.gz
# cd Mesa-4.x.x
# ./configure
# make
# make install

Gee whiz !!! You did it!! Mesa should be up and running with that. To check if everything worked well enough, fire up X and type the following command.

# glxinfo

That should give you a lot of info about your Mesa install. Next, you would like to check up whether GL apps do work. Fire up this command to check just that.

# glxgears

you should see a set of gears doing a lot of work in a little window with the frame rates being logged on the console. Note down these frame rates to see the difference when we are done.

Step 2 (Configure the DRI enabled Kernel)

Follow these steps to compile DRI support for ATI Radeon cards(or any other card for that matter)into your kernel.

# cd /usr/src/linux
# make menuconfig

Go to the section labelled “Character Devices”. Select /dev/agpgart(AGP Support) to be compiled as a module. Select the Direct Rendering Infrastructure option and lastly select the ATI Radeon DRI 4.x driver to be compiled as a module. Save your kernel configuration and exit. Next type the following commands.
# make dep clean modules modules_install bzImage && cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-DRI

edit your /etc/lilo.conf file and add the following section
image=/boot/vmlinuz-DRI
label= DRIKernel
root=/dev/hdXX
read-only

run lilo to update.

Step 3 (Configure XFree86 4.x.x)

Open XF86Config/XF86Config-4, depending on which file your X Server uses, in your favourite editor. If you arent sure which file your X server uses, then try the following command to give you the location of that file.

# grep “Using config file” /var/log/XFree86.0.log |cut -d” -f2
It’ll give you the location of the config file, you need to tweak.

Now add the following lines in the Section “Module”

Load “glx”
Load “dri”
Load “GLcore”

Now look for a Section “Device”. Modify it to contain the following line.

Driver “radeon”

That’s it! Save and quit.
Last but not the least, edit /etc/modules (in Red Hat/Mandrake), and add the line

radeon

In Slackware you will need to add the following line to /etc/rc.d/rc.modules

/sbin/modprobe radeon

That’s all it takes, folks!!! Reboot, select DRIKernel from the boot menu, install your favourite game and start fragging those stupid bots !!!!Eye-wink You could run glxgears again and see the difference in frame rates.

Leave a Reply

You must be logged in to post a comment.