You are inside a passionate computer engineer's lab...
Proceed at your own risk...

Look for something inside my Lab...


Installing ATI Proprietary Linux Driver (fglrx) on Debian Lenny 5.0 Stable 64 bits

I am one of those unlucky peoples who happen to own a laptop equipped with an ATI graphic card, while being strongly attached to the open source world...

Yes, again, and the fight just continues between open source world (Linux, BSD, ...) and the ATI for its graphic chipset driver.

I am not going to reenter all that history. In brief, I have successfully installed the fglrx driver version 10.10 (the ATI Proprietary graphic chipset driver) on my laptop running the Linux Debian 5.0 Lenny Stable 64 bits.

Let's put it in perspective: I did that in 16 November 2010. In that day, the 10.10 version of fglrx is experimental, but not yet available in the experimental version of Debian. It may seem weired to install an experimental driver on the stable version of the OS, but I can say I had no choice. My graphic card was only supported starting from that version of fglrx. Yet I still stick to the reliable stable version of the Debian OS.

I am presenting this experience to the world because I find it useful for some of you, a bit like me. And I think it can help some others to install fglrx on their machines, if they have to. I made some bash scripts that automate the installation to some extent. But I want to show what they do first.

Hereafter are the general steps needed to install the fglrx driver. These are only meant to be understood, not to perfectly follow, because I will give some scripts that automate these actions just later.

1. Download the ATI Proprietary Linux Driver package. This got me the file.

2. Remove all traces of ATI drivers using the package manager.
apt-get purge fglrx-driver fglrx-driver-dev fglrx-atieventsd fglrx-modules fglrx-kernel-src fglrx-control fglrx-glx fglrx-amdcccle fglrx-kernel fglrx-glx-ia32 fglrx-source

3. Extract into a directory fglrx-10-10.
"./" --extract "./fglrx-10-10"

4. Correct the internal structure of the fglrx installer package:
These steps are the fruit of hours of debugging efforts I did to figure out how to make the fglrx installer generate correct debian packages for me.

4.1. Create some directories.
The structure of the extracted installer files is not complete for a 64 bits system. So I corrected that.

4.2. Copy some files.
Some files needed to be copied to different locations inside the installer directory, in order to be installed in the right places when the packages are built.

4.3. Alter some files.
Some configuration files and scripts needed some changes to install the needed files and to make the correct links to the shared libraries when installed on the system.

5. Create the debian packages (.deb) from the extracted patched files.
./ 10.10 --buildpkg Debian/lenny

6. Install the generated packages.
dpkg -i fglrx-driver*.deb
dpkg -i fglrx*.deb

7. Remove the open source ATI drivers available with Xorg.
apt-get purge xserver-xorg-video-ati

8. Patch some Linux source files.
This is required to solve a compatibility issue with fglrx and linux kernel API.
The issue is a change in the name of a function in the linux kernel, which is not taken into account by the developers of fglrx. The change I do does not really hurt the linux kernel itself, as all I am doing is adding a new function that is the exact copy of another one.

9. Build and install the fglrx kernel driver.
This will build the fglrx kernel module which enables the 3D acceleration of the graphic card.

10. Ensure that the fglrx kernel driver is loaded as a kernel module.
This is a final check to ensure the fglrx module has been installed and loaded into the kernel:
modprobe -l | grep fglrx

11. Configure the Xorg server to use fglrx driver.
First we have to stop gdm (GNOME Desktop Manager):
invoke-rc.d gdm stop

Then we generate the Xorg configuration that uses fglrx for X:
aticonfig --initial=dual-head

Finally we start gdm:
invoke-rc.d gdm start

12. Pin fglrx driver in the package manager to disallow any further automatic upgrades.
I don't actually provide the script needed to do this, as I easily do it using Synaptic Package Manager.

Here are the files needed. Just download this archive, extract it and put it in the same directory as the file. It will contain:

The scripts should be run as root from a real TTY (Alt-Ctrl-F2) as they don't expect X to be running all their lifetime. The run order is the following:

./make_packages 10 10

I am here for your comments or questions, don't hesitate.
I wish I added something to the community. Enjoy!

No comments:

Post a Comment