# fglrx drivers don't work...

## einheitlix

Hi,

I've been searching the forums for this problem but I didn't find a solution.

I'm using an ATI Radeon 9600 Pro card and it seems to me that the hardware acceleration is not working (it's reeeeaaaally slow when I start tuxracer, and normally my system should definetly be able to handle it  :Wink: ).

I'm using the 2.6.8-gentoo-r1 kernel:

```

root@fuchur:~ # uname -a

Linux fuchur 2.6.8-gentoo-r1 #1 Fri Aug 20 20:20:04 CEST 2004 i686 AMD Athlon(tm) XP 2500+ AuthenticAMD GNU/Linux

```

Now, after compiling the kernel, I tried a

```

root@fuchur:~ # emerge ati-drivers

root@fuchur:~ # opengl-update ati

```

But it doesn't work. This is what fglrxinfo outputs:

```

root@fuchur:~ # /opt/ati/bin/fglrxinfo

display: :0.0  screen: 0

OpenGL vendor string: Mesa project: www.mesa3d.org

OpenGL renderer string: Mesa GLX Indirect

OpenGL version string: 1.3 Mesa 4.0.4

```

I also tried stustills Howto from https://forums.gentoo.org/viewtopic.php?t=54793&start=0#328949 I.e. first I edited /etc/make.conf to set VIDEO_CARDS="radeon -sis -rage128 -matrox -3dfx -gamma -i8x0"

Then I did:

```

root@fuchur:~ # emerge xfree-drm

Calculating dependencies ...done!

>>> emerge (1 of 1) x11-base/xfree-drm-4.3.0-r7 to /

>>> md5 src_uri ;-) xfree-drm-4.3.0-r7-gentoo-0.4.tar.bz2

>>> md5 src_uri ;-) linux-drm-4.3.0-kernelsource-20031202.tar.bz2

!!! ERROR: x11-base/xfree-drm-4.3.0-r7 failed.

!!! Function pkg_setup, Line 71, Exitcode 0

!!! Please link //usr/src/linux to 2.4 kernel sources. xfree-drm does not yet work with 2.6 kernels, use the DRM in the kernel.

```

In other words, that howto doesn't work for me, as I am using a 2.6 kernel.

Does this mean I won't be able to use hardware acceleration with my 2.6 kernel? Is it really possible that one can't have 3d acceleration with a radeon 9600 and a 2.6 kernel? I wouldn't like to switch back to a 2.4 kernel, I'm quite happy with the new one...

Or is there any other way to make this work?

[add]

Oh yes, here is my modules list:

```

root@fuchur:~ # lsmod

Module                  Size  Used by

fglrx                 211044  -

```

----------

## einheitlix

After some more investigating, here are some supplementary infos that might be interesting.

I do have AGP support for ATI and DRM for the Radeon chipset compiled into the kernel.

This is an extract of my /usr/src/linux/.config

```

#

# Ftape, the floppy tape device driver

#

# CONFIG_FTAPE is not set

CONFIG_AGP=y

# CONFIG_AGP_ALI is not set

CONFIG_AGP_ATI=y

# CONFIG_AGP_AMD is not set

# CONFIG_AGP_AMD64 is not set

# CONFIG_AGP_INTEL is not set

# CONFIG_AGP_INTEL_MCH is not set

# CONFIG_AGP_NVIDIA is not set

# CONFIG_AGP_SIS is not set

# CONFIG_AGP_SWORKS is not set

# CONFIG_AGP_VIA is not set

# CONFIG_AGP_EFFICEON is not set

CONFIG_DRM=y

# CONFIG_DRM_TDFX is not set

# CONFIG_DRM_GAMMA is not set

# CONFIG_DRM_R128 is not set

CONFIG_DRM_RADEON=y

# CONFIG_DRM_MGA is not set

# CONFIG_DRM_SIS is not set

# CONFIG_MWAVE is not set

# CONFIG_RAW_DRIVER is not set

# CONFIG_HPET is not set

# CONFIG_HANGCHECK_TIMER is not set

```

The lines

```

Load "glx"

Load "dri" 

```

are uncommented and present in /etc/X11/XF86Config

Here is my graphics device section from /etc/X11/XF86Config

```

# **********************************************************************

# Graphics device section

# **********************************************************************

# Any number of graphics device sections may be present

# Standard VGA Device:

Section "Device"

    Identifier  "Standard VGA"

    VendorName  "Unknown"

    BoardName   "Unknown"

# The chipset line is optional in most cases.  It can be used to override

# the driver's chipset detection, and should not normally be specified.

#    Chipset     "generic"

# The Driver line must be present.  When using run-time loadable driver

# modules, this line instructs the server to load the specified driver

# module.  Even when not using loadable driver modules, this line

# indicates which driver should interpret the information in this section.

    Driver      "vga"

# The BusID line is used to specify which of possibly multiple devices

# this section is intended for.  When this line isn't present, a device

# section can only match up with the primary video device.  For PCI

# devices a line like the following could be used.  This line should not

# normally be included unless there is more than one video device

# installed.

#    BusID       "PCI:0:10:0"

#    VideoRam    256

#    Clocks      25.2 28.3

EndSection

# === ATI device section ===

Section "Device"

    Identifier                          "ATI Graphics Adapter"

    Driver                              "fglrx"

# ### generic DRI settings ###

# === disable PnP Monitor  ===

    #Option                              "NoDDC"

# === disable/enable XAA/DRI ===

    Option "no_accel"                   "no"

    Option "no_dri"                     "no"

# === misc DRI settings ===

    Option "mtrr"                       "off" # disable DRI mtrr mapper, driver has its own code for mtrr

# ### FireGL DDX driver module specific settings ###

# === Screen Management ===

    Option "DesktopSetup"               "0x00000100" 

    Option "MonitorLayout"              "AUTO, AUTO"

    Option "IgnoreEDID"                 "off"

    Option "HSync2"                     "31.5       " 

    Option "VRefresh2"                  "50 - 70" 

    Option "ScreenOverlap"              "0" 

# === TV-out Management ===

    Option "NoTV"                       "no"     

    Option "TVStandard"                 "PAL-G"     

    Option "TVHSizeAdj"                 "0"     

    Option "TVVSizeAdj"                 "0"     

    Option "TVHPosAdj"                  "0"     

    Option "TVVPosAdj"                  "0"     

    Option "TVHStartAdj"                "0"     

    Option "TVColorAdj"                 "0"     

    Option "GammaCorrectionI"           "0x00000000"

    Option "GammaCorrectionII"          "0x00000000"

# === OpenGL specific profiles/settings ===

    Option "Capabilities"               "0x00000000"

# === 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"

# === Center Mode (Laptops only) ===

    Option "CenterMode"                 "off"

# === Pseudo Color Visuals (8-bit visuals) ===

    Option "PseudoColorVisuals"         "off"

# === QBS Management ===

    Option "Stereo"                     "off"

    Option "StereoSyncEnable"           "1"

# === FSAA Management ===

    Option "FSAAEnable"                 "no"

    Option "FSAAScale"                  "1"

    Option "FSAADisableGamma"           "no"

    Option "FSAACustomizeMSPos"         "no"

    Option "FSAAMSPosX0"                "0.000000"

    Option "FSAAMSPosY0"                "0.000000"

    Option "FSAAMSPosX1"                "0.000000"

    Option "FSAAMSPosY1"                "0.000000"

    Option "FSAAMSPosX2"                "0.000000"

    Option "FSAAMSPosY2"                "0.000000"

    Option "FSAAMSPosX3"                "0.000000"

    Option "FSAAMSPosY3"                "0.000000"

    Option "FSAAMSPosX4"                "0.000000"

    Option "FSAAMSPosY4"                "0.000000"

    Option "FSAAMSPosX5"                "0.000000"

    Option "FSAAMSPosY5"                "0.000000"

# === Misc Options ===

    Option "UseFastTLS"                 "0"

    Option "BlockSignalsOnLock"         "on"

    Option "UseInternalAGPGART"         "yes"

    Option "ForceGenericCPU"            "no"

    BusID "PCI:3:0:0"    # vendor=1002, device=4150

    Screen 0

EndSection

```

Also, it doesn't make any difference whether I set the option "UseInternalAGPGART" to "yes" or "no" in my /etc/X11/XF86Config

I really don't know what else I could try.

Any ideas... please?

----------

## yinyang

In these stepes you should be able to make hardware acceleration work:

- choose /dev/agpgart support as a module for your mainboard chipset

- DON'T select anything drm related (neither ebuild nor kernel options)

- set UseInternalAGPGART to "no"

- reinstall the ati-drivers if you had to recompile the kernel

- load the fglrx module and restart X and hopefully you should have hardware accel

----------

## einheitlix

Thank you for your answer!

But no... it still doesn't work  :Sad: 

This is what I did:

1. I chose /dev/agpgart support as a module and unselected the DRM related options

Now the relevant part of my .config file looks like this:

```

#

# Ftape, the floppy tape device driver

#

# CONFIG_FTAPE is not set

CONFIG_AGP=m

# CONFIG_AGP_ALI is not set

CONFIG_AGP_ATI=m

# CONFIG_AGP_AMD is not set

# CONFIG_AGP_AMD64 is not set

# CONFIG_AGP_INTEL is not set

# CONFIG_AGP_INTEL_MCH is not set

# CONFIG_AGP_NVIDIA is not set

# CONFIG_AGP_SIS is not set

# CONFIG_AGP_SWORKS is not set

# CONFIG_AGP_VIA is not set

# CONFIG_AGP_EFFICEON is not set

# CONFIG_DRM is not set

# CONFIG_MWAVE is not set

# CONFIG_RAW_DRIVER is not set

# CONFIG_HPET is not set

# CONFIG_HANGCHECK_TIMER is not set

```

2. I compiled that kernel and rebooted...  :Wink: 

3. I unmerged xfree-drm

4. I set UseInternalAGPGART in /etc/X11/XF86Config to "no"

5. I reemerged the ati-drivers

6. I restarted X

But still, I don't have hardware acceleration...  :Sad: 

Here is what lsmod not outputs:

```

root@fuchur:~ # lsmod

Module                  Size  Used by

fglrx                 211044  -

agpgart                27400  -

```

And /opt/ati/bin/fglrxinfo still says

```

root@fuchur:~ # /opt/ati/bin/fglrxinfo

display: :0.0  screen: 0

OpenGL vendor string: Mesa project: www.mesa3d.org

OpenGL renderer string: Mesa GLX Indirect

OpenGL version string: 1.3 Mesa 4.0.4

```

What else could I try?  :Sad: 

Maybe this is interesting: when I try, to execute fgl_gxgears, it says it couldn't get fbconfig.

```

root@fuchur:~ # /opt/ati/bin/fgl_glxgears

Error: couldn't get fbconfig

```

Is this of any interest for me... or is this just normal when you don't have hardware acceleration?

----------

## Texas

 *einheitlix wrote:*   

> Thank you for your answer!
> 
> But no... it still doesn't work 
> 
> 

 

Of course you havn't forgotten to run "opengl-update ati"?

/Johan

----------

## Texas

BTW, how many fps do you guys get with fgl_glxgears and on what hardware?

I get about 220 fps on a Radeon 9600, Athlon XP 2000+, Ati 3.11.1 drivers. This is painfully slow in my opinion, it feels like something is wrong?

When I try to blit a 640x480 pixel large surface in SDL I can't even sustain 30 fps, the cpu is at 100% at about 17 fps. Of cource this has nothing to to with OpenGL acceleration but it should be way faster than this, shouldn't it?

/Johan

----------

## einheitlix

Well, for me, I don't really know what results I would get with fgl_glxgears as it doesn't work yet  :Sad: 

And yes, I think I did an opengl-update ati. (Actually I was already using the ati interface, I switched to it before)

Before reading your post, I tried to unmerge xfree and emerge xorg-x11

When I do a opengl-update xorg-x11, it says it couldn't get fbconfig.

But after doing an opengl-update ati, there's a little progress with fgl_glxgears. When I start it, I can see a black windows popping up for half a second or so, then it crashes and writes in the prompt:

```

root@fuchur:~ # /opt/ati/bin/fgl_glxgears

X Error of failed request:  BadMatch (invalid parameter attributes)

  Major opcode of failed request:  143 (GLX)

  Minor opcode of failed request:  5 (X_GLXMakeCurrent)

  Serial number of failed request:  31

  Current serial number in output stream:  31

```

Other than that, I got the idea to have a look at /var/log/Xorg.0.log

It's very interesting, although I have no idea how I could fix it.

Here's an extract that might be interesting from my /var/log/Xorg.0.log:

 *Quote:*   

> 
> 
> (==) fglrx(0): HPV inactive
> 
> (==) fglrx(0): FSAA enabled: NO
> ...

 

I only posted a part of the log so as to not overload the post.

If it can be of any help, here's my entire log:

http://scummunity.de/~malte/Xorg.0.log

And here's my .config file:

http://scummunity.de/~malte/.config

Please help me!

----------

## sickboy2583

Just a note (and I may be wrong !!): When I switched to kernel 2.6.8 I tried and tried but could not get 3D acceleration working on my Radeon 9600. Tried agpgart as modules and internal etc etc.

When I switch to kerbel-2.6.7-r11 everthing worked perfectly.    :Cool: 

So if all else fails I suggest trying kernel 2.6.7-r11

----------

## Wedge_

einheitlix: the kernel AGP configuration options have nothing to do with the type of graphics card that you have. I believe the ATI option is for motherboards with integrated ATI graphics chips. It's definitely not for AGP cards. What you need to is select the option the matches the type of motherboard you have - if it's a nForce board, pick the nVidia option, if it's an Intel based board, pick the Intel option etc etc. Check the link in my sig if you still have problems, it might be helpful.

----------

## Texas

 *einheitlix wrote:*   

> Well, for me, I don't really know what results I would get with fgl_glxgears as it doesn't work yet 
> 
> And yes, I think I did an opengl-update ati. (Actually I was already using the ati interface, I switched to it before)
> 
> Before reading your post, I tried to unmerge xfree and emerge xorg-x11
> ...

 

Allrigt, are you sure your agp chipset is supported by the CONFIG_AGP_ATI-driver? Secondly, the ati module should be loaded;

```
modprobe ati-agp
```

I havn't tried xorg with the ati-drivers so I don't know more about that. But you should focus on getting the agp-stuff right first I'd say.

/Johan

----------

## einheitlix

Yahoooo!

Thanks. Silly me, I configured the AGP support with ATI chipset support, instead of nForce2 chipset support. When I configured AGP, I first saw "ATI chipset" and thought, "Ah, I have an ATI card, must be the right option" and I didn't even read further. Had I done that, I would have noticed that there is an option for nForce2 boards, which obviously is the right one for me (as I have an ASUS A7N8X Deluxe with nForce2 chipset).

Curiously, I *have* to configure the AGP support as built-in. When I configure it as module, it doesn't work (same error as above: unable to acquire AGP, error "xf86_ENODEV", etc.)

Well, doesn't matter much to me. The important thing is that it works  :Wink: 

@Texas, as you asked:

```

malte@fuchur:~> fgl_glxgears

2547 frames in 5.0 seconds = 509.400 FPS

2593 frames in 5.0 seconds = 518.600 FPS

2643 frames in 5.0 seconds = 528.600 FPS

2571 frames in 5.0 seconds = 514.200 FPS

2597 frames in 5.0 seconds = 519.400 FPS

```

As I'm rather curious, I still have a few questions left  :Wink: 

- Why do I have to compile the AGP support as built-in rather than as a module? Any ideas?

- Why does it say "couldn't get fbconfig" when starting fgl_glxgears after doing a opengl-update xorg-x11? It only works after a opengl-update ati. I'd like to compare the benchmarks from both, and I do have xorg-x11, so why doesn't it work with xorg-x11 OpenGL interface...?

- As I don't have any DRM support in the kernel, nor the xfree-drm ebuild (which I unmerged, as shown in some above post)... how come I'm able to enable DRM? I mean, /var/log/Xorg.0.log says:

```

(II) fglrx(0): [drm] loaded kernel module for "fglrx" driver

(II) fglrx(0): [drm] created "fglrx" driver at busid "PCI:3:0:0"

(II) fglrx(0): [drm] added 8192 byte SAREA at 0xe19c6000

(II) fglrx(0): [drm] mapped SAREA 0xe19c6000 to 0x4029d000

(II) fglrx(0): [drm] framebuffer handle = 0xb0000000

(II) fglrx(0): [drm] added 1 reserved context for kernel

```

etc...

- How could I speed it up further?  :Wink: 

----------

## Wedge_

 *Quote:*   

> - Why do I have to compile the AGP support as built-in rather than as a module? Any ideas?

 

In theory either way should work, but sometimes you'll find that only one does. On my laptop for example (SiS chipset), it only works if I use modules. It really doesn't matter as  long as it works, there's no performance difference or anything. 

 *Quote:*   

> - Why does it say "couldn't get fbconfig" when starting fgl_glxgears after doing a opengl-update xorg-x11? It only works after a opengl-update ati. I'd like to compare the benchmarks from both, and I do have xorg-x11, so why doesn't it work with xorg-x11 OpenGL interface...?

 

It might be written with the ATI OpenGL libs in mind and use some nonstandard features that they have. It's not meant to be used as a benchmark anyway, so don't worry about it.

 *Quote:*   

> - As I don't have any DRM support in the kernel, nor the xfree-drm ebuild (which I unmerged, as shown in some above post)... how come I'm able to enable DRM? 

 

The fglrx driver itself provides DRM support. That's why you should remove everything else that might try to provide DRM - more often than not they'll interfere with each other.

 *Quote:*   

> - How could I speed it up further?

 

There's not much you can do in this area yet. Try adding the line 

```
Option "EnablePrivateBackZ" "yes"
```

 to your config file, and set "UseFastTLS" to "2". Don't enable FSAA  :Smile:  You might get a very small boost from doing that, but if you're looking for whole bunch of settings to play with like the Windows Cats have, you're out of luck.

----------

## einheitlix

Thanks, that was very instructive  :Smile: 

 *Wedge_ wrote:*   

> 
> 
> It might be written with the ATI OpenGL libs in mind and use some nonstandard features that they have. It's not meant to be used as a benchmark anyway, so don't worry about it.
> 
> 

 

Of course! Why haven't I thought about this before? The "standard" glxgears works fine with both. No noticeable difference, though. I'll go with the ati interface as it's probably the one which is better suited for my card.

You're right, it's not meant as a benchmark - but it DOES show the number of frames per second you reach, doesn't it?  :Wink: 

Actually, I only wanted to speed it up because I had the feeling that 500 FPS weren't that much. But with glxgears, I get slightly over 3050 FPS, that's great  :Smile: 

I did however, try out your tips.

The thing with PrivateBackZ actually slowed me down, at least I only got slightly over 2300 FPS with that.

I have the feeling that the UseFastTLS thing made it a bit quicker, but I'm not sure... only 1 or 2 FPS, if any.

And FSAA was already disabled anyways  :Smile: 

I thought I could also try to set the color depth to 16 bpp instead of 24, but the fglrx drivers don't support that.

But over 3050 fps are more than enough, anyway.

Thanks again!

----------

