Penguin
Note: You are viewing an old revision of this page. View the current version.

Support for ATI Radeon & FireGL graphics cards on Linux

Back in the days when ATI didn't release up to date drivers, NVIDIA didn't release AGPGART source and I ran 2.4.20, I created a page called RadeonOnNforce, which apparently solved a lot of problems for a lot of people.

These days, the radeon driver that you get from ATI's webpage is the most up to date version, and the latest stable kernels should have support for NVIDIA's AGPGART as it was released as open source by NVIDIA.

Thanks very much to Curtis Box (no relation) for pointing out the new ATI drivers originally.

Fix for error building Radeon driver on Linux 2.6

Do you get errors like

/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function `__ke_get_vm_phys_addr':
/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:1506:
  warning: implicit declaration of function `VMALLOC_VMADDR'
make[2]: *** [/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o] Error 1
make[1]: *** [/lib/modules/fglrx/build_mod/2.6.x] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.0-test11'
make: *** [kmod_build] Error 2

[root@test 2.6.x]# modprobe fglrx
Error inserting 'fglrx.ko': -1 Unknown symbol in module

Oct 26 16:11:46 [kernel] fglrx: module license 'Proprietary.
  (C) 2002 - ATI Technologies, Starnberg, GERMANY' taints kernel.
Oct 26 16:11:46 [kernel] fglrx: Unknown symbol VMALLOC_VMADDR
Oct 26 16:12:14 [kernel] [drm] Module unloaded

You need to make a change to /lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: add

#ifndef VMALLOC_VMADDR
#define VMALLOC_VMADDR(x) ((unsigned long)(x))
#endif

to the beginning somewhere, and then cd .. back up to build_mod, run ./make.sh, cd back up to fglrx and run ./make_install.sh

There is a patch for this, and other issues, in Gentoo's ATI drivers portage tree.

xf86_ENOMEM and xf86_ENODEV

(EE) fglrx(0): [agp] unable to acquire AGP, error "xf86_ENOMEM"
(EE) fglrx(0): cannot init AGP
(II) fglrx(0): [drm] removed 1 reserved context for kernel
(II) fglrx(0): [drm] unmapping 8192 bytes of SAREA 0xd1a34000 at 0x40229000
(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): ********************************************* *

The problem is well documented - basically, you don't have correct AGPGART support. The way I solved this on LinuxKernel2.6 was to make sure UseInternalAGPGART was set to no in the XF86Config file and rebooting - if at any stage the fglrx AGPGART has loaded, you're shit out of luck. (Ask dmesg(8)).

If you have an NForce2; use Kernel 2.4.22 or higher for a kernel that supports the Nvidia AGPGART. (You should be using Kernel 2.4.24 or higher anyway!) It's native to 2.6.

With the NForce2 chipset there may be difficulties trying to have output mirrored to the TV out, unfotunately I do not currently know any solution other than to disable TV out support.

The Gentoo ATI Radeon FAQ has some great examples. If you're using a VIA KT400, start at Rage3D's message board.

Kernel Oops when starting X

With a 2.6.3 kernel I was getting a kernel oops everytime X tried to load with the fglrx module loaded. The backtrace looked something like this:

Feb 20 20:27:10 than kernel: Call Trace:
Feb 20 20:27:10 than kernel:  [<f89f49cb>] __ke_amd_adv_spec_cache_feature+0xb/0x80 [fglrx]
Feb 20 20:27:10 than kernel:  [<f8a031bc>] drm_agp_enable+0x0/0xc4 [fglrx]
Feb 20 20:27:10 than kernel:  [<f89fd2e8>] _r6x_CheckAGPCommand+0x130/0x178 [fglrx]
Feb 20 20:27:10 than kernel:  [<f89f4617>] __ke_agp_enable+0x17/0x40 [fglrx]
Feb 20 20:27:10 than kernel:  [<f8a03240>] drm_agp_enable+0x84/0xc4 [fglrx]
Feb 20 20:27:10 than kernel:  [<f89f513e>] firegl_ioctl+0x166/0x1a4 [fglrx]
Feb 20 20:27:10 than kernel:  [<c015b6d9>] sys_ioctl+0x219/0x270
Feb 20 20:27:10 than kernel:  [<c0108cff>] syscall_call+0x7/0xb

A lot of Googling later, the fix that works for me was to find the function __ke_amd_adv_spec_cache_feature in /lib/modules/fglrx/build_mod/2.6.x/firegl_public.c and edit it so that it returned immediately; i.e. it should end up looking like this:

int __ke_amd_adv_spec_cache_feature(void)
{
        return 0;
}

Save and exit, then cd .. back up to build_mod, run ./make.sh, cd back up to fglrx and run ./make_install.sh. Just removing the offending function might not always be a good idea, but doing this lets me use X with hardware acceleration, and I have yet to notice any issues.