ATI

From ArchWiki

(Redirected from ATI Radeon & Kernel 2.6)
Jump to: navigation, search
Summary
An overview of open source ATI/AMD video card drivers.
Related
ATI Catalyst
Intel
NVIDIA
Xorg

Owners of ATI video cards have a choice between ATI's proprietary driver (catalyst) and open source alternatives (xf86-video-ati or xf86-video-radeonhd).

Currently, the performance of the open source drivers are not on par with the proprietary driver in terms of 3D performance and lack certain features, such as reliable TV-out support. They do, however, offer better dual-head support (xf86-video-ati), excellent 2D acceleration, and provide sufficient 3D acceleration for OpenGL-accelerated window managers, such as Compiz or KWin. At this time, ATI Catalyst is not officially supported in Arch Linux.

If unsure, try the open source drivers first; they will suit most needs and are generally less problematic and flexible. (See the feature matrix for details.) For an overview of ATI's proprietary "Catalyst" video card driver, see ATI Catalyst; this article covers the open source drivers.

Contents

Naming conventions

ATI's Radeon brand follows a naming scheme that relates each product to a market segment. Within this article, readers will see both product names (e.g. HD 4850, X1900) and code or core names (e.g. RV770, R580). Traditionally, a product series will correspond to a core series (e.g. the "X1000" product series includes the X1300, X1600, X1800, and X1900 products which utilize the "R500" core series – including the RV515, RV530, R520, and R580 cores).

For a table of core and product series, see Wikipedia:Comparison of AMD graphics processing units.

Differences between open source drivers

xf86-video-ati (The radeon driver)

  • Works with Radeon chipsets up to HD4xxx (latest R700 chipsets) as well as HD5xxx (latest R800 chipsets).
  • Radeons up to the X1xxx series are fully supported, stable, and full 2D and 3D acceleration are provided.
  • Radeons from HD2xxx to X4xxx have full 2D acceleration and functional 3D acceleration, but are not supported by all the features that the proprietary driver provides (for example, powersaving is still in a testing phase).
  • Supports DRI1, RandR 1.2/1.3, EXA acceleration and Kernel-Mode-Setting/DRI2 (with the latest Linux kernel, libDRM and Mesa versions).
  • All cards from HD5xxx (R8xx) and newer are supported, but for now, with 2D support only.
Note: HDMI support will soon be implemented in xf86-video-ati over AtomBIOS.

xf86-video-radeonhd (The radeonhd driver)

  • Driver for ATI R500 chipsets (Radeon X1000 series) and newer.
  • Written by Novell with specifications provided to the public by AMD.
  • Supports RandR 1.2 and is under heavy development. It does also support HDMI with sound, (if your hardware is so equipped).

Generally, xf86-video-ati seems to offer more consistent performance as compared to xf86-video-radeonhd, so it should be your first choice, no matter which ATi card you own. xf86-video-radeonhd should be used as a "fallback" driver in case you encounter errors with xf86-video-ati.

Note: xf86-video-ati is recognised as "radeon" by Xorg (in xorg.conf) and xf86-video-radeonhd as "radeonhd". That's for those who get confused when they want to change the driver used by Xorg through xorg.conf.

Installation and configuration

Installation

Note: If you have previously installed the proprietary driver, make sure to remove catalyst and reboot.

To install xf86-video-ati :

pacman -S xf86-video-ati libgl ati-dri

To install xf86-video-radeonhd :

pacman -S xf86-video-radeonhd libgl ati-dri
Note: The GIT versions of these drivers can be found on AUR

Configuration

You now have the choice between creating an xorg.conf, or attempting to use the recently enabled Xorg autodetection.

Running Xorg without xorg.conf

In most cases, Xorg can autodetect your hardware settings. The Xorg.conf configuration file in /etc/X11 is optional since Xorg-server 1.5.x.

Always make sure you have HAL, mesa, the group xorg and the group xorg-input-drivers installed:

 pacman -S hal xorg-input-drivers mesa xorg

and that HAL has been added in DAEMONS array in /etc/rc.conf and is running.

Note: With KMS (Kernel Mode Setting) enabled, xorg.conf may not be needed at all. For more info on Radeon Kernel mode-setting, read this.

Running Xorg with expanded xorg.conf

Note: /etc/X11/xorg.conf no longer requires sections for all input devices because HAL can configure some/all via hotplugging. (Ensure HAL is running and xorg-input-drivers are installed.)

In case you want manual configuration, edit your xorg.conf, and add or make sure you have the following in their given sections:

Section "Module"
  Load  "glx"
  Load  "dri"
  Load  "drm"
EndSection

Device section for xf86-video-ati :

Section "Device"
 Identifier "name"                     # your alias
 Driver "radeon"
EndSection

Device section for xf86-video-radeonhd :

Section "Device"
 Identifier "name"                     # your alias
 Driver "radeonhd"
 Option "AccelMethod" "exa"            # to enable 2D and Xv acceleration on R6xx/R7xx - default AccelMethod shadowfb
 Option "DRI" "on"                     # to enable 2D and Xv acceleration on R6xx/R7xx - default DRI disabled
EndSection
Note: Try below for smooth performance,over Option "DRI", for RS780M/MN [Radeon HD 3200] using the radeonhd driver(as of 3rd May 2009)

This section (DRI) is not needed (thus deprecated), but use it if you encounter DRI related problems.

Section "DRI"
 Group        "video"
 Mode         0666
EndSection

Adding only the Device Section in the xorg.conf should fit most cases. Using that Section, you can enable features and tweak the driver's performance or behaviour.

When using the opensource drivers, ensure catalyst is not installed -- ati-dri is being used instead. Otherwise, the wrong libGL.so will be installed, which will cause direct rendering to fail.

Kernel mode-setting (KMS)

KMS enables native resolution in the framebuffer and allows for instant console (tty) switching. KMS also enables newer technologies (such as DRI2) which will help reduce artifacts and increase 3D performance, even kernel space power-saving.

KMS for ATI video cards requires the Xorg free video user space driver xf86-video-ati version 6.12.4 or later.

  • With kernel version 2.6.31, KMS is available and is enabled by default.
  • Since kernel version 2.6.32, KMS has been disabled by default and requires the software mentioned in the following section.

KMS mode for ATI is not officially supported at this time. DRI2-based ATI drivers remain experimental and the upstream developers are discouraging widespread distribution until stability is increased. After discussions with upstream developers the Arch Linux team has decided to disable KMS mode by default.

All DRI2 support has been removed from libdrm, mesa, and xf86-video-ati until DRI2 becomes the preferred implementation. In the meantime, DRI1 provides hardware acceleration. Enabling KMS will make Xorg fall back to software rasterizing, at the cost of 3D performance.

To test DRI2 hardware accelerated drivers at your own risk, continue reading.

Enabling experimental KMS

Warning: KMS on boot is not officially supported.

To enable KMS on boot:

  1. kernel26 version >= 2.6.32 is required.
  2. Recompile libdrm from ABS or either libdrm-newest or libdrm-git from AUR with the --enable-radeon-experimental-api option.
  3. Recompile mesa, libgl, and ati-dri from ABS or their GIT versions from AUR. (The mesa PKGBUILD from ABS provides all three of these packages (among others).)
  4. Compile and install xf86-video-ati from ABS or the latest development version xf86-video-ati-git from AUR.
  5. Follow one of the sections below for early or late start of KMS.

A more verbose guide can be found here.

Note: For now, only Radeons up to R7xx (HD 4xxx) support KMS, and only with the software mentioned above.

Early start

This method will start KMS as early as possible in the boot process (when the initramfs is loaded).

  1. Remove all vga= and video= options from the kernel line in the bootloader configuration file (/boot/grub/menu.lst for GRUB users). Using other framebuffer drivers (such as uvesafb or radeonfb) will conflict with KMS. Remove any framebuffer related modules from /etc/mkinitcpio.conf.
  2. Add radeon to MODULES array in /etc/mkinitcpio.conf. Depending on motherboard chipset, it may be necessary to add intel_agp before the radeon module. Previously, the fbcon module also needed to be listed to be able to switch to the console after X has started, but is now compiled into the default kernel.
  3. Re-generate your initramfs:
    # mkinitcpio -p kernel26
  4. Add radeon.modeset=1 to the kernel options in the bootloader configuration file to enable KMS.
  5. Reboot the system.

Late start

With this choice, KMS will be enabled when modules are loaded during the boot process.

  1. Remove all vga= and video= options from the kernel line in the bootloader configuration file (/boot/grub/menu.lst for GRUB users). Using other framebuffer drivers (such as uvesafb or radeonfb) will conflict with KMS. Remove any framebuffer related modules from /etc/mkinitcpio.conf.
  2. Add radeon to MODULES array in /etc/rc.conf. Depending on motherboard chipset, it may be necessary to add intel_agp before the radeon module. Previously, the fbcon module also needed to be listed to be able to switch to the console after X has started, but is now compiled into the default kernel.
  3. Reboot the system.
Tip: Some users have reported faster udev module loading by adding options radeon modeset=1 to /etc/modprobe.d/modprobe.conf.

Troubleshooting KMS

Disable KMS

Users should consider disabling kernel mode-setting if encountering kernel panics, distorted framebuffer on boot, Xorg refusing to start, or Xorg falling back to Mesa software rasterizer (no 3D acceleration).

  1. Add radeon.modeset=0 (or nomodeset, if this does not work) to the kernel options line in the bootloader configuration file (/boot/grub/menu.lst for GRUB users).
  2. If radeon was added to the MODULES array in mkinitcpio.conf to enable early start, remove it.
  3. Rebuild the initramfs with
    # mkinitcpio -p kernel26
Warning: Catalyst users will likely need to blacklist the radeon module by adding !radeon to the MODULES array in /etc/rc.conf.

Alternatively, module options can be specified in a file within the /etc/modprobe.d directory. If using the radeon module (lsmod | grep radeon) disable KMS by creating a file containing the above code:

File: /etc/modprobe.d/radeon.conf
options radeon modeset=0

Renaming xorg.conf

Renaming /etc/X11/xorg.conf, which may include options that conflict with KMS, will force Xorg to autodetect hardware with sane defaults. After renaming, restart Xorg.

Performance tuning

The following options apply to Section "Device" in /etc/X11/xorg.conf.

Tuning performance with xf86-video-ati

By design, xf86-video-ati runs at AGP 1x speed. It is generally safe to modify this. If you notice hangs, try reducing the value or removing the line entirely (you can use values 1, 2, 4, 8).

       Option "AGPMode" "4"

ColorTiling is completely safe to enable and supposedly is enabled by default. People have noticed a performance increase when enabled via xorg.conf.

       Option "ColorTiling" "on"

Acceleration architecture; this will work only on newer cards. If you enable this and then can't get back into X, remove it.

       Option "AccelMethod" "EXA"

Page Flip is generally safe to enable. This would mostly be used on older cards, as enabling this would disable EXA. With recent drivers can be used together with EXA.

       Option "EnablePageFlip" "on" 

AGPFastWrite will enable fast writes for AGP cards. This one can be problematic, so be prepared to remove it if you can't get into X.

       Option "AGPFastWrite" "yes"

EXAVSync option attempts to avoid tearing by stalling the engine until the display controller has passed the destination region. It reduces tearing at the cost of performance and has been know to cause instability on some chips. Really useful when enabling Xv overlay on videos on a 3D accelerated desktop. It is not necessary when KMS (thus DRI2 acceleration) is enabled.

      Option "EXAVSync" "yes"

See an example Device Section in xorg.conf:

Section "Device"
       Identifier  "My Graphics Card"
       Driver      "radeon"
       Option      "DRI" "on" 
       Option      "DynamicPM" "on"      # Dynamic powersaving.
       Option      "ClockGating" "on"    # Assisting option for powersaving.
       Option      "AccelMethod" "EXA"   # EXA should fit most cases.
       Option      "EXAVSync" "on"       # EXAVSync is explained above.
       Option      "DMAForXv" "on"       # Forced option in order to enable Xv overlay.
       Option      "ScalerWidth" "2048"  # That should fix some very rare bugs.
       Option      "EnablePageFlip" "on" # It will not be enabled on R5xx cards.
       Option      "RenderAccel" "on"    # Optional. It should be enabled by default.
       Option      "AccelDFS" "on"       #Optional. See the man page.
       BusID       "PCI:1:0:0"
EndSection


See the manpage for more configuration options. man radeon

A fine tool to try is driconf. It will allow you to modify several settings, like vsync, anisotropic filtering, texture compression, etc. Using this tool it is also possible to "disable Low Impact fallback" needed by some programs (e.g. Google Earth).

Tuning performance with xf86-video-radeonhd

TODO

Powersaving

With KMS enabled

TODO (After kernel26>=2.6.34 passes to [core]

Without KMS

TODO

TV out

Since August 2007, there is TV-out support for all Radeons with integrated TV-out.

It is somewhat limited for now, it doesn't always autodetect the output correctly and only NTSC mode works.

First, check that you have an S-video output: xrandr should give you something like

Screen 0: minimum 320x200, current 1024x768, maximum 1280x1200
...
S-video disconnected (normal left inverted right x axis y axis)

Now we should tell Xorg that it is actually connected (it is, right?)

xrandr --output S-video --set load_detection 1

Setting tv standard to use:

xrandr --output S-video --set tv_standard ntsc

Adding a mode for it (currently it supports only 800x600):

xrandr --addmode S-video 800x600

I'll go for a clone mode:

xrandr --output S-video --same-as VGA-0

So far so good. Now let's try to see what we have:

xrandr --output S-video --mode 800x600

At this point you should see a 800x600 version of your desktop on your TV.

To disable the output, do

xrandr --output S-video --off

Also you may notice that the video is being played on monitor only and not on the TV. Where the Xv overlay is sent is controlled by XV_CRTC attribute.

To send the output to the TV, I do

xvattr -a XV_CRTC -v 1
Note: you need to install xvattr from AUR to execute this command.

To switch back to my monitor, I change this to 0. -1 is used for automatic switching in dualhead setups.

Please see Enabling TV-Out Statically for how to enable TV-out in your xorg config file.

HDMI with sound

Given that your hardware supports it, and you have installed xf86-video-radeonhd (note: The driver xf86-video-ati will soon get HDMI support.) you can insert the following into xorg.conf to enable HDMI with sound:

Section "Device"
  # ...
  Option "Audio" "on"
  Option "HDMI" "all"
EndSection

Restart X when you have done this, try to see if there is sound transmitted to TV via HDMI cable.

  1. Connect your PC to the TV via HDMI cable (duh).
  2. Use xrandr to get picture to the TV. Ex: xrandr --output DVI-D_1 --mode 1280x768 --right-of PANEL. Simply typing xrandr will give you a list of your valid outputs.
  3. Run aplay -l to get the list of your sound devices. Find HDMI and note the card number and corresponding device number. Example of what you want to see: card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
  4. Try sending sound to this device: aplay -D plughw:1,3 /usr/share/sounds/alsa/Front_Center.wav. Be sure to change plughw:z,y to match your hardware number found with last command. You should be able to hear the test sound from your TV.

Note on RV730 and RV710

xf86-video-radeonhd does not support yet audio through HDMI for these chipsets, but work is in progress.

Troubleshooting (xf86-video-ati & xf86-video-radeonhd)

I encounter artifacts when I am trying to login into my DE or WM

If you seem to have artifacts, first choose to login into your favorite DE or WM without xorg.conf in /etc/X11/. Most people try to create a proper xorg.conf for their system, but sometimes it may cause trouble.

If you do that, don't forget to have HAL installed and running, and the group xorg-input-drivers installed.

Warning: It is possible that those issues are KMS related. If that is the problem, disable KMS.

I have switched from catalyst to radeonhd or radeon and some things don't work

First of all, don't panic. Uninstall catalyst, install xf86-video-radeonhd or xf86-video-ati and then reboot.

Make sure you are not using the xorg.conf generated by catalyst. Your original should have been backed up and you can recall it:

cp /etc/X11/xorg.conf.original-0 /etc/X11/xorg.conf

Otherwise, stop your graphical server if running, and in a tty, type as root:

Xorg -configure
mv xorg.conf.new /etc/X11/xorg.conf

and make sure you put the required options.

If it still doesn't solve your problem, know that apparently catalyst has the bad idea to replace Xorg files with symbolic links pointing to its own files. The easiest at this point is to uninstall all catalyst stuff (just to be on the safe side) and then to reinstall xorg, libgl, ati-dri and xf86-video-radeonhd or xf86-video-ati.

If it still doesn't work, then have a look into the forum, your problem might be a configuration issue.

Note: When you switch to xf86-video-ati or xf86-video-radeonhd, remember that you can login without xorg.conf as well (without problems in most cases), since Xorg can autodetect your settings. So xorg.conf is optional.

I have installed a free driver and my card is painfully slow

Some cards can be installed by default trying to use KMS. You can check whether this is your case running:

dmesg | egrep "drm|radeon"

This command might show something like this, meaning it is trying to default to KMS:

[drm] radeon default to kernel modesetting.
...
[drm:radeon_driver_load_kms] *ERROR* Failed to initialize radeon, disabling IOCTL

If you know your card is not supposed to support KMS (read the link above), then you can disable KMS. This should fix the problem.

Personal tools