ATI (Українська)
Summary |
---|
An overview of the free software ATI/AMD video card driver. |
Related |
KMS |
Xorg |
This article describes the free driver (xf86-video-ati) for ATI/AMD video cards.
Contents
- 1 Naming conventions
- 2 Overview
- 3 Installation
- 4 Configuration
- 5 Kernel mode-setting (KMS)
- 6 Performance tuning
- 7 Powersaving
- 8 TV out
- 9 HDMI Audio
- 10 Dual Head Setup
- 11 Troubleshooting
- 11.1 I encounter artifacts when logging into my DE or WM
- 11.2 My card is painfully slow
- 11.3 AGP is disabled (with KMS)
- 11.4 My TV is showing a black border around the screen
- 11.5 No Desktop Effects in KDE4 with X1300 and Radeon Driver
- 11.6 Black screen and no console, but X works in KMS
- 11.7 2D performance (e.g. scrolling) is slow
- 12 Підтвердження
1 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.
2 Overview
The xf86-video-ati (radeon) driver requires kernel mode-setting. It hangs and crashes computers with recent enough Radeon GPUs since the drivers are designed to load and use nonfree microcode which we don't provide.
3 Installation
Install xf86-video-ati, available in the Official Repositories.
4 Configuration
Xorg will automatically load the driver and it will use your monitor's EDID to set the native resolution. Configuration is only required for tuning the driver.
If you want manual configuration, create /etc/X11/xorg.conf.d/20-radeon.conf, and add the following:
Section "Device" Identifier "Radeon" Driver "radeon" EndSection
Using this section, you can enable features and tweak the driver settings.
5 Kernel mode-setting (KMS)
KMS enables native resolution in the framebuffer and allows for instant console (tty) switching. It is enabled by default.
KMS for ATI video cards requires the Xorg free video user space driver xf86-video-ati version 6.12.4 or later.
5.1 Early KMS start
This method will start KMS as early as possible in the boot process (when the initramfs is loaded).
If you have a special kernel (e.g. linux-libre-zen), remember to use appropriate mkinitcpio configuration file, e.g. /etc/mkinitcpio-zen.conf. These instructions are written for the default kernel (linux-libre).
- Remove all vga= 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. video= can now be used in conjunction with KMS.
- Add radeon to MODULES array in /etc/mkinitcpio.conf. For AGP support, it is necessary to add intel_agp (or ali_agp, ati_agp, amd_agp, amd64_agp etc.) before the radeon module.
- Re-generate your initramfs: # mkinitcpio -p linux-libre
- AGP speed can be set with radeon.agpmode=x kernel option, where x is 1, 2, 4, 8 (AGP speed) or -1 (PCI mode).
- Reboot the system.
5.2 Late start
With this choice, KMS will be enabled when modules are loaded during the boot process.
If you have a special kernel (e.g. linux-libre-zen), remember to use appropriate mkinitcpio configuration file, e.g. /etc/mkinitcpio-zen.conf. These instructions are written for the default kernel (linux-libre).
- Remove all vga= 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. video= can now be used in conjunction with KMS.
- Add radeon to MODULES array in /etc/rc.conf. For AGP support, it may be necessary to add intel_agp (or ali_agp, ati_agp, amd_agp, amd64_agp etc.) before the radeon module.
- Reboot the system.
5.3 Troubleshooting KMS
5.3.1 Disable KMS
Users should consider disabling kernel mode-setting if encountering kernel panics, distorted framebuffer on boot, no GPU signal, Xorg refusing to start or 'POWER OFF' problem (kernel 2.6.33-2) at shutdown.
- 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). That should work. If you want to remove KMS support from the initramfs, follow the next two steps.
- If radeon was added to the MODULES array in mkinitcpio.conf to enable early start, remove it.
- Rebuild the initramfs with
# mkinitcpio -p linux-libre
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:
/etc/modprobe.d/radeon.conf
options radeon modeset=0
5.3.2 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.
6 Performance tuning
The following options apply to /etc/X11/xorg.conf.d/20-radeon.conf.
By design, xf86-video-ati runs at AGP 4x 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). If KMS is enabled, this option is not used and it is superseded by radeon.agpmode kernel option.
Option "AGPMode" "8"
ColorTiling is completely safe to enable and supposedly is enabled by default. Most users will notice increased performance but it is not yet supported on R200 and earlier cards. Can be enabled on earlier cards, but the workload is transferred to the CPU
Option "ColorTiling" "on"
Acceleration architecture; this will work only on newer cards. If you enable this and then cannot 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 cause instabilities, so be prepared to remove it if you cannot get into X. This option is not used when KMS is on.
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"
Bellow is a sample config file /etc/X11/xorg.conf.d/20-radeon.conf:
Section "Device" Identifier "My Graphics Card" Option "AGPMode" "8" #not used when KMS is on Option "AGPFastWrite" "off" #could cause instabilities enable it at your own risk Option "SWcursor" "off" #software cursor might be necessary on some rare occasions, hence set off by default Option "EnablePageFlip" "on" #supported on all R/RV/RS4xx and older hardware and set off by default Option "AccelMethod" "EXA" #valid options are XAA and EXA. EXA is the newest acceleration method and it is the default. Option "RenderAccel" "on" #enabled by default on all radeon hardware Option "ColorTiling" "on" #enabled by default on RV300 and later radeon cards. Option "EXAVSync" "off" #default is off, otherwise on Option "EXAPixmaps" "on" #when on icreases 2D performance, but may also cause artifacts on some old cards Option "AccelDFS" "on" #default is off, read the radeon manpage for more information EndSection
Defining the gartsize, if not autodetected, can be done with the following option:
In the kernel options (in this case syslinux.cfg):
APPEND root=/dev/sda1 ro 5 radeon.modeset=1 radeon.agpmode=8 radeon.gartsize=32 quiet
Size is in megabytes and 32 is for RV280 cards.
Alternatively, do it with a modprobe option in /etc/modprobe.d/radeon.conf:
options radeon gartsize=32
For further information and other options, read the radeon manpage and the module's info page:
man radeon
modinfo 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.
6.1 Activate PCI-E 2.0
Can be unstable with some motherboards or not produce any performarce, test yourself adding "radeon.pcie_gen2=1" on the kernel command line.
More info on Phoronix article
7 Powersaving
The powersaving part is totally different with and without KMS.
7.1 With KMS enabled
With the radeon driver, power saving is disabled by default but the stock kernel (2.6.35 as of this writing) provides a "sysfs" utility to enable it.
Power saving through KMS is still a work in progress for the most part. It should work, but some chips do have problems with it. A common issue for all is screen blinking when the kernel switches between power states, and in some configurations it even causes system freezes. But KMS is awesome, so it is your choice. The UMS method is generally more stable, however its power savings might not be as good as those provided by KMS options.
There a way to enable power management:
- Try adding radeon.dynpm=1 to the kernel parameters (if using the stock kernel < 2.6.35). If you are using Linux-libre kernel >= 2.6.35 this option is no longer needed and the sysfs interface will be present by default. If this option is passed to a kernel >= 2.6.35, the driver will fail and fall back to software rendering.
7.2 Without KMS
In your xorg.conf file, add 2 lines to "Device" Section:
Option "DynamicPM" "on" Option "ClockGating" "on"
If the two options are enabled successfully, you will see following lines in /var/log/Xorg.0.log:
(**) RADEON(0): Option "ClockGating" "on" (**) RADEON(0): Option "DynamicPM" "on"
Static power management enable success (II) RADEON(0): Dynamic Clock Gating Enabled (II) RADEON(0): Dynamic Power Management Enabled
If you desire low power cost, you can add an extra line to "Device" Section of xorg.conf:
Option "ForceLowPowerMode" "on"
8 TV out
Since August 2007, there is TV-out support for all Radeons with integrated TV-out.
It is somewhat limited for now, it does not 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 will go for a clone mode:
xrandr --output S-video --same-as VGA-0
So far so good. Now let us 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 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 configuration file.
8.1 Force TV-out in KMS
Kernel can recognize video= parameter in following form:
video=<conn>:<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
(see KMS)
For example:
video=DVI-I-1:1280x1024-24@60e
or
"video=9-pin DIN-1:1024x768-24@60e"
Parameters with whitespaces must be quoted. Current mkinitcpio implementation also requires # before. For example:
root=/dev/disk/by-uuid/d950a14f-fc0c-451d-b0d4-f95c2adefee3 ro quiet radeon.modeset=1 security=none # video=DVI-I-1:1280x1024-24@60e "video=9-pin DIN-1:1024x768-24@60e"
- Grub can pass such command line as is.
- Lilo needs backslashes for doublequotes (append="...... # .... \"video=9-pin DIN-1:1024x768-24@60e\"")
- Grub2: TODO
You can get list of your video outputs with following command:
ls -1 /sys/class/drm/ | grep -E '^card[[:digit:]]+-' | cut -d- -f2-
9 HDMI Audio
xf86-video-ati can enable HDMI audio output for all supported chipsets up to r7xx when using KMS. Just use xrandr to enable the output and Test as described below.
9.1 Testing HDMI Audio
- Connect your PC to the Display via HDMI cable.
- Use xrandr to get picture to the Display. Ex: xrandr --output DVI-D_1 --mode 1280x768 --right-of PANEL. Simply typing xrandr will give you a list of your valid outputs.
- 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]
- 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 Display.
- The audio module is disabled by default in kernel >=3.0. Add radeon.audio=1 to the end of your "kernel" line in /boot/grub/menu.lst to enable it.
- See this thread
- If the sound is distorted try setting tsched=0 and make sure rtkit daemon is running.
10 Dual Head Setup
10.1 Independent X Screens
Independent dual-headed setups can be configured the usual way. However you might want to know that the radeon driver has a "ZaphodHeads" option which allows you to bind a specific device section to an output of your choice, for instance using:
Section "Device" Identifier "Device0" Driver "radeon" Option "ZaphodHeads" "VGA-0" VendorName "ATI" BusID "PCI:1:0:0" Screen 0 EndSection
This can be a life-saver, because some cards which have more than two outputs (for instance one HDMI out, one DVI, one VGA), will only select and use HDMI+DVI outputs for the dual-head setup, unless you explicitely specify "ZaphodHeads" "VGA-0".
Moreover, this option allows you to easily select the screen you want to mark as primary.
11 Troubleshooting
11.1 I encounter artifacts when logging into my DE or WM
If you encounter artifacts, first try starting X without /etc/X11/xorg.conf. Recent versions of Xorg are capable of reliable auto-detection and auto-configuration for most use cases. Outdated or improperly configured xorg.conf files are known to cause trouble.
In order to run without a configuration tile, it is recommended that the xorg-input-drivers package group be installed.
Artifacts may also be related to kernel mode setting. Consider disabling KMS.
You may as well try disabling EXAPixmaps in /etc/X11/xorg.conf.d/20-radeon.conf:
Section "Device" Identifier "Radeon" Driver "radeon" Option "EXAPixmaps" "off" EndSection
Further tweaking could be done by disabling AccelDFS
Option "AccelDFS" "off"
11.2 My card is painfully slow
Buy a card which has acceleration support without using nonfree microcode (not one made by ATI/AMD).
11.3 AGP is disabled (with KMS)
If you experience poor performance and dmesg shows something like this
[drm:radeon_agp_init] *ERROR* Unable to acquire AGP: -19
then check if the agp driver for your motherboard (e.g., via_agp, intel_agp etc.) is loaded before the radeon module, see Enabling KMS.
11.4 My TV is showing a black border around the screen
When I connected my TV to my Radeon HD 5770 using the HDMI port, the TV showed a blurry picture with a 2-3cm border around it. In this case, Overscan can be turned off using xrandr:
xrandr --output HDMI-0 --set underscan off
11.5 No Desktop Effects in KDE4 with X1300 and Radeon Driver
A bug in KDE4 may prevent an accurate video hardware check, thereby deactivating desktop effects despite the X1300 having more than sufficient GPU power. A workaround may be to manually override such checks in KDE4 configuration files /usr/share/kde-settings/kde-profile/default/share/config/kwinrc and/or .kde/share/config/kwinrc.
Add:
DisableChecks=true
To the [Compositing] section. Ensure that compositing is enabled with:
Enabled=true
11.6 Black screen and no console, but X works in KMS
This is a solution to no-console problem that might come up, when using two or more ATI cards on the same PC. Fujitsu Siemens Amilo PA 3553 laptop for example has this problem. This is due to fbcon console driver mapping itself to wrong framebuffer device that exist on the wrong card. This can be fixed by adding a this to the kernel boot line:
fbcon=map:1
This will tell the fbcon to map itself to the /dev/fb1 framebuffer dev and not the /dev/fb0, that in our case exist on the wrong graphics card.
11.7 2D performance (e.g. scrolling) is slow
If you have problem with 2D performance, like scrolling in terminal or browser, you might need to add Option "MigrationHeuristic" "greedy" into the "Device" section of your xorg.conf file.
Bellow is a sample config file /etc/X11/xorg.conf.d/20-radeon.conf:
Section "Device" Identifier "My Graphics Card" Driver "radeon" Option "MigrationHeuristic" "greedy" EndSection