3D acceleration of ATI card in Debian
Tuesday, September 19, 2006 4:09:54 AM
I decided to play with 3D desktop in GNOME. After installing "3ddesktop" package, I tried to lauch "3ddeskd", but it gave me the following error message:
3ddeskd: glXIsDirect failed, no Direct Rendering possible! 3ddeskd: Please configure hardware accerlation. Exiting.
Then I realized that I may not be using the approriate driver for my video card. So I installed the "fglrx" driver with the following packages:
fglrx-control fglrx-driver fglrx-driver-dev fglrx-kernel-src
Then I tried to use "dpkg-reconfigure xserver-xorg" to reconfigure the X system, but I got this weird warning message:
xserver-xorg postinst warning: not updating /etc/X11/xorg.conf; file has been customized
After reading several posts on Internet, I finally found a solution in this post. The solution is
sudo sh -c "readlink /etc/X11/X : md5sum > /var/lib/x11/X.md5sum"
Then I modified the /etc/X11/xorg.conf file, replacing "ati" driver with "fglrx" driver.
However, 3ddeskd still gave me error message. More detailed error information can be obtained from the follwing source:
1. glxinfo
name of display: :0.0 display: :0 screen: 0 direct rendering: No ....
2. fglrxinfo
display: :0.0 screen: 0 OpenGL vendor string: Mesa project: www.mesa3d.org OpenGL renderer string: Mesa GLX Indirect OpenGL version string: 1.2 (1.5 Mesa 6.2.1)
3. /var/log/Xorg.0.log
(WW) fglrx(0): *********************************************** (WW) fglrx(0): * DRI initialization failed! (WW) fglrx(0): * (maybe driver kernel module missing or bad) (WW) fglrx(0): * 2D acceleraton available (MMIO) (WW) fglrx(0): * no 3D acceleration available (WW) fglrx(0): ********************************************* *
After tring several solutions found in the web, I felt really frustrated. I decided to read the package description of "fglrx-driver" and I found the following description:
This package provides 2D display drivers and hardware accelerated OpenGL for X.Org 1:7.0.0. For 3D acceleration to work, you will need to compile the fglrx kernel module for your kernel: see the fglrx-kernel-src package.
It seems that I should compile the "fglrx" kernel module to enable 3D accelration. Then I compiled it, and
cp fglrx.ko /lib/modules/ /lib/modules/2.6.16-2-686/misc/ depmod -ae
Restarted the machine, 3D acceleration still did not work!! Why??? I tried "modprobe fglrx", got the following error:
Error inserting fglrx: Invalid module format
After googling, found this post very useful. Actually, the reason is that my kernel is compiled using gcc4.0, but my current gcc version is 4.1. So the gcc4.1-compiled "fglrx" module is not compatible with the gcc4.0-compiled kernel. This can be seen using "dmesg : grep flgrx",
fglrx: version magic 'xxx gcc-4.1' should be 'xxx gcc-4.0'
Obviously, neither downgrading gcc nor recompiling the kernel is a good idea. So I decided to modified the "make.sh" file provided by package "fglrx-kernel-src". I found out that this make file do try to find the correct gcc version to compile fglrx module. However, it is not
smart enough
. I had to manually change it to use gcc4.0.Restarted the machine.........
Everything works smoothly. Fancy 3D Desktop! And I can enjoy various video games in my Debian box in the future.
Finally let's verify.
1. glxinfo
name of display: :0.0 display: :0 screen: 0 direct rendering: [b]Yes[/b] ....
2. fglrxinfo
display: :0.0 screen: 0 OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON X300 Generic OpenGL version string: 2.0.5695 (8.23.7)
3. /var/log/Xorg.0.log
...... (**) fglrx(0): DPMS enabled (II) fglrx(0): Using XFree86 Acceleration Architecture (XAA) (II) fglrx(0): Acceleration enabled (II) fglrx(0): X context handle = 0x1 (II) fglrx(0): [DRI] installation complete (II) fglrx(0): Direct rendering enabled (==) fglrx(0): Using hardware cursor (II) fglrx(0): Largest offscreen area available: 1280 x 410 (II) fglrx(0): Interrupt handler installed at IRQ 169. (II) fglrx(0): Exposed events to the /proc interface

Anonymous # Tuesday, November 7, 2006 9:45:48 PM
subjam # Wednesday, November 8, 2006 1:00:47 AM
-------------------------------------------------------------------------------------
KERNEL_GCC="`cat /proc/version | grep -o -e "gcc version [0-9]\.[0-9]" | cut -d " " -f 3`"
CC="gcc-${KERNEL_GCC}"
------------------------------- ------------------------------------------------
at the end of function set_GCC_version (). Please make sure that you have gcc4.0 installed.
Anonymous # Wednesday, January 24, 2007 9:40:26 PM