# Optimizing ATI graphics card performance [SOLVED]

## srunni

Hi,

I'm trying to get my ATI Radeon 3470 working under Gentoo x86. I installed x11-drivers/ati-drivers, but I'm only getting ~1000 FPS on average. Does anyone know how I can improve the performance?

Thanks!

----------

## Sadako

 *srunni wrote:*   

> Hi,
> 
> I'm trying to get my ATI Radeon 3470 working under Gentoo x86. I installed x11-drivers/ati-drivers, but I'm only getting ~1000 FPS on average. Does anyone know how I can improve the performance?
> 
> Thanks!

 ~1000 FPS in what, glxgears or fgl_glxgears?

----------

## srunni

~1000 FPS in glxgears

Running fgl_glxgears gives

```
Using GLX_SGIX_pbuffer

Segmentation fault
```

----------

## Sadako

Does `eselect opengl list` suggest it's using the ati-drivers implementation?

Is direct rendering enabled?

----------

## srunni

 *Hopeless wrote:*   

> Does `eselect opengl list` suggest it's using the ati-drivers implementation?

 It says it's using ``ati''. There are two choices: ``ati'' and ``xorg-x11''.

 *Hopeless wrote:*   

> Is direct rendering enabled?

 I don't know. How can I find out?

----------

## Sadako

 *srunni wrote:*   

>  *Hopeless wrote:*   Is direct rendering enabled? I don't know. How can I find out?

 `glxinfo | grep rendering`

Also search for any errors or warnings in your Xorg logs (`grep "EE\|WW" /var/log/Xorg.0.log`).

tbh, I stick with the open drivers, so not too experienced with this, but you may want to provide other information, such as the versions of the ati-drivers, xorg-server and kernel sources your using, and any other relevant system info.

----------

## srunni

 *Hopeless wrote:*   

> `glxinfo | grep rendering`

 Yeah, it's off: *Quote:*   

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

 Is that a kernel setting?

 *Hopeless wrote:*   

> Also search for any errors or warnings in your Xorg logs (`grep "EE\|WW" /var/log/Xorg.0.log`).

 

```
   (WW) warning, (EE) error, (NI) not implemented, (??) unknown.

(WW) The directory "/usr/share/fonts/TTF/" does not exist.

(WW) The directory "/usr/share/fonts/OTF" does not exist.

(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)

(II) Loading extension MIT-SCREEN-SAVER

(WW) fglrx(0): Failed to open DRM connection

(WW) fglrx(0): board is an unknown third party board, chipset is supported

(WW) fglrx(0): Only one display is connnected,so single mode is enabled

(WW) fglrx(0): No DRM connection for driver fglrx.

(EE) fglrx(0): atiddxDriScreenInit failed, GPS not been initialized. 

(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): ********************************************* *

(WW) fglrx(0): Textured Video not supported without DRI enabled.

(EE) fglrx(0): XMM failed to open CMMQS connection.

(EE) AIGLX: Screen 0 is not DRI capable

(EE) fglrx(0): PPLIB: PPLIB is not initialized!.
```

 *Hopeless wrote:*   

> tbh, I stick with the open drivers, so not too experienced with this, but you may want to provide other information, such as the versions of the ati-drivers,

 8.542

 *Hopeless wrote:*   

> xorg-server

 1.3.0.0-r6

 *Hopeless wrote:*   

> and kernel sources your using,

 gentoo-sources, 2.6.27-r5

 *Hopeless wrote:*   

> and any other relevant system info.

 Can't think of anything else.

----------

## d2_racing

Can you post this :

```

# cat /etc/X11/xorg.conf

```

----------

## srunni

```
Section "ServerLayout"

   Identifier     "X.org Configured"

   Screen      0  "Screen0" 0 0

   InputDevice    "Mouse0" "CorePointer"

   InputDevice    "Keyboard0" "CoreKeyboard"

   InputDevice    "Synaptics Touchpad"

EndSection

Section "Files"

   RgbPath      "/usr/share/X11/rgb"

   FontPath     "/usr/share/fonts/misc/"

   FontPath     "/usr/share/fonts/TTF/"

   FontPath     "/usr/share/fonts/OTF"

   FontPath     "/usr/share/fonts/Type1/"

   FontPath     "/usr/share/fonts/100dpi/"

   FontPath     "/usr/share/fonts/75dpi/"

EndSection

Section "Module"

   Load  "xtrap"

   Load  "dri"

   Load  "glx"

   Load  "dbe"

   Load  "extmod"

   Load  "GLcore"

   Load  "record"

   Load  "freetype"

   Load  "type1"

EndSection

Section "InputDevice"

   #Option "XkbModel" "pc105" 

   Identifier  "Keyboard0"

   Driver      "kbd"

   Option       "XkbModel" "thinkpad60"

   Option       "XkbLayout" "de"

EndSection

Section "InputDevice"

   Identifier  "Mouse0"

   Driver      "mouse"

   Option       "Protocol" "auto"

   Option       "Device" "/dev/input/mice"

   Option       "ZAxisMapping" "4 5 6 7"

EndSection

Section "InputDevice"

   Identifier  "Synaptics Touchpad"

   Driver      "synaptics"

   Option       "SendCoreEvents" "true"

   Option       "Device" "/dev/psaux"

   Option       "Protocol" "auto-dev"

   Option       "HorizEdgeScroll" "0"

   Option       "SHMConfig" "on"

EndSection

Section "Monitor"

   Identifier   "Monitor0"

   VendorName   "Monitor Vendor"

   ModelName    "Monitor Model"

EndSection

Section "Device"

   # Intel 

        ### Available Driver options are:- 

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False", 

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz" 

        ### [arg]: arg optional 

        #Option     "ShadowFB"              # [<bool>] 

        #Option     "DefaultRefresh"        # [<bool>] 

        #Option     "ModeSetClearScreen"    # [<bool>] 

   #Identifier  "Card0" 

   #Driver      "vesa" 

   #VendorName  "Intel Corporation" 

   #BoardName   "Unknown Board" 

   #BusID       "PCI:0:2:0" 

   # AMD ATI Radeon (open source)

   ### Available Driver options are:- 

        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False", 

        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz" 

        ### [arg]: arg optional 

        #Option     "NoAccel"               # [<bool>] 

        #Option     "AccelMethod"           # [<str>] 

        #Option     "offscreensize"         # [<str>] 

        #Option     "SWcursor"              # [<bool>] 

        #Option     "ignoreconnector"       # [<str>] 

        #Option     "forcereduced"          # [<bool>] 

        #Option     "forcedpi"              # <i> 

        #Option     "useconfiguredmonitor"    # [<bool>] 

        #Option     "HPD"                   # <str> 

        #Option     "NoRandr"               # [<bool>] 

        #Option     "RROutputOrder"         # [<str>] 

        #Option     "DRI" "True"                   # [<bool>] 

        #Option     "TVMode"                # [<str>] 

        #Option     "ScaleType"             # [<str>] 

        #Option     "UseAtomBIOS"           # [<bool>] 

        #Option     "AtomBIOS"              # [<str>] 

        #Option     "UnverifiedFeatures"    # [<bool>] 

   #Driver   "radeonhd" 

   #BusID   "PCI:1:0:0" 

   #VendorName  "ATI Technologies Inc" 

   #BoardName   "Unknown Board" 

   #BusID    

   # AMD ATI Radeon (binary)

      #Option   "BlockSignalsOnLock" "on"

   #Option   "KernelModuleParm" "locked-userpages=0"

   #Option   "OpenGLOverlay" "off"

   #Option   "UseFastTLS" "2"

   #Option   "UseInternalAGPGART" "no"

   #Option   "VideoOverlay" "on"

   #Option   "mtrr" "off"

   #Option   "no_accel" "no"

   #Option   "no_dri" "no"

   #Option   "EnablePrivateBackZ" "no"

   #Option   "backingstore" "true"

   Identifier  "Card0"

   Driver      "fglrx"

   Option       "VideoOverlay" "on"

   Option       "OpenGLOverlay" "off"

   BusID       "PCI:1:0:0"

EndSection

Section "Screen"

   #SubSection "Display" 

   #   Viewport   0 0 

   #   Depth     1 

   #EndSubSection 

   #SubSection "Display" 

   #   Viewport   0 0 

   #   Depth     4 

   #EndSubSection 

   #SubSection "Display" 

   #   Viewport   0 0 

   #   Depth     8 

   #EndSubSection 

   #SubSection "Display" 

   #   Viewport   0 0 

   #   Depth     15 

   #EndSubSection 

   #SubSection "Display" 

   #   Viewport   0 0 

   #   Depth     16 

   #EndSubSection 

   Identifier "Screen0"

   Device     "Card0"

   Monitor    "Monitor0"

   DefaultDepth     24

   SubSection "Display"

      Viewport   0 0

      Depth     24

   EndSubSection

EndSection

Section "dri"

   Mode 0666

EndSection
```

----------

## Sadako

 *srunni wrote:*   

>  *Quote:*   direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose Is that a kernel setting?

 No, it means  running glxinfo with tthat environmental variable set, ie `export LIBGL_DEBUG=verbose && glxinfo`, and see if it tells you anything of interest.

What's the output of `grep DRM /chroot/usr/src/linux/.config` and `lsmod`?

If fglrx isn't listed in lsmod, try simply modprobing it, and then restart your X server if it loads.

----------

## srunni

 *Hopeless wrote:*   

>  *srunni wrote:*    *Quote:*   direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose Is that a kernel setting? No, it means  running glxinfo with tthat environmental variable set, ie `export LIBGL_DEBUG=verbose && glxinfo`, and see if it tells you anything of interest.

 Nothing else came up when I grepped for ``rendering'', but here's the whole output anyway:

```
name of display: :0.0

display: :0  screen: 0

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

server glx vendor string: SGI

server glx version string: 1.2

server glx extensions:

    GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating, 

    GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method, 

    GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_hyperpipe, 

    GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig, GLX_MESA_copy_sub_buffer

client glx vendor string: SGI

client glx version string: 1.4

client glx extensions:

    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 

    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory, 

    GLX_MESA_swap_control, GLX_MESA_swap_frame_usage, GLX_OML_swap_method, 

    GLX_OML_sync_control, GLX_SGI_make_current_read, GLX_SGI_swap_control, 

    GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 

    GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 

    GLX_EXT_texture_from_pixmap

GLX version: 1.2

GLX extensions:

    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 

    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_OML_swap_method, 

    GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 

    GLX_EXT_texture_from_pixmap

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

OpenGL renderer string: Mesa GLX Indirect

OpenGL version string: 1.4 (1.5 Mesa 6.5.2)

OpenGL extensions:

    GL_ARB_depth_texture, GL_ARB_draw_buffers, GL_ARB_fragment_program, 

    GL_ARB_imaging, GL_ARB_multisample, GL_ARB_multitexture, 

    GL_ARB_occlusion_query, GL_ARB_point_parameters, GL_ARB_point_sprite, 

    GL_ARB_shadow, GL_ARB_shadow_ambient, GL_ARB_texture_border_clamp, 

    GL_ARB_texture_compression, GL_ARB_texture_cube_map, 

    GL_ARB_texture_env_add, GL_ARB_texture_env_combine, 

    GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, 

    GL_ARB_texture_mirrored_repeat, GL_ARB_texture_non_power_of_two, 

    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, GL_ARB_vertex_program, 

    GL_ARB_window_pos, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 

    GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 

    GL_EXT_blend_logic_op, GL_EXT_blend_minmax, GL_EXT_blend_subtract, 

    GL_EXT_clip_volume_hint, GL_EXT_copy_texture, GL_EXT_draw_range_elements, 

    GL_EXT_fog_coord, GL_EXT_framebuffer_object, GL_EXT_multi_draw_arrays, 

    GL_EXT_packed_pixels, GL_EXT_paletted_texture, GL_EXT_point_parameters, 

    GL_EXT_polygon_offset, GL_EXT_rescale_normal, GL_EXT_secondary_color, 

    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, 

    GL_EXT_shared_texture_palette, GL_EXT_stencil_wrap, GL_EXT_subtexture, 

    GL_EXT_texture, GL_EXT_texture3D, GL_EXT_texture_edge_clamp, 

    GL_EXT_texture_env_add, GL_EXT_texture_env_combine, 

    GL_EXT_texture_env_dot3, GL_EXT_texture_lod_bias, 

    GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, 

    GL_EXT_texture_rectangle, GL_EXT_vertex_array, GL_APPLE_packed_pixels, 

    GL_ATI_draw_buffers, GL_ATI_texture_env_combine3, 

    GL_ATI_texture_mirror_once, GL_ATIX_texture_env_combine3, 

    GL_IBM_texture_mirrored_repeat, GL_INGR_blend_func_separate, 

    GL_MESA_pack_invert, GL_MESA_ycbcr_texture, GL_NV_blend_square, 

    GL_NV_fragment_program, GL_NV_light_max_exponent, GL_NV_point_sprite, 

    GL_NV_texgen_reflection, GL_NV_texture_rectangle, GL_NV_vertex_program, 

    GL_NV_vertex_program1_1, GL_SGI_color_matrix, GL_SGI_color_table, 

    GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp, 

    GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_SGIX_depth_texture, 

    GL_SGIX_shadow, GL_SGIX_shadow_ambient, GL_SUN_multi_draw_arrays

   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav

 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat

----------------------------------------------------------------------

0x25 24 tc  0 24  0 r  y  .  8  8  8  0  0 16  0  0  0  0  0  0 0 None

0x26 24 tc  0 24  0 r  y  .  8  8  8  0  0 16  8 16 16 16  0  0 0 None

0x27 24 tc  0 32  0 r  y  .  8  8  8  8  0 16  8 16 16 16 16  0 0 None

0x28 24 tc  0 32  0 r  .  .  8  8  8  8  0 16  8 16 16 16 16  0 0 None

0x29 24 dc  0 24  0 r  y  .  8  8  8  0  0 16  0  0  0  0  0  0 0 None

0x2a 24 dc  0 24  0 r  y  .  8  8  8  0  0 16  8 16 16 16  0  0 0 None

0x2b 24 dc  0 32  0 r  y  .  8  8  8  8  0 16  8 16 16 16 16  0 0 None

0x2c 24 dc  0 32  0 r  .  .  8  8  8  8  0 16  8 16 16 16 16  0 0 None

0x2d  8 pc  0 24  0 c  y  .  0  0  0  0  0 16  0  0  0  0  0  0 0 None

0x2e  8 gs  0 24  0 c  y  .  0  0  0  0  0 16  0  0  0  0  0  0 0 None
```

 *Hopeless wrote:*   

> What's the output of `grep DRM /chroot/usr/src/linux/.config`

 

```
CONFIG_DRM=y

# CONFIG_DRM_TDFX is not set

# CONFIG_DRM_R128 is not set

# CONFIG_DRM_RADEON is not set

# CONFIG_DRM_I810 is not set

# CONFIG_DRM_I830 is not set

CONFIG_DRM_I915=y

# CONFIG_DRM_MGA is not set

# CONFIG_DRM_SIS is not set

# CONFIG_DRM_VIA is not set

# CONFIG_DRM_SAVAGE is not set
```

 *Hopeless wrote:*   

> and `lsmod`?

 

```
Module                  Size  Used by
```

 *Hopeless wrote:*   

> If fglrx isn't listed in lsmod, try simply modprobing it, and then restart your X server if it loads.

 There is no module ``fglrx''.

----------

## Sadako

 *srunni wrote:*   

>  *Hopeless wrote:*   What's the output of `grep DRM /chroot/usr/src/linux/.config` 
> 
> ```
> CONFIG_DRM=y
> 
> ...

 That's probably your problem right there, you have drm built into the kernel, which could be preventing fglrx from loading.

Try enabling DRM and DRM_I915 as modules instead, and make sure they're not loaded at boot.

Don't know how necessary this is, as I'd imagine you should be able to use the intel and ati cards at the same time, but maybe you can only use one or the other with hardware rendering with the closed ati drivers...

 *srunni wrote:*   

>  *Hopeless wrote:*   and `lsmod`? 
> 
> ```
> Module                  Size  Used by
> ```
> ...

 By this, do you mean it's just not listed, or that `modprobe fglrx` fails, complaining the module doesn't exist?

If it's the latter, you may need to re-emerge the ati-drivers packages, and make sure before you do so that the /usr/src/linux symlink is pointing to the kernel source tree that your currently running kernel was built from.

You can run `find /lib/modules/ -name fglrx*` to see what kernels that module is installed for.

----------

## srunni

 *Hopeless wrote:*   

>  *srunni wrote:*    *Hopeless wrote:*   What's the output of `grep DRM /chroot/usr/src/linux/.config` 
> 
> ```
> CONFIG_DRM=y
> 
> ...

 I just changed CONFIG_DRM to m and commented out the Intel one.

 *Hopeless wrote:*   

>  *srunni wrote:*    *Hopeless wrote:*   and `lsmod`? 
> 
> ```
> Module                  Size  Used by
> ```
> ...

 Both.

 *Hopeless wrote:*   

> If it's the latter, you may need to re-emerge the ati-drivers packages, and make sure before you do so that the /usr/src/linux symlink is pointing to the kernel source tree that your currently running kernel was built from.

 I did that, and now I'm getting ``ati-drivers-8.542 requires support for pci_find_slot'', so I'm working on finding that. I also see in the build messages: ``You have to Enable unused/obsolete exported symbols in Kernel hacking sectino of kernel config for fglrx to load''. I will have to check that as well.

 *Hopeless wrote:*   

> You can run `find /lib/modules/ -name fglrx*` to see what kernels that module is installed for.

 Ah, here we go. There is a fglrx.ko for 2.6.27-gentoo-r3, but I need it for 2.6.27-gentoo-r5. Can I just copy the file into the appropriate directory?

----------

## Sadako

 *srunni wrote:*   

>  *Hopeless wrote:*   If it's the latter, you may need to re-emerge the ati-drivers packages, and make sure before you do so that the /usr/src/linux symlink is pointing to the kernel source tree that your currently running kernel was built from. I did that, and now I'm getting ``ati-drivers-8.542 requires support for pci_find_slot'', so I'm working on finding that. I also see in the build messages: ``You have to Enable unused/obsolete exported symbols in Kernel hacking sectino of kernel config for fglrx to load''. I will have to check that as well.

 Ah yes, I had the same thing last time I tried the bibary drivers, that's what we get for minimal kernels.

For "pci_find_slot" you need CONFIG_PCI_LEGACY, available as "Enable deprecated pci_find_* API" under "Bus options (PCI etc.)" in menuconfig, 

and "unused/obsolete exported symbols" is under "kernel hacking", CONFIG_UNUSED_SYMBOLS in the config.

 *srunni wrote:*   

> 
> 
>  *Hopeless wrote:*   You can run `find /lib/modules/ -name fglrx*` to see what kernels that module is installed for. Ah, here we go. There is a fglrx.ko for 2.6.27-gentoo-r3, but I need it for 2.6.27-gentoo-r5. Can I just copy the file into the appropriate directory?

 It shouldn't work, but feel free to try it.

----------

## srunni

 *Hopeless wrote:*   

>  *srunni wrote:*    *Hopeless wrote:*   If it's the latter, you may need to re-emerge the ati-drivers packages, and make sure before you do so that the /usr/src/linux symlink is pointing to the kernel source tree that your currently running kernel was built from. I did that, and now I'm getting ``ati-drivers-8.542 requires support for pci_find_slot'', so I'm working on finding that. I also see in the build messages: ``You have to Enable unused/obsolete exported symbols in Kernel hacking sectino of kernel config for fglrx to load''. I will have to check that as well. Ah yes, I had the same thing last time I tried the bibary drivers, that's what we get for minimal kernels.
> 
> For "pci_find_slot" you need CONFIG_PCI_LEGACY, available as "Enable deprecated pci_find_* API" under "Bus options (PCI etc.)" in menuconfig, 
> 
> and "unused/obsolete exported symbols" is under "kernel hacking", CONFIG_UNUSED_SYMBOLS in the config.

 Yes, I enabled that and everything is working now! Thanks for the help!

----------

