This page explains how to build Debian packages from the ATI Linux driver for the following ATI products:
apt-get remove "fglrx-4.*" apt-get install fglrx-driver fglrx-kernel-src
kernel-headers packages should suffice.
I didn't test if it's true. Feedback is welcome.
kernel-headers package.]
[Ideas from this script have been integrated into version 3.9.0-4. Do not use it anymore.]
First things first: read the instructions below carefully before doing anything else!
This is not for the faint of hearth or the uninitiated. If you never tried to build a Debian package from source, learn how to do that before you come back here.
apt-get and dpkg.
Please don't stay logged in as root any longer than necessary;
rather, I'd suggest to install sudo and use that.
The driver as a whole is made of three main components: the XFree86 driver proper, a replacement libGL and a kernel module. The driver and libGL are in the fglrx-driver package, the kernel module's source code is in the fglrx-kernel-src package.
You need to install the kernel source code that corresponds to your running kernel and
configure it with make-kpkg.
This is obviously easy if you already compile your own kernel,
but it's going to require a bit of work if you are using a prebuilt kernel.
Any kernel version available from Debian should do.
apt-get install gcc/stable gcc-2.95/stable
You don't need to actually compile the kernel, but you do need to configure it properly. If you don't want to compile and install your own kernel, just install the sources for the same kernel version that you are using and use the configuration that came with your kernel package:
apt-get install kernel-source-2.x.y cd /usr/src tar xjvf kernel-source-2.x.y.tar.bz2 cd kernel-source-2.x.y cp /boot/config-2.x.y-flavour .config make-kpkg --append-to-version "-flavour" --revision 2.x.y-z --config old configure
"-flavour" is supposed to be a placeholder.
You need to replace it with the correct value for your kernel,
for example something like "-1-686" for prepackaged Debian kernels.
It's the text that follows the kernel version in the output from uname -r
and in the file names in the /boot directory.
"2.x.y-z" is the version of the kernel-image package you have installed. It should also be the same version as the kernel-source package.
If you already have a configured kernel source tree, you can use it, but make sure that it's exactly the same configuration you are using.
The following kernel options might affect the fglrx module. This list shows the options I've been using successfully for the past two years; these options are correct for kernel 2.6.10, but they should be the same for any 2.6.x kernel and probably for 2.4.x kernels too.
| Kernel option(s) | Notes |
|---|---|
|
CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_KMOD=y | Make sure that CONFIG_MODVERSIONS is set correctly! |
| CONFIG_MTRR=y | The fglrx driver needs MTRR (Memory Type Range Register) support |
|
CONFIG_AGP=m CONFIG_AGP_chipset=m |
Enable any AGP chipset drivers you might need, for example
CONFIG_AGP_INTEL, CONFIG_AGP_NVIDIA, etc...
CONFIG_AGP_ATI is required only if you actually have an ATI AGP chipset on your motherboard;
it has nothing to do with the fact that your AGP video card is an ATI. Do not set CONFIG_AGP=y if you want to use fglrx's built-in AGP support. |
|
CONFIG_DRM=y CONFIG_DRM_RADEON=m | Hardware detection tools might try to load the radeon DRM module automatically during startup; if that happens to you, either tweak the tools' configuration or disable the radeon DRM module. |
|
# CONFIG_FB is not set |
CONFIG_FB_VESA=y is supposed to work, but it appears that
it can cause
"mtrr overlapping" errors; CONFIG_FB_RADEON=y definitely causes problems, so disable it. |
| CONFIG_TMPFS=y | ATI says POSIX shared memory is required! |
If any of your kernel configuration options differ from the ones above and you are having problems, please try with the options exactly as above or be prepared to explain why your choice should make no difference.
You need some support for your AGP chipset. You have two choices:
the ATI driver's built-in AGP support or the kernel agpgart driver.
It's difficult to say in advance which one is better or will work at all,
because it depends on the exact driver and kernel versions you're using, but
the kernel driver should be your preferred choice if it works for you.
To use the kernel driver, add the following line to the "Device"
section of your XFree86 config file:
Option "UseInternalAGPGART" "no"
unable to acquire AGP, error "xf86_ENOMEM"
in your XFree86 log usually means that you are using
the built-in AGP support with an unsupported chipset.
Set "UseInternalAGPGART" to "no" and hope that
the kernel driver supports your AGP chipset.
If you want to use the ATI driver's built-in AGP support instead,
set "UseInternalAGPGART" to "yes"
(it's the default setting, so you can just omit it) and make sure that
the kernel driver is not compiled into your kernel:
either compile it as a module or disable it entirely.
Beware that discover (and possibly other hardware detection tools)
might try to load the kernel driver automatically during startup.
If that happens to you, you can tweak discover's configuration
or you can simply move the agpgart.* files
away from /lib/modules.
If neither one supports your chipset, try using the kernel driver
with the agp_try_unsupported=1 option on the kernel command line
or as a parameter when you load the module.
Note that in the 2.6 kernel the AGP chipset drivers are separate
from the agpgart driver itself, so if you build them as modules
you will need to load the agpgart module and a chipset module
such as via-agp, nvidia-agp, etc.
If you want to build the source packages,
make sure you have installed debhelper,
kernel-package (for make-kpkg),
libqt3-mt-dev, xlibs-dev,
fakeroot, rpm and wget.
apt-get install debhelper kernel-package libqt3-mt-dev xlibs-dev fakeroot rpm wgetYou should also install
libncurses5-dev if you want
to be able to use make menuconfig in the kernel source tree.
If you will build only the kernel module,
you need debhelper,
kernel-package and fakeroot.
Once you've sorted out all this, you can proceed to download the following package sources or the prebuilt packages.
These scripts will package the ATI driver version 8.8.25.
You can ask for a different version by setting an environment variable
when you call debian/rules,
but figuring out the details is left as an exercise for advanced users
because this has not been tested very much and could fail.
The scripts will detect which version of XFree86 is currently installed on your machine and download the matching driver package. You can ask for a different version by setting an environment variable, but again, details are best left unexplained.
Download the files above into a directory of your choice
(preferably /usr/src)
and unpack with
dpkg-source -x fglrx-installer_8.8.25-1.dsc
Then cd into the newly created fglrx-installer-8.8.25 directory and run
fakeroot debian/rules binary
The build script will download the driver from the ATI site, then it will build the following packages in the parent directory:
Now you can install the packages and compile the kernel module.
These packages are offered for the convenience of those who don't want to learn how to build their own.
rm -rf /;
don't trust me, because I wouldn't trust you.
You can download these packages with apt by adding the following lines
to your /etc/apt/sources.list file:
deb http://www.stanchina.net/~flavio/debian/ ./ deb-src http://www.stanchina.net/~flavio/debian/ ./
Note that there are other packages available here, but my repository is tagged as "experimental" so the default apt pinning policy will prevent unwanted upgrades to my versions for packages that are available from here and from official sources.
The following packages install the ATI driver for
XFree86 4.3.0 for the
i386 architecture.
You need just the -driver and -kernel-src
packages for normal use (see below).
| Name | Size | MD5SUM |
|---|---|---|
| fglrx-driver_8.8.25-1_i386.deb | 3400492 bytes | 5c3705ffe32ffbf2c8697b685ac3244a |
| fglrx-driver-dev_8.8.25-1_i386.deb | 9830 bytes | 5297760127a13372679ba0abfe6512d1 |
| fglrx-kernel-src_8.8.25-1_i386.deb | 271082 bytes | 0d42f03505ebfcefd7af4b42c1402d9f |
| fglrx-control-qt3_8.8.25-1_i386.deb | 58610 bytes | f61d5cde81127746d5cd8cdb7ce0beee |
| fglrx-sources_8.8.25-1_i386.deb | 73926 bytes | 9b2ce5a4953cb9962694328ab5550b01 |
Note that due to time and space constrains I'm uploading packages only for the XFree86 version I'm currently using, which is usually the version currently available from Debian testing. If you need packages for a different XFree86 version, ask politely or build your own packages.
Donovan Baarda built the kernel module against a number of standard kernel-headers packages. If you are using one of the standard kernels he supports, you can get his prebuilt packages here and avoid compiling the module yourself.
You need to install
the "-driver"
and "-kernel-src" packages;
the "-driver-dev" package contains
header files and the libfglrx_gamma.a static library
and you need it only if you develop ATI-specific OpenGL applications;
the "-control-qtX" packages install
the control panel and can be useful for multi-monitor configurations;
the "-sources" package contains
the control panel source code and a sample application
and it is not required for normal use.
cd .. dpkg -i fglrx-driver_8.8.25-1_i386.deb dpkg -i fglrx-kernel-src_8.8.25-1_i386.deb
After you have installed the packages,
change directory to /usr/src and unpack the module sources:
tar xzvf fglrx-kernel-src.tar.gz
You can now build the kernel module in several ways.
Choose one, preferably the make-kpkg command.
cd /usr/src/modules/fglrx-kernel-src ./make.sh
make-kpkg,
please try this method and install the module by hand.
If this module works, building it with make-kpkg
is just a matter of using the correct parameters.
cd /usr/src/kernel-source-2.x.y make SUBDIRS=/usr/src/modules/fglrx-kernel-src modules(replace /usr/src/kernel-source-2.x.y with the path to your kernel sources)
make-kpkg commandcd kernel-source-2.x.y fakeroot make-kpkg --append-to-version "-flavour" --added-modules fglrx-kernel-src modules_image
"-flavour" is supposed to be a placeholder. You need to replace it with the correct value for your kernel, for example something like "-1-686" for prepackaged Debian kernels. Refer to 2.1. Kernel source for more details.
This will build a new package, which you will have to install:
dpkg -i /usr/src/fglrx-kernel-2.x.y_8.8.25-1+kernelversion_i386.deb
Important:
If you build your own packages, please upgrade to debhelper 4.2.11
(see Debian bug #248624), otherwise
you will need to run update-modules yourself after installing the module.
module-assistantmodule-assistant -k /usr/src/linux update module-assistant -k /usr/src/linux build fglrx-kernel module-assistant -k /usr/src/linux install fglrx-kernelIf you prefer to build the packages with m-a from your own user account:
mkdir ~/src/modass module-assistant -u ~/src/modass -k ~/src/linux update module-assistant -u ~/src/modass -k ~/src/linux build fglrx-kernel module-assistant -u ~/src/modass -k ~/src/linux install fglrx-kernel
If you used the make-kpkg command,
you'll have a nice Debian package to install;
if you used module-assistant's install command,
the module is already installed;
otherwise, you'll have to copy the module
from /usr/src/modules/fglrx-kernel-src
to the right directory
under /lib/modules,
then run depmod -ae to install it.
Now try to load the module:
modprobe fglrx
If modprobe can't load the module,
make sure you've installed the kernel module's package,
make sure you've read the paragraph about bug #248624 above,
and look at the output of dmesg for any errors.
Please include the full error message from modprobe
and the output from dmesg and lsmod
if you choose to contact me at this point!
Unresolved symbols:
If you see errors like "unresolved symbol dev_base_R863b01ad",
it means that the module was compiled with CONFIG_MODVERSIONS=yes
but the running kernel was not.
In other words, the configuration of your kernel source tree
does not reflect that of the running kernel.
Go back to section 2.1,
make sure that you configured your kernel source tree correctly
and double check that CONFIG_MODVERSIONS is not set.
If you still can't load the module, please read Question 4.7: When I try to run "modprobe fglrx" it doesn't work from the Gentoo ATI Radeon FAQ before contacting me.
fglrxconfig.
Just don't use it, OK?
fglrxconfig is useful if you want a dual-head setup,
but before you try that please make sure that a single-head setup works
by editing your XFree86 configuration file as outlined below.
Also note that fglrxconfig will overwrite your
existing XFree86 configuration file!
Edit your /etc/X11/XF86Config-4:
Section "Module"
...
Load "GLcore"
Load "glx"
Load "dri"
...
# Load "extmod" but omit DGA extension
SubSection "extmod"
Option "omit xfree86-dga"
EndSubSection
...
EndSection
Section "Device"
Identifier "ATI"
Driver "fglrx" # this is the important bit
# 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" "no"
EndSection
Section "Screen"
Identifier "your screen"
Device "ATI"
Monitor "your monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x960" # this is only an example,
# use your preferred resolution here
EndSubSection
EndSection
Section "DRI"
Mode 0666
EndSection
Stop and restart your X server. Figuring out how to do that on your system is left as an exercise, but usually you'll have to switch to a virtual console (text mode) by pressing Ctrl+Alt+F1, then stop and restart your display manager (kdm, gdm, etc.). If you know no better than to reboot your system, you will be in a lot of trouble if things don't work as expected: you might be stuck with just the console, or things could go really wrong and you could have to reboot into single user mode because your display and keyboard are completely locked. So please do learn how to properly stop and restart the X server.
If it breaks your system, you keep all the pieces and I don't care. (But let me know what happened, OK?)
After your X server starts, check if OpenGL acceleration is enabled. Open a shell and typefglrxinfo or glxinfo:
the "OpenGL renderer string" should say something like "RADEON 9600 XT Generic";
if it says "Mesa GLX Indirect" instead, it means that there is a problem.
Full-screen mode is somewhat broken: sometimes you'll end up with a garbled display, and your only chance of getting your desktop back is blindly closing the program that caused this. I didn't find a workaround yet.
It appears that the ATI driver does not support the DVI port on my Radeon 8500 LE: I get is a blank screen as soon as X starts up. It's not a hardware problem, because I can see Linux boot in text mode on the DVI port and the Windows XP driver works fine (not that I would want to run XP for anything but a few games). Several people told me that they are using DVI on various 9600s, so I borrowed a 9600 XT from a friend and I could get DVI up and running in seconds.
This is what I see in the XFree86 log with my card:
... (--) Chipset ATI R200 QL (R8500) found ... (II) fglrx(0): Primary head: Monitor -- NONE Connector -- None DAC Type -- Unknown TMDS Type -- NONE DDC Type -- NONE (II) fglrx(0): Secondary head: Monitor -- NONE Connector -- VGA DAC Type -- Primary TMDS Type -- NONE DDC Type -- VGA_DDCWith the borrowed 9600 XT, the primary head says something along the lines of "Connector: DVI-I", "TMDS Type: Internal".
If you are using — or tried to use — the DVI port on other types of cards, please share your experience.
Jack reports that he's seeing lots of static at 1600x1200 on his digital display. He says that "this problem at 1600x1200 is a known issue due to approaching the video bandwidth limit of the hardware", because "the TMDS standard for DVI is fixed at 165 MHz which means that you are pushing things to get 1600x1200 at 60 Hz". He researched the issue and he found this article from ATI: Horizontal lines or screen flicker within Windows when using a DVI flat panel.
He further says: "The only fixes are to 1) reduce the refresh rate at higher resolutions to keep the pclk away from the upper limit of 165 MHz or 2) replace the DVI connection with an analog one."
It appears that the ATI driver will refuse any screen size that your monitor doesn't list in its VESA DDC info; for example, I can't get my preferred resolution of 1280x960(1) with my Samsung CRT monitor. The symptoms are the following: if multiple resolutions are listed in XF86Config (such as "1280x960" "1152x864" "1024x768" "800x600"), the display will open at 1024x768 with a noticeable delay (a couple of seconds).
There are two workarounds:Option "NoDDC" in the "Device" section,
as shown above:
this is harmless as long as you got your monitor timings right.
Kernel 2.6.5's "make clean" removes include/linx/version.h
and several other files that are required to build external modules.
A workaround is the following:
$ make-kpkg ...options... kernel_image $ make-kpkg clean $ make-kpkg ...options... configure $ make-kpkg ...options... modules_image(i.e do an extra "make-kpkg configure" before "make-kpkg modules_image")
Another workaround is to apply a patch that restores a sane behavior (from the Linux Kernel mailing list).
Do not install kernel-package 8.086 that "fixes" this problem by not doing a make clean: it's worse because the kernel makefile will now relink all kernel modules during the build of external modules.
CONFIG_REGPARMCONFIG_REGPARM
because it changes the kernel ABI.
Starting with version 3.7.6-5, I have applied
this patch
for the fglrx kernel module that should fix this problem.
Upstream version 3.9.0 should have fixed this problem,
according to the release notes,
but users report that it is still broken.
Starting with version 3.9.0-3, I have applied yet another patch,
kindly supplied by Alexandru Fomin, that hopefully fixes it once and for all.
Upstream versions 3.11.1 and later have this problem fixed properly.
Kevin Schlichter reports: "I'm running an SiS chipset, and found that the AGP support doesn't work in the 2.4 series, and not in the 2.6 series until 2.6.5. I think there are some patches available, but I didn't test any of them."
This is a list of a few setups that are reported to work fine. Please send me a note if your configuration differs significantly from those already listed; items that come to mind are multiprocessor setups, different chipsets and new kernel options such as CONFIG_REGPARM and CONFIG_4KSTACKS (note that I'm currently running with CONFIG_4KSTACKS enabled myself).
I will usually test new kernel versions in the 2.6 series within hours, but success stories on newer 2.4 kernels are also welcome.
| Debian | kernel(1) | XFree | fglrx | Radeon | CPU | chipset | FPS(2) | reported by | notes |
|---|---|---|---|---|---|---|---|---|---|
| Woody | 2.4.25 | 4.1.0 | 3.7.6-4(?) | ? | ? | ? | ? | Raphael | |
| Sarge | 2.4.25 2.4.26 2.6.4 2.6.5 (patched) | 4.3.0-7 | 3.7.6-4 | 8500 LE | Athlon 1200 MHz | Via KT133A | ? | myself | XFree configuration as above. Using kernel agpgart as module. Kernel 2.6.5 patched against broken "make clean". Kernel 2.6.6 and later using 4KSTACKS. |
| 2.6.5-regparm | 4.3.0-7 | 3.7.6-5 | 9600 Pro | Athlon 1200 MHz | nVidia nForce2 Ultra | ~530 | |||
| 2.4.26 2.6.5 (patched) 2.6.6 | 4.3.0-7 | 3.7.6-4 | 9600 Pro | Athlon XP 3200+ | nVidia nForce2 Ultra | ~550 | |||
| 2.6.6 | 4.3.0.dfsg.1-1 | 3.9.0-1 | 8500 LE 9600 Pro | ~225 ~600 | |||||
| 2.6.7 | 4.3.0.dfsg.1-4 4.3.0.dfsg.1-7 4.3.0.dfsg.1-8 | 3.11.1 3.12.0 3.14.1 | 8500 LE | ~235 | |||||
| 2.6.9 | 4.3.0.dfsg.1-8 | 3.14.6 | 8500 LE | ~235 | |||||
| 2.6.10-athlon | 4.3.0.dfsg.1-10 | 8.8.25-1 | 8500 LE | Athlon XP 3200+ | nVidia nForce2 Ultra | ~235 | current setup (autodetected) | ||
| Sarge | 2.4.26 (stock) | 4.3.0.1 | 3.7.6-4 | 9800 Pro | Pentium 4 2.6 GHz | Intel 875P | ~605 | vdrmrt | Kernel agpgart module. |
| Sarge | 2.4.27 (stock) | 4.3.0.dfsg.1-4 | 3.14.1 | Mobility Radeon 9600 M10 | Pentium M 1.5 | Intel 855(P)M | ~235 | Detlef | |
| Sarge | 2.6.5 | 4.3.0-7 | 3.7.6-4 | M10 (9600) | Pentium 4 3.0 GHz | SiS M648FX+963 | ~450 | kevin schlichter | Sager 4780 laptop. The AGP for this chipset does not work in 2.4 kernels, or 2.6 kernels before 2.6.5. |
| Sarge | 2.6.6-mm5 | 4.3.0.dfsg.1-1 | 3.7.6 | 9800 Pro | dual Athlon MP 1800+ | Tyan Tiger MPX (AMD-760 MPX) | ~716 | Nenad | |
| Sid | 2.6.4-1 | 4.3.0-7 | 3.7.6-4 | 9700 | Athlon XP 1921 MHz | nVidia nForce2 | ~570 | mithrandi | |
| Sid | 2.6.5 (debian) | 4.3.0-dfsg | 3.7.6-4 | Fire GL T2 | Pentium M 1.7 GHz | Intel 855M | ? | pthichat | IBM T41p laptop |
| Sid | 2.6.6 | 4.3.0.dfsg.1-1 | 3.7.6-4 3.7.6-5 | 9800 Pro | dual Xeon | e7505 | ~800 | hackman | |
| Sid | 2.6.5 w/highmem | 4.3.0-5 | 3.7.6-4 | 9800 Pro | Athlon64 3000+ | nVidia nForce3-250 | ~905 | donut | using kernel agpgart (didn't try the fglrx builtin) |
| Sid | 2.6.8-3 (debian) | 4.3.0.dfsg.1-8 | 3.14.1-2 | 9600 XT | AthlonXP 2500+ | SIS 746 | ~388 | Steffen Evers | using kernel agpgart |
fgl_glxgears at default window size.
| CONFIG | introduced | status | notes |
|---|---|---|---|
| HIGHMEM4G | ? | works | |
| PREEMPT | ? | works | |
| REGPARM | 2.6.5? | works | requires patch (already included in my packages) |
| 4KSTACKS | 2.6.6 | works |
Unless otherwise noted, the driver is known to work with any combination of these options enabled and of course with all of them disabled.
I'm currently running with HIGHMEM4G, PREEMPT and 4KSTACKS.
Contrary to what I had previously written here,
the ATI driver does support the Xv extension,
but you need to have
Option "VideoOverlay" "on"
in your XFree86 configuration (see above).
Recent versions also implement the DGA extension, but there are problems:
MPlayer for example will lock your screen if you use -vo=dga.
Therefore, I suggest to disable the DGA extension (see above, again).
Roberto JP says: "There are a few more advantages, from a developer's viewpoint. The ATI driver supports many more (important) OpenGL extensions than the open source driver does. If you're using vertex or fragment programs (i.e pixel shaders) in your software, this is very important."
I'm maintaining a mailing list for discussion about these packages. I'll also send out notes about new versions when they are available. Subscribe by sending an email to flavio-fglrx-subscribe at stanchina.net.
If you are having problems with the packages, please write to the mailing list. Note that this mailing list is not intended for general discussion of the fglrx driver, but only for users of my Debian packages. Posting is open to subscribers only. Abuse will not be tolerated.
An archive of the mailing list is also available.
Click here to learn how this package was born.
Versions 3.2.5 and later officially support the Radeon products again. These products were initially listed as supported in the documentation for version 2.9.6 of the driver, but later on all references to them were removed, leaving only the FireGL series as officially supported. However, the driver itself was not changed and later versions (up to and including version 2.9.13, which was the latest version available from ATI until 3.2.5 came along) still supported the consumer products too. I still can't understand why it was so, but now support for the Radeons is officially back and everyone should be happy.