Tuesday, October 10, 2006

Debian HOW-TO : ATI drivers

Last revision: June 13th, 2007

ATI has made tremendous efforts recently to enhanced its Linux drivers quality, and it shows. Debian users can now install the ATI drivers with minimum effort.

Here is how to do it.


  • Requirements

First, download the latest ATI drivers (installer) from ATI's site.

Then install the required building tools, plus fakeroot and debhelper (I use sudo to get root privileges temporarily):

sudo apt-get install fakeroot debhelper build-essential libstdc++5



  • Using the ATI installer

Second, prepare the ATI packages from the file just downloaded:

fakeroot sh ati-driver-installer-8.37.6-x86.x86_64.run --buildpkg Debian/etch


Of course, replace Debian/etch with your specific distribution. To get a list of all available distributions:

fakeroot sh ati-driver-installer-8.37.6-x86.x86_64.run --listpkg



  • Driver installation

Third, install the required resulting packages (only those 2 are required):

sudo dpkg -i fglrx-driver_8.37.6-1_i386.deb
sudo dpkg -i fglrx-kernel-src_8.37.6-1_i386.deb



Then install the kernel headers.

sudo apt-get install linux-headers-$(uname -r)


The package for Debian Sarge is named a little differently: kernel-headers-$(uname -r)

At this point you must build the fglrx module with module-assistant:

sudo apt-get install module-assistant
cd /usr/src
sudo m-a prepare
sudo m-a a-i fglrx



  • Configuring X

Finally, make sure your /etc/X11/xorg.conf (or /etc/X11/XF86Config-4) file is correctly configured. A little hint there on Flavio Stanchina's page. You can always look at my X configuration file for reference.

Note: I first published this guide on linuxforums.org under the nickname antidrugue.

32 comments:

Patrick said...

Excellent tutorial! This guide worked perfectly for me on Kubuntu 6.10!

Thiago Colares said...

Congratulations. I think this is a good tutorial, but unfortunatly the last step haven't worked on my computer.

When I tried to instal using the module-assistant, I got this error at log:

make[2]: *** [/usr/src/modules/fglrx/firegl_public.o] Error 1
make[1]: *** [_module_/usr/src/modules/fglrx] Error 2
make[1]: Leaving directory `/usr/src/kernel-headers-2.6.8-2-686
make: *** [build] Error 2

Do you have any idea I can make to solve it? Thanks!

Luigi said...

Do you know of any solution for the display flicker the recent ATI drivers are causing, other than restarting the X server?

Anonymous said...

Just what I was looking for.
Your tutorial worked!
I used it for the new Debian testing lenny.

Anonymous said...

I'm using Debian Lenny, and I wrote:
fakeroot sh ati-driver-installer-8.36.5-x86.x86_64.run --buildpkg Debian/testing, and here is output:
Created directory fglrx-install.EZ4250
Verifying archive integrity... All good.
Uncompressing ATI Proprietary Linux Driver-8.36.5...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
==================================================
ATI Technologies Linux Driver Installer/Packager
==================================================
Generating package: Debian/testing
Package build failed!
Package build utility output:
dpkg-buildpackage: source package is fglrx-installer
dpkg-buildpackage: source version is 8.36.5-1
dpkg-buildpackage: source changed by ATI Technologies Inc. < http://ati.amd.com/support/driver.html >
dpkg-buildpackage: host architecture i386
dpkg-buildpackage: source version without epoch 8.36.5-1
debian/rules build
dh_testdir
# move licenses away from binary dir
if [ ! -d usr/share/doc/fglrx ]; then \
mkdir -p usr/share/doc/fglrx; \
mv usr/X11R6/bin/LICENSE.* usr/share/doc/fglrx; \
fi
# remove exec bit from files that don't deserve it
find usr/X11R6/include \
usr/X11R6/lib \
usr/share usr/src -type f | xargs chmod -x
find lib -not -name "*.sh" -type f | xargs chmod -x
find lib -name "*.sh" -type f | xargs chmod +x
# set proper permissions on /etc files
if [ -d etc/ati ]; then \
chmod 755 etc/ati ; \
chmod 644 etc/ati/* ; \
chmod a+x etc/ati/*.sh ; \
fi
if [ -f debian/fglrx.default ]; then \
mv -v debian/fglrx.default debian/fglrx; \
fi
`debian/fglrx.default' -> `debian/fglrx'
fakeroot debian/rules binary
fakeroot: FAKEROOTKEY set to 2037249885
fakeroot: nested operation not yet supported
Removing temporary directory: fglrx-install.EZ4250

Anonymous said...

ok, I solved that problem, I ran it as root xD

Gary said...

Your howto worked (no error messages or anything that looked unusual) except I'm running into an error when I try to start X.

(II) LoadModule: "fglrx"
(II) Loading /usr/lib/xorg/modules/drivers/fglrx_drv.so
dlopen: libstdc++.so.5: cannot open shared object file: No such file or directory
(EE) Failed to load /usr/lib/xorg/modules/drivers/fglrx_drv.so
(II) UnloadModule: "fglrx"
(EE) Failed to load module "fglrx" (loader failed, 7)

I'm running an AMD64X2 system with an ATI Radeon X1250 onboard video.

Hugues said...

Hi Gary,

Make sure you have the package libstdc++5 installed. So that would be:

apt-get install libstdc++5

Thanks for reading, and thanks for your comment,

Hugues

Gary said...

Thanks Hugues. That worked. I thought I already had that installed (must have been confused with the version in my 32bit chroot). :)

I also sent a request to ATI/AMD that they post a link to your page here. It's clearly the best guide for Debian users - much better than the old and unworkable guides they currently point to.

Anonymous said...

Would this work for SimplyMepis V6.5.02 64bit and an ATI X1950?

Hugues said...

Yes it would.

Since Mepis 6.5 is based on Ubuntu, just build the ATI packages for Ubuntu/feisty.

Good luck,

Hugues

Miha said...

In debian/lenny there isn /etc/X11/xorg.conf. Mybe you have older from etch, i install debian last week.

Juan.Sandrea.UJGH said...

I have a question... Does this work with an ATI Radeon 9250? Should I use this driver or the 8.28.8?

Anonymous said...

Hello, excellent tutorial so far, but I am unable to get past the second step, where you say to "Second, prepare the ATI packages from the file just downloaded" then you have a code.

I tried to use that code, but I was given a message

sh: Can't open ati-driver-installer-8.37.6-x86.x86_64.run

and then I saw to replace Debian/etch with my distribution, and I have no idea what that means, and I tried to use the code provided below that, and yet I still get the message

sh: Can't open ati-driver-installer-8.37.6-x86.x86_64.run

I don't want to go any further, as I know that making an error could result in horrible damages, so please, help!!!

Mauricio said...

Hi, I have a ATI Technologies Inc M9+ 5C63 [Radeon Mobility 9200 (AGP)] card, I follow all your steps, but when I try to start the X server I got: No device found. If I depmod fglrx the module insert ok, but I can't start X, any clues? my xorg.conf device section is:
Section "Device"
Identifier "ATI Technologies, Inc. RV350 AS [Radeon 9600 AS]"
Driver "fglrx"
BusID "PCI:1:0:0"
Option "DynamicClocks" "true"
Option "VBERestore" "true"
Option "backingstore" "true"
Option "RenderAccel" "true"
# If X refuses to use the screen resolution you asked for,
# uncomment this; see "Bugs and Workarounds" for details.
Option "NoDDC"
# === Video Overlay for the Xv extension ===
Option "VideoOverlay" "on"
# === OpenGL Overlay ===
# Note: When OpenGL Overlay is enabled, Video Overlay
# will be disabled automatically
Option "OpenGLOverlay" "off"
# === Use internal AGP GART support? ===
# If OpenGL acceleration doesn't work, try using "yes" here
# and disable the kernel agpgart driver.
Option "UseInternalAGPGART" "yes"

Anonymous said...

you don't have to configure xorg.conf by hand, just type
# aticonfig --initial
as root, it'll do this for you. i had no problems...

Anonymous said...

You, sir, are a god among men. The only easily understood and technically complete explanation of how to configure this driver properly I have come across. Thanks for helping those of us trying to learn the ropes.

laurent said...

First of all thanks for this great tutorial!
Unfortunately I seem to have a similar (or the same?) problem as Mauricio. I've got a "ATI Technologies Inc Radeon R250 [Mobility FireGL 9000]" devive in a ThinkPad T40p.
I completed all steps of your tutorial. But if I try to start X with the "fglrx" driver, X fails outputting the message "no screens found".
I used you're xorg.conf configuration and also tried the auto configuration by "aticonfig --initial". Both failed...
Do you have any idea what the problem could be?
Thanx!

Anonymous said...

Thank you SO MUCH - this is my first day on linux and this how to is exactly what I needed. Many many thanks

Anonymous said...

at this stage:
sudo apt-get install linux-headers-$(uname -r)

i got

sudo apt-get install linux-headers-$(uname -r)

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package linux-headers-2.6.17-2-686

what to do

Hugues said...

Hello,

It seems you have an old kernel, for which a kernel-header package isn't available anymore.

Perhaps the best solution would be to put your system up-to-date (unless you have a good reason not to do so):
apt-get dist-upgrade

In the end you will have the latest Etch kernel, for which you will have no problem installing the kernel-headers package.

Thanks for your commnent,

Hugues

tuXist said...

Great tutorial!

Worked perfect for me on Deb/lenny x86_64 with ati8.40.XXX!
Thx!!!

Bye

Anonymous said...

please help,

dh_testroot
rm -f configure-stamp
rm -f fglrx.ko fglrx.mod.c *.o libfglrx_ip.a
rm -f .version .*.o.flags .*.o.d .*.o.cmd .*.ko.cmd
rm -rf .tmp_versions
rm -rf patch
dh_clean
rm /usr/src/modules/fglrx/debian/control
rm /usr/src/modules/fglrx/debian/dirs
if [ -f /usr/src/modules/fglrx/debian/control.template ]; then \
cat /usr/src/modules/fglrx/debian/control.template > /usr/src/modules/fglrx/debian/control; \
fi
if [ -f /usr/src/modules/fglrx/debian/postinst ]; then \
mv /usr/src/modules/fglrx/debian/postinst /usr/src/modules/fglrx/debian/fglrx-kernel-2.6.21-2-486.postinst; \
fi
dh_testdir
touch configure-stamp
dh_testdir
/usr/bin/make -C /lib/modules/2.6.21-2-486/build SUBDIRS=/usr/src/modules/fglrx modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.21-2-486'
CC [M] /usr/src/modules/fglrx/firegl_public.o
/usr/src/modules/fglrx/firegl_public.c: In function ‘__ke_pci_find_device’:
/usr/src/modules/fglrx/firegl_public.c:1886: warning: ‘pci_find_device’ is deprecated (declared at include/linux/pci.h:470)
/usr/src/modules/fglrx/firegl_public.c: In function ‘__ke_request_irq’:
/usr/src/modules/fglrx/firegl_public.c:2829: warning: passing argument 2 of ‘request_irq’ from incompatible pointer type
/usr/src/modules/fglrx/firegl_public.c: At top level:
/usr/src/modules/fglrx/firegl_public.c:5306: warning: ‘kmem_cache_t’ is deprecated
/usr/src/modules/fglrx/firegl_public.c:484: warning: ‘firegl_smp_func_parameter_wrap’ defined but not used
LD [M] /usr/src/modules/fglrx/fglrx.o
Building modules, stage 2.
MODPOST 1 modules
FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'paravirt_ops'
make[2]: *** [__modpost] Error 1
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.21-2-486'
make: *** [build] Error 2
TS:/var/cache/modass#

Anonymous said...

Really good instructions. Everything resulted as described. My problem must be isolated because i still can't get "fglrxinfo" to print the expected informaiton.

Hugues said...

Hello,

To answer this FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'paravirt_ops' question.

This problem appeared first in the 2.6.20.x kernels. It is related to a new "feature", enabled by default in the Debian kernels: CONFIG_PARAVIRT.

Other than using a custom kernel with this feature disabled, I am unsure of the solution.

Perhaps using the latest ATI drivers version, which is at 8.42.3 as of today, could help?

Thanks,

Hugues

Vincent said...

Hi, i'm a new user to linux and followed your instruction and all the step worked without any errors however am i greeted with a black screen when i do startx. When i did a cat xorg.0.log | grep EE I found no errors though just a message about fglrx(0): Loading MIT-SCREEN-SAVER. Any ideas as to why i'm getting a black screen everytime? also what exactly is MIT-SCREEN-SAVER and why is it loading in the first place?

-Vincent

Hugues said...

Hello Vincent,

I suggest you start a thread about this issue on a Linux forum, like Linuxforums.org or Linuxquestions.org.

Perhaps there someone who experienced the same difficulties will be able to help you.

Thanks for reading, and thank you for your question.

Hugues

Anonymous said...

Hi!
I am running debian unstable (lenny) and want to intall compiz-fusion but I run into problems. I installed succesfully (I think) the module fglrx. I used the prebuilt binaries and then installed it using

module-assistant a-i fglrx

it did something and said that it was installed. I can load it:
modprobe -v fglrx
insmod/lib/modules/2.6.22-3-686/misc/fglrx.ko

and it is listed in /proc/modules:

fglrx 1480748 0 - Live 0xf8f55000 (P)

and loads at boot time, etc. However if I put in /etc/X11/xorg.conf under the section "device" :
driver "fglrx"

then kdm is not able to start, if I keep "ati" as it was, no problem. I have tried with many different combinations of options in xorg.conf and they don't seem to do anything, kdm load with ati and not with fglrx irrespectively of these options.

There is no direct rendering, I get:

glxinfo | grep direct

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

OpenGL renderer string: Mesa GLX Indirect

and

fglrxinfo

display: :0.0 screen: 0
OpenGL vendor string: Mesa project: www.mesa3d.org
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.4 (2.1 Mesa 7.0.1)

No idea of how to continue, any help will be very appreciated,

Pedro.

Hugues said...

Hi Pedro,

As I have been without an ATI card for a while, I haven't followed the development of its driver.

It seems however that you can get the fglrx driver to work with compiz-fusion. Perhaps there's a hint here.

Good luck, and thanks for reading.

Hugues

Dominic85 said...

thanks for the tutorial! when i run as root cat /var/log/Xorg.0.log | grep -i aiglx i get the following
(==) AIGLX enabled
(WW) AIGLX: 3D driver claims to not support visual 0x23
repeating up to
(WW) AIGLX: 3D driver claims to not support visual 0x72
(II) AIGLX: Loaded and initialized /usr/lib/dri/fglrx_dri.so

is this bad? does anyone have experience of running compiz on a ati 200m card? Thanks again!

derrichard said...

Hi, first of all, thx for this tutorial!
I have made a german translation of this one, slightly altered to work with the current Debian testing. The link is http://cordonbloed.wordpress.com/2008/06/14/anleitung-ati-fglrx-treiber-unter-debian-lenny-testing-einrichten/.

Greetings,
Richard

Anonymous said...

great tutorial but for some reason i get an error after i do this command

root@system:/home/user/Desktop# m-a a-i fglrx

Updated infos about 1 packages
Getting source for kernel version: 2.6.26-1-686
Kernel headers available in /lib/modules/2.6.26-1-686/build
apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

Done!
/usr/share/modass/packages/fglrx-kernel-src download
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
fglrx-source
The following NEW packages will be installed:
fglrx-source
The following packages will be upgraded:
fglrx-kernel-src
1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 1330kB of archives.
After this operation, 8192B disk space will be freed.
Get:1 http://ftp.debian.org testing/non-free fglrx-kernel-src 1:8-7-3 [18.5kB]
Get:2 http://ftp.debian.org testing/non-free fglrx-source 1:8-7-3 [1311kB]
Fetched 1330kB in 2s (534kB/s)
(Reading database ... 109480 files and directories currently installed.)
Preparing to replace fglrx-kernel-src 8.552-1 (using .../fglrx-kernel-src_1%3a8-7-3_all.deb) ...
Unpacking replacement fglrx-kernel-src ...
Selecting previously deselected package fglrx-source.
Unpacking fglrx-source (from .../fglrx-source_1%3a8-7-3_i386.deb) ...
Setting up fglrx-source (1:8-7-3) ...
Setting up fglrx-kernel-src (1:8-7-3) ...

Updated infos about 1 packages
unpack
"/usr/share/modass/packages/fglrx-kernel-src" build KVERS=2.6.26-1-686 KSRC=/lib/modules/2.6.26-1-686/build KDREV=2.6.26-10 kdist_image
find: `/usr/src/modules/fglrx*': No such file or directory
No such file or directory
No such file or directory