Difference between revisions of "ATI"

From ArchWiki
Jump to navigation Jump to search
m (→‎Introduction: note on aiglx. removed beryl mention.)
(update Pkg/AUR templates)
Tag: wiki-scripts
 
(928 intermediate revisions by more than 100 users not shown)
Line 1: Line 1:
[[Category: Graphics (English)]]
+
[[Category:Graphics]]
[[Category: X Server (English)]]
+
[[Category:X server]]
[[Category: HOWTOs (English)]]
+
[[de:ATI]]
 +
[[es:ATI]]
 +
[[fr:ATI]]
 +
[[it:ATI]]
 +
[[ja:ATI]]
 +
[[pl:ATI]]
 +
[[ru:ATI]]
 +
[[zh-hans:ATI]]
 +
{{Related articles start}}
 +
{{Related|AMD Catalyst}}
 +
{{Related|AMDGPU}}
 +
{{Related|Xorg}}
 +
{{Related|Vulkan}}
 +
{{Related articles end}}
  
= Introduction =
+
This article covers the [https://wiki.freedesktop.org/xorg/radeon/ radeon] open source driver which supports the majority of AMD (previously ATI) GPUs.
ATI owners have two options for drivers. If you are unsure which driver to use, try the open-source one first. The open-source driver will suit most needs and is generally less problematic.
 
  
The proprietary driver, version 7.10 (8.42.3) and later, supports [[AIGLX]] (though buggy). To use composite managers such as [[Compiz Fusion]] or [[Compiz]]  you can now use the open-source driver or the proprietary driver. Currently, the performance of the open-source driver is not on par with that of the proprietary one. It also lacks TV-out, dual-link DVI support, and possibly other features. On the other hand, it has better dual-head support.
+
== Selecting the right driver ==
  
= Open-Source ATI Drivers =
+
Depending on the card you have, find the right driver in [[Xorg#AMD]]. This page has instructions for '''ATI'''.
The open-source drivers will work to some degree on Radeon chipsets up to the Radeon X850. Radeons up to the 9200 series are fully featured, stable, and support full 2D and 3D acceleration. Radeons from 9500 to X850 have full 2D acceleration, they provide 3D acceleration as well but it doesn't support all the features that the proprietary drivers do. A full list of supported chipsets can be found [http://dri.freedesktop.org/wiki/ATI here].
 
  
== Installation and Configuration ==
+
If unsure, try this open source driver first, it will suit most needs and is generally less problematic. See the [https://www.x.org/wiki/RadeonFeature feature matrix] to know what is supported and the [https://www.x.org/wiki/RadeonFeature/#index5h2 decoder ring] to translate marketing names (e.g. Radeon HD4330) to chip names (e.g. R700).
The package is <code>xf86-video-ati</code>. '''Note:''' If you have previously installed the proprietary driver, make sure to remove <code>catalyst</code> and <code>catalyst-utils</code>.
 
pacman -Syu xf86-video-ati libgl
 
  
Edit your [[xorg.conf]], and add or make sure you have the following in their given sections. For
+
== Installation ==
+
 
Section "Module"
+
{{Note|If coming from the proprietary Catalyst driver, see [[AMD Catalyst#Uninstallation]] first.}}
  Load  "glx"
+
 
  Load  "dri"
+
[[Install]] the {{Pkg|mesa}} package, which provides the DRI driver for 3D acceleration.
  Load  "drm"
+
 
EndSection
+
* For 32-bit application support, also install the {{Pkg|lib32-mesa}} package from the [[multilib]] repostory.
 +
* For the DDX driver (which provides 2D acceleration in [[Xorg]]), install the {{Pkg|xf86-video-ati}} package.
 +
 
 +
Support for [[#Enabling video acceleration|accelerated video decoding]] is provided by {{Pkg|mesa-vdpau}} and {{Pkg|lib32-mesa-vdpau}} packages.
 +
 
 +
== Loading ==
 +
 
 +
The radeon kernel module should load fine automatically on system boot.
 +
 
 +
If it does not happen, then:
 +
 
 +
* Make sure you do '''not''' have {{ic|nomodeset}} or {{ic|1=vga=}} as a [[kernel parameter]], since radeon requires [[KMS]].
 +
* Also, check that you have not disabled radeon by using any [[Kernel_modules#Blacklisting|kernel module blacklisting]].
 +
 
 +
=== Enable early KMS ===
 +
 
 +
See [[Kernel mode setting#Early KMS start]].
 +
 
 +
== Xorg 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 {{ic|/etc/X11/xorg.conf.d/20-radeon.conf}}, and add the following:
  
 
  Section "Device"
 
  Section "Device"
  Identifier "name"                     # your alias
+
    Identifier "Radeon"
  Driver "radeon"
+
    Driver "radeon"
  Option "XAANoOffscreenPixmaps" "true" #needed for aiglx
 
 
  EndSection
 
  EndSection
  
  Section "DRI"
+
Using this section, you can enable features and tweak the driver settings.
  Group        "video"
+
 
  Mode        0666
+
== Performance tuning ==
  EndSection
+
=== Enabling video acceleration ===
 +
 
 +
See [[Hardware video acceleration]].
 +
 
 +
=== Graphical tools ===
 +
 
 +
* {{App|WattmanGTK|A GTK3 user-interface written in Python 3, which allows you to view, monitor Radeon performance, fan speeds and power states and the ability to overclock the graphics processor. It uses the AMDGPU kernel driver.|https://github.com/BoukeHaarsma23/WattmanGTK|{{AUR|wattman-gtk-git}}}}
 +
: {{Note|It is required to set a kernel parameter ({{ic|amdgpu.ppfeaturemask}}) in order to enable the AMD Overdrive technology within GNU/Linux. Which is necessary to use WattmanGTK.}}
 +
 
 +
* {{App|radeon-profile|Qt application for displaying info about a Radeon card.|https://github.com/marazmista/radeon-profile|{{AUR|radeon-profile-git}}}}
 +
 
 +
=== Driver options ===
 +
The following options apply to {{ic|/etc/X11/xorg.conf.d/'''20-radeon.conf'''}}.
 +
 
 +
Please read {{man|4|radeon}} and [https://www.x.org/wiki/RadeonFeature/#index4h2 RadeonFeature] first before applying driver options.
 +
 
 +
'''Acceleration architecture'''; Glamor is available as a 2D acceleration method implemented through OpenGL, and it [https://cgit.freedesktop.org/xorg/driver/xf86-video-ati/commit/?id=f11531c99fcd6473f58b4d10efaf3efd84304d8e is the default] for R600 (Radeon HD2000 series) and newer graphic cards. Older cards use EXA.
 +
 
 +
Option "AccelMethod" "glamor"
 +
 
 +
'''DRI3''' is enabled by default [https://www.phoronix.com/scan.php?page=news_item&px=Radeon-AMDGPU-1.19-Updates since xf86-video-ati 7.8.0]. For older drivers, which use DRI2 by default, switch to DRI3 with the following option:
 +
 
 +
  Option "DRI" "3"
 +
 
 +
'''TearFree''' is a tearing prevention option which prevents tearing by using the hardware page flipping mechanism:
 +
 
 +
Option "TearFree" "on"
 +
 
 +
'''ColorTiling''' and '''ColorTiling2D''' are supposed to be enabled by default. Tiled mode can provide significant performance benefits with 3D applications. It is disabled if the DRM module is too old or if the current display configuration does not support it. KMS ColorTiling2D is only supported on R600 (Radeon HD2000 series) and newer chips:
 +
 
 +
Option "ColorTiling" "on"
 +
Option "ColorTiling2D" "on"
 +
 
 +
When using Glamor as acceleration architecture, it is possible to enable the '''ShadowPrimary''' option, which enables a so-called "shadow primary" buffer for fast CPU access to pixel data, and separate scanout  buffers  for  each  display  controller  (CRTC). This may improve performance for some 2D workloads, potentially at the expense of other (e.g. 3D, video) workloads. Note that enabling this option currently disables Option "EnablePageFlip":
 +
 
 +
  Option "ShadowPrimary" "on"
  
When using this driver, make sure you do not have <code>catalyst-utils</code> installed but use <code>libgl-dri</code> instead. Otherwise, you'll have the wrong <code>libGL.so</code> which will cause direct rendering not to work.
+
'''EXAVSync ''' is only available when using EXA and can be enabled 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 known to cause instability on some chips:
  
=== Performance tuning ===
+
Option "EXAVSync" "yes"
  
The following options apply to Section "Device":
+
Below is a sample configuration file of {{ic|/etc/X11/xorg.conf.d/'''20-radeon.conf'''}}:
  
By design, the open-source driver 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.
+
{{bc|
         Option "AGPMode" "4"
+
Section "Device"
ColorTiling is completely safe to enable and supposedly is enabled by default. People have noticed a performance increase when enabled via xorg.conf.
+
Identifier  "Radeon"
 +
Driver "radeon"
 +
Option "AccelMethod" "glamor"
 +
         Option "DRI" "3"
 +
        Option "TearFree" "on"
 
         Option "ColorTiling" "on"
 
         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 "ColorTiling2D" "on"
         Option "AccelMethod" "EXA"
+
EndSection
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"
+
 
This will enable fast writes. This one can be problematic, so be prepared to remove it if you can't get into X.
+
{{Tip|{{AUR|driconf}} is a tool which allows several settings to be modified: 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).}}
        Option "AGPFastWrite" "yes"
+
 
 +
=== Kernel parameters ===
 +
{{Tip|You may want to debug the new parameters with {{ic|systool}} as stated in [[Kernel modules#Obtaining information]].}}
  
See the manpage for more configuration options.  
+
Defining the '''gartsize''', if not autodetected, can be done by adding {{ic|1=radeon.gartsize=32}} as a [[kernel parameter]].
  
A fine tool to try is [http://aur.archlinux.org/packages.php?do_Details=1&ID=2994 driconf]. It will allow you to modify several settings, like vsync, anisotropic filtering, texture compression, etc.
+
{{Note|Setting this parameter should not be needed anymore with modern AMD video cards:
Using this tool it is also possible to "disable Low Impact fallback" needed by some programs (e.g. Google Earth).
+
{{bc|<nowiki>
 +
[drm] Detected VRAM RAM=2048M, BAR=256M
 +
[drm] radeon: 2048M of VRAM memory ready
 +
[drm] radeon: 2048M of GTT memory ready.
 +
</nowiki>}}
 +
}}
  
=== TV out ===
+
The changes take effect at the next reboot.
  
Since August 2007, there is tv-out support for all radeons with integrated tv-out.
+
==== Deactivating PCIe 2.0 ====
  
It is somewhat limited for now, it doesn't always autodetect the output correctly and only NTSC mode works.
+
Since kernel 3.6, PCI Express 2.0 in '''radeon''' is turned on by default.
  
However, it works pretty well for me with my Radeon 7000. Here's how I did it:
+
It may be unstable with some motherboards. It can be deactivated by adding {{ic|1=radeon.pcie_gen2=0}} as a [[kernel parameter]].
  
First, check that you have an S-video output: <code>xrandr</code> should give you something like
+
See [https://www.phoronix.com/scan.php?page=article&item=amd_pcie_gen2&num=1 Phoronix article] for more information.
  
Screen 0: minimum 320x200, current 1024x768, maximum 1280x1200
+
=== Gallium Heads-Up Display ===
...
+
 
S-video disconnected (normal left inverted right x axis y axis)
+
The radeon driver supports the activation of a heads-up display (HUD) which can draw transparent graphs and text on top of applications that are rendering, such as games. These can show values such as the current frame rate or the CPU load for each CPU core or an average of all of them. The HUD is controlled by the GALLIUM_HUD environment variable, and can be passed the following list of parameters among others:
 +
*"fps" - displays current frames per second
 +
*"cpu" - displays the average CPU load
 +
*"cpu0" - displays the CPU load for the first CPU core
 +
*"cpu0+cpu1" - displays the CPU load for the first two CPU cores
 +
*"draw-calls" - displays how many times each material in an object is drawn to the screen
 +
*"requested-VRAM" - displays how much VRAM is being used on the GPU
 +
*"pixels-rendered" - displays how many pixels are being displayed
 +
 
 +
To see a full list of parameters, as well as some notes on operating GALLIUM_HUD, you can also pass the "help" parameter to a simple application such as glxgears and see the corresponding terminal output:
 +
{{bc|1=# GALLIUM_HUD="help" glxgears }}
 +
 
 +
More information can be found from this [https://lists.freedesktop.org/archives/mesa-dev/2013-March/036586.html mailing list post] or [https://kparal.wordpress.com/2014/03/03/fraps-like-fps-overlay-for-linux/ this blog post].
 +
 
 +
== Hybrid graphics/AMD Dynamic Switchable Graphics ==
 +
 
 +
It is the technology used on recent laptops equiped with two GPUs, one power-efficent (generally Intel integrated card) and one more powerful and more power-hungry (generally Radeon or Nvidia). There are two ways to get it work:
 +
 
 +
* If it is not required to run 'GPU-hungry' applications, it is possible to disable the discrete card (see [https://help.ubuntu.com/community/HybridGraphics#Using_vga_switcheroo Ubuntu wiki]): {{ic|echo OFF > /sys/kernel/debug/vgaswitcheroo/switch}}.
 +
* [[PRIME]]: Is a proper way to use hybrid graphics on Linux, but still requires a bit of manual intervention from the user.
 +
 
 +
== Powersaving ==
 +
{{Note|Power management is supported on all chips that include the appropriate power state tables in the vbios (R1xx and newer). "dpm" is only supported on R6xx and newer chips.}}
 +
 
 +
With the radeon driver, power saving is disabled by default and has to be enabled manually if desired.
 +
 
 +
You can choose between three different methods:
 +
 
 +
# [[#Dynamic power management|dpm]] (enabled by default since kernel 3.13)
 +
# [[#Dynamic frequency switching|dynpm]]
 +
# [[#Profile-based frequency switching|profile]]
 +
 
 +
See https://www.x.org/wiki/RadeonFeature/#index3h2 for more details.
 +
 
 +
=== Dynamic power management ===
 +
 
 +
Since kernel 3.13, DPM is enabled by default for [https://kernelnewbies.org/Linux_3.13#head-f95c198f6fdc7defe36f470dc8369cf0e16898df lots of AMD Radeon hardware]. If you want to disable it, add the parameter {{ic|1=radeon.dpm=0}} to the [[kernel parameters]].
 +
 
 +
{{Tip| DPM works on R6xx gpus, but is not enabled by default in the kernel (only R7xx and up). Setting the {{ic|1=radeon.dpm=1}} kernel parameter will enable dpm.}}
 +
 
 +
Unlike [[#Dynamic frequency switching|dynpm]], the "dpm" method uses hardware on the GPU to dynamically change the clocks and voltage based on GPU load. It also enables clock and power gating.
 +
 
 +
There are 3 operation modes to choose from:
 +
 
 +
* {{ic|battery}} lowest power consumption
 +
* {{ic|balanced}} sane default
 +
* {{ic|performance}} highest performance
 +
 
 +
They can be changed via sysfs
 +
# echo battery > /sys/class/drm/card0/device/power_dpm_state
 +
 
 +
For testing or debugging purposes, you can force the card to run in a set performance mode:
 +
 
 +
* {{ic|auto}} default; uses all levels in the power state
 +
* {{ic|low}} enforces the lowest performance level
 +
* {{ic|high}} enforces the highest performance level
 +
 
 +
# echo low > /sys/class/drm/card0/device/power_dpm_force_performance_level
 +
 
 +
==== Commandline Tools ====
 +
 
 +
* [https://github.com/superjamie/snippets/blob/master/radcard radcard] - A script to get and set DPM power states and levels
 +
 
 +
=== Old methods ===
 +
 
 +
==== Dynamic frequency switching ====
  
Now we should tell Xorg that it is actually connected (it ''is'', right?)
+
This method dynamically changes the frequency depending on GPU load, so performance is ramped up when running GPU intensive apps, and ramped down when the GPU is idle. The re-clocking is attempted during vertical blanking periods, but due to the timing of the re-clocking functions, does not always complete in the blanking period, which can lead to flicker in the display. Due to this, dynpm only works when a single head is active.
  
xrandr --output S-video --set load_detection 1
+
It can be activated by simply running the following command:
  
Setting tv standard to use:
+
# echo dynpm > /sys/class/drm/card0/device/power_method
  
xrandr --output S-video --set tv_standard ntsc
+
==== Profile-based frequency switching ====
  
Adding a mode for it (currently it supports only 800x600):
+
This method will allow you to select one of the five profiles (described below). Different profiles, for the most part, end up changing the frequency/voltage of the GPU. This method is not as aggressive, but is more stable and flicker free and works with multiple heads active.
  
xrandr --addmode S-video 800x600
+
To activate the method, run the following command:
  
I'll go for a clone mode:
+
  # echo profile > /sys/class/drm/card0/device/power_method
  xrandr --output S-video --same-as VGA-0
 
  
So far so good. Now let's try to see what we have:
+
Select one of the available profiles:
 +
* {{ic|default}} uses the default clocks and does not change the power state. This is the default behaviour.
 +
* {{ic|auto}} selects between {{ic|mid}} and {{ic|high}} power states based on the whether the system is on battery power or not.
 +
* {{ic|low}} forces the gpu to be in the {{ic|low}} power state all the time. Note that {{ic|low}} can cause display problems on some laptops, which is why {{ic|auto}} only uses {{ic|low}} when monitors are off. Selected on other profiles when the monitors are in the [[DPMS]]-off state.
 +
* {{ic|mid}} forces the gpu to be in the {{ic|mid}} power state all the time.
 +
* {{ic|high}} forces the gpu to be in the {{ic|high}} power state all the time.
  
xrandr --output S-video --mode 800x600
+
As an example, we will activate the {{ic|low}} profile (replace {{ic|low}} with any of the aforementioned profiles as necessary):
  
At this point you should see a 800x600 version of your desktop on your TV.
+
# echo low > /sys/class/drm/card0/device/power_profile
  
To disable the output, do
+
=== Persistent configuration ===
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.
+
The methods described above are not persistent. To make them persistent, you may create a [[udev]] rule (example for [[#Profile-based frequency switching]]):
  
To send the output to the TV, I do
+
{{hc|/etc/udev/rules.d/30-radeon-pm.rules|<nowiki>
 +
KERNEL=="dri/card0", SUBSYSTEM=="drm", DRIVERS=="radeon", ATTR{device/power_method}="profile", ATTR{device/power_profile}="low"
 +
</nowiki>}}
  
xvattr -a XV_CRTC -v 1
+
As another example, [[#Dynamic power management|dynamic power management]] can be permanently forced to a certain performance level:
  
To switch back to my monitor, I change this to <code>0</code>. <code>-1</code> is used for automatic switching in dualhead setups.
+
{{hc|/etc/udev/rules.d/30-radeon-pm.rules|<nowiki>
 +
KERNEL=="dri/card0", SUBSYSTEM=="drm", DRIVERS=="radeon", ATTR{device/power_dpm_force_performance_level}="high"
 +
</nowiki>}}
  
= ATI Catalyst proprietary driver=
+
{{Note|If the above rules are failing, try removing the {{ic|dri/}} prefix.}}
  
Formerly known as the fglrx, ATI has rebranded their proprietary Linux driver now known as Catalyst.  Currently, only the package name has changed, while the kernel module retains its original 'fglrx' name, therefore any mention of fglrx below is specifically in reference to the kernel module, ''not the package.''
+
=== Graphical tools ===
  
== Supported Devices ==
+
* {{App|Radeon-tray|A small program to control the power profiles of your Radeon card via systray icon. It is written in PyQt4 and is suitable for non-Gnome users.|https://github.com/StuntsPT/Radeon-tray|{{AUR|radeon-tray}}}}
  
See [https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/catalyst_712_linux.html ATI Catalyst 7.12 (Linux) Release Notes] for a list of supported devices by this version of the drivers.
+
=== Other notes ===
  
== Installation ==
+
To view the speed that the GPU is running at, perform the following command and you will get something like this output:
  
From the release of Xorg 7, Arch has provided pre-compiled catalyst packages in the <code>extra</code> repository.  If you use either of the kernels provided in the core or extra repos, the process is simple.  If you use a custom kernel, a few extra steps need to be taken.
+
{{hc|# cat /sys/kernel/debug/dri/0/radeon_pm_info|<nowiki>
 +
  state: PM_STATE_ENABLED
 +
  default engine clock: 300000 kHz
 +
  current engine clock: 300720 kHz
 +
  default memory clock: 200000 kHz
 +
</nowiki>}}
  
=== Stock Kernel ===
+
It depends on which GPU line yours is, however. Along with the radeon driver versions, kernel versions, etc. So it may not have much/any voltage regulation at all.
  
====kernel26====
+
Thermal sensors are implemented via external i2c chips or via the internal thermal sensor (rv6xx-evergreen only). To get the temperature on asics that use i2c chips, you need to load the appropriate hwmon driver for the sensor used on your board (lm63, lm64, etc.). The drm will attempt to load the appropriate hwmon driver. On boards that use the internal thermal sensor, the drm will set up the hwmon interface automatically. When the appropriate driver is loaded, the temperatures can be accessed via [[lm_sensors]] tools or via sysfs in {{ic|/sys/class/hwmon}}.
  
To install ATI's fglrx drivers for the <code>kernel26</code> package, you need to install the <code>catalyst</code> package.
+
== Fan Speed ==
  
# pacman -S catalyst
+
While the power saving features above should handle fan speeds quite well, some cards may still be too noisy in their idle state. In this case, and when your card supports it, you can change the fan speed manually.
  
This package contains '''only''' the kernel module, but also installs the <code>catalyst-utils</code> package as a dependencyThe <code>catalyst-utils</code> package is kernel-independent and provides the libraries and utilities for Xorg, including ATI's own <code>libGL.so</code>.
+
{{Warning|
 +
* Keep in mind that the following method sets the fan speed to a fixed value, hence it will not adjust with the stress of the GPU, which can lead to overheating under heavy load.
 +
* Check GPU temperature when applying lower than standard values.
 +
}}
 +
   
 +
To control the GPU fan, see [[Fan speed control#AMDGPU sysfs fan control]] (amdgpu and radeon share the same controls for this).
  
=== Custom Kernels ===
+
For persistence, see the example in [[#Persistent configuration]].
  
To install catalyst for a custom kernel, you'll need to build your own <code>catalyst-$kernel</code> package containing the kernel module compiled specifically for your kernel.
+
If a fixed value is not desired, there are possibilities to define a custom fan curve manually by, for example, writing a script in which fan speeds are set depending on the current temperature (current value in {{ic|/sys/class/drm/card0/device/hwmon/hwmon0/temp1_input}}).
  
If you are at all uncomfortable or inexperienced making packages, read up the [[ABS]] wiki page first so things go smoothly.
+
A GUI solution is available by installing {{AUR|radeon-profile-git}}.
  
==== Obtaining PKGBUILD ====
+
== TV out ==
Obtain the <code>PKGBUILD</code> and <code>fglrx.install</code> files from CVS or ABS.  Either:
 
  
* Visit http://www.archlinux.org/packages/12877/ and click "View CVS Entries" to find them, or
+
First, check that you have an S-video output: {{ic|xrandr}} should give you something like
* Run <code>abs</code> as root and locate the files in <code>/var/abs/extra/modules/fglrx</code>.
+
Screen 0: minimum 320x200, current 1024x768, maximum 1280x1200
 +
...
 +
S-video disconnected (normal left inverted right x axis y axis)
  
==== Editing the PKGBUILD and building ====
+
Now we should tell Xorg that it is actually connected (it ''is'', right?)
Three changes need to be made here:
+
xrandr --output S-video --set "load detection" 1
  
'''First''', change
+
Setting TV standard to use:
    pkgname=catalyst
+
xrandr --output S-video --set "tv standard" ntsc
to
 
    pkgname=catalyst-KERNEL_NAME
 
where KERNEL_NAME is whatever you want (e.g. custom, mm, themostawesomekernelever)
 
  
'''Second''', remove <code>kernel26</code> from the dependencies list.
+
Adding a mode for it (currently supports only 800x600):
 +
xrandr --addmode S-video 800x600
  
'''Third''', change
+
Clone mode:
    _kernver=${_kernel_version}-ARCH
+
xrandr --output S-video --same-as VGA-0
to
 
    _kernver=`uname -r`
 
(or directly insert the output of uname -r '''when running your custom kernel''' there)
 
  
Finally, build and install the package. (<code>makepkg -i</code> or <code>makepkg</code> followed by <code>pacman -A pkgname.pkg.tar.gz</code>)
+
Now let us try to see what we have:
 +
  xrandr --output S-video --mode 800x600
  
==== Notes ====
+
At this point you should see a 800x600 version of your desktop on your TV.
* If you run multiple kernels from the repos, then install catalyst module packages for all kernels.  They won't conflict with one another.
 
  
* No changes need to be made to the <code>catalyst-utils</code> package, which is completely kernel-independent.  '''All''' you need to do is compile a kernel module.
+
To disable the output, do
 +
xrandr --output S-video --off
  
=== ATI/AMD Installer ===
+
=== Force TV-out in KMS ===
'''WARNING: Using the installer from ati.com/amd.com is NOT recommended!'''
 
 
 
Doing so will cause file conflicts with various pacman packages and likely cause X failures.  The packages available through pacman are configured specifically for Arch Linux and so should be used instead.
 
  
If you have attempted a manual install from the official installer, and are finding that nothing works correctly anymore, there should be an uninstall script placed at /usr/share/ati - run that, then try the pacman packages.
+
The kernel can recognize {{ic|1=video=}} parameter in following form (see [[KMS]] for more details):
  
If you ''must'' use the installer from ATI/AMD for some reason, the following steps '''might''' work for you:
+
video=<conn>:<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]
  
*Download AMD/ATI driver installer
+
For example:
*Make it executable
 
*Install mesa package
 
    #pacman -S mesa
 
*Install Xorg if you need to
 
*Check for other required things for ATI/AMD installer listed on their website
 
    #pacman -Q | grep NameOfPackage
 
*Use aticonfig as described below to update xorg.conf
 
*Add ModulesPath into xorg.conf pointing at fglrx.so module if necessary
 
  
== Configuration ==
+
video=DVI-I-1:1280x1024-24@60e
ATI provides the <code>aticonfig</code> tool to modify an existing <code>xorg.conf</code> file and configure essentially every aspect of the card. For a complete list of <code>aticonfig</code> options, run:
 
$ aticonfig --help
 
  
If you don't have an xorg.conf file yet, run the following command to generate one:
+
Parameters with whitespaces must be quoted:
# Xorg -configure
 
  
The simplest way to use <code>aticonfig</code> to adapt your <code>xorg.conf</code> file is listed in the examples at the end of the output if you run <code>aticonfig</code> without any command-line parameters:
+
"video=9-pin DIN-1:1024x768-24@60e"
    Examples:
 
      1. Setting up fglrx for the first time.
 
          Single head :   aticonfig --initial --input=/etc/X11/xorg.conf
 
          Dual head  :    aticonfig --initial=dual-head --screen-layout=above
 
                            This command will generate a dual head configuration
 
                            file with the second screen located above the first
 
                            screen.
 
  
Just adapt one of those two lines for your personal setup.
+
Current mkinitcpio implementation also requires {{ic|#}} in front. For example:
  
As always, it's a good idea to visually scan the resulting <code>xorg.conf</code> file to ensure everything seems right.  If you want, you can compare it to one of the [http://wiki.archlinux.org/index.php?title=Xorg7#Sample_Xorg.conf_Files Sample Xorg.conf files] listed on the Xorg wiki page.
+
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"
  
Finally, run Xorg with <code>startx</code> and verify that direct rendering is enabled by running the following command in a terminal:
+
* [[GRUB Legacy]] can pass such command line as is.
$ glxinfo | grep direct
+
* [[LILO]] needs backslashes for doublequotes (append {{ic|1=# \"video=9-pin DIN-1:1024x768-24@60e\"}})
If it says "direct rendering: yes" then you're good to go! If the glxinfo command is not found, you may need to install the mesa package as well.
 
  
 +
You can get list of your video outputs with following command:
  
== Troubleshooting ==
+
{{bc|<nowiki>$ ls -1 /sys/class/drm/ | grep -E '^card[[:digit:]]+-' | cut -d- -f2-</nowiki>}}
  
===KDM disapears after logout===
+
== HDMI audio ==
If you are running the catalyst proprietary driver and you get a console (vc/1) instead of the expected KDM greeting when you log out, you must instruct KDM to restart the X server after each logout:
 
$ sudo vim /opt/kde/share/config/kdm/kdmrc
 
  
Add the following line under the section titled [X-*-Core]:
+
HDMI audio is supported in the {{Pkg|xf86-video-ati}} video driver. To disable HDMI audio add {{ic|1=radeon.audio=0}} to your [[kernel parameters]].
TerminateServer=True
 
  
KDM should now appear when you log out of KDE.
+
If there is no video after boot up, the driver option has to be disabled.
  
===Direct Rendering Doesn't Work===
+
{{Note|
 +
* If HDMI audio does not work after installing the driver, test your setup with the procedure at [[Advanced Linux Sound Architecture/Troubleshooting#HDMI Output does not work]].
 +
* If the sound is distorted in PulseAudio try setting {{ic|1=tsched=0}} as described in [[PulseAudio/Troubleshooting#Glitches, skips or crackling]] and make sure {{ic|rtkit}} daemon is running.
 +
* Your sound card might use the same module, since HDA compliant hardware is pretty common. [[Advanced Linux Sound Architecture#Set the default sound card]] using one of the suggested methods, which include using the {{ic|defaults}} node in alsa configuration.
 +
}}
  
Having trouble getting direct rendering to work?  Run
+
== Multihead setup ==
    $ LIBGL_DEBUG=verbose glxinfo > /dev/null
 
at the command prompt.  At the very start of the output, it'll usually give you a nice error message saying why you don't have direct rendering.
 
  
Common errors, and their solutions, are:
+
=== Using the RandR extension ===
  
    '''libGL error: XF86DRIQueryDirectRenderingCapable returned false'''
+
See [[Multihead#RandR]] how to setup multiple monitors by using [[Wikipedia:RandR|RandR]].
  
* Ensure that you are loading the correct agp modules for your AGP chipset before you load the fglrx kernel module.  To determine which agp modules you'll need, run <code>hwdetect --show-agp</code>, then ensure that all modules listed from that command are in the <code>MODULES=</code> array in rc.conf, '''before''' fglrx.
+
=== Independent X screens ===
  
    '''libGL error: failed to open DRM: Operation not permitted'''
+
Independent dual-headed setups can be configured the usual way. However you might want to know that the radeon driver has a {{ic|"ZaphodHeads"}} option which allows you to bind a specific device section to an output of your choice:
    '''libGL error: reverting to (slow) indirect rendering'''
+
{{hc|/etc/X11/xorg.conf.d/20-radeon.conf|
 +
Section "Device"
 +
  Identifier "Device0"
 +
  Driver "radeon"
 +
  Option "ZaphodHeads" "VGA-0"
 +
  VendorName "ATI"
 +
  BusID "PCI:1:0:0"
 +
  Screen 0
 +
EndSection
 +
}}
  
* For this, make sure you have the following section in your <code>xorg.conf</code> somewhere:
+
This can be a life-saver, when using videocards that 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 explicitly specify {{ic|"ZaphodHeads" "VGA-0"}}.
    Section "DRI"
 
        Mode 0666
 
    EndSection
 
  
    '''libGL: OpenDriver: trying /usr/lib/xorg/modules/dri//fglrx_dri.so'''
+
== Turn vsync off ==
    '''libGL error: dlopen /usr/lib/xorg/modules/dri//fglrx_dri.so failed (/usr/lib/xorg/modules/dri//fglrx_dri.so: cannot open shared object file: No such file or directory)'''
 
    '''libGL error: unable to find driver: fglrx_dri.so'''
 
  
* Something hasn't been installed correctly. If the paths in the error message are <code>/usr/X11R6/lib/modules/dri/fglrx_dri.so</code>, then ensure you've logged completely out of your system, then back in.  If you're using a graphical login manager (gdm, kdm, xdm), ensure that /etc/profile is sourced every time you log in. This is usually accomplished by adding <code>source /etc/profile</code> into <code>~/.xsession</code> or <code>~/.xinitrc</code>, but may vary between login managers.
+
The radeon driver will probably enable vsync by default, which is perfectly fine except for benchmarking. To turn it off try the {{ic|1=vblank_mode=0}} [[environment variable]] or create {{ic|~/.drirc}} (edit it if it already exists) and add the following:
 +
{{hc|~/.drirc|<nowiki>
 +
<driconf>
 +
    <device screen="0" driver="dri2">
 +
        <application name="Default">
 +
            <option name="vblank_mode" value="0" />
 +
        </application>
 +
    </device>
 +
    <!-- Other devices ... -->
 +
</driconf>
 +
</nowiki>}}
  
* If the paths above in your error message _are_ <code>/usr/lib/xorg/modules/dri/fglrx_dri.so</code>, then something hasn't been correctly installed. Try reinstalling the <code>fglrx-utils</code> package.
+
{{Note|Make sure the driver is '''dri2''', not your video card code (like r600).}}
  
 +
If vsync is still enabled, you can disable it by editing {{ic|/etc/X11/xorg.conf.d/20-radeon.conf}}. See [[#Driver options]].
  
    '''fglrx: libGL version undetermined - OpenGL module is using glapi fallback'''
+
== Troubleshooting ==
  
* This could be caused by having multiple versions of <code>libGL.so</code> on your system. Run:
+
=== Performance and/or artifacts issues when using EXA ===
    $ sudo updatedb
+
{{Note|This only applies to cards older than R600 (Radeon X1000 series and older). Newer cards you should use Glamor instead of EXA.}}
    $ locate libGL.so
 
  
This should return the following output:
+
If having 2D performance issues, like slow scrolling in a terminal or webbrowser, adding {{ic|Option "MigrationHeuristic" "greedy"}} as device option may solve the issue.
    $ locate libGL.so
 
    /usr/lib/libGL.so
 
    /usr/lib/libGL.so.1
 
    /usr/lib/libGL.so.1.2
 
    $
 
  
These are the only three libGL.so files you should have on your system.  If you have any more (e.g. <code>/usr/X11R6/lib/libGL.so.1.2</code>), then remove them. This should fix your problem.  
+
In addition disabling EXAPixmaps may solve artifacts issues, although this is generally not recommended and may cause other issues.
  
You might not get any error to indicate that this is a problem. If you are using X11R7, make sure you do '''not''' have these files on your system:
+
{{hc|/etc/X11/xorg.conf.d/20-radeon.conf|<nowiki>
    /usr/X11R6/lib/libGL.so.1.2
+
Section "Device"
     /usr/X11R6/lib/libGL.so.1
+
     Identifier "Radeon"
 +
    Driver "radeon"
 +
    Option "AccelMethod" "exa"
 +
    Option "MigrationHeuristic" "greedy"
 +
    #Option "EXAPixmaps" "off"
 +
EndSection
 +
</nowiki>}}
  
===Hibernate/Sleep Issues===
+
=== Adding undetected/unsupported resolutions ===
==== Video fails to enter suspend/hibernate ====
 
If <code>fglrx</code> returns an error when attempting to suspend through hibernate scripts, a solution may be to add the following line to your "Device" section in <code>/etc/X11/xorg.conf</code>, which should allow the <tt>fglrx</tt> module to enter suspend mode.
 
  
Option      "UseInternalAGPGart" "no"
+
See [[Xrandr#Adding undetected resolutions]].
  
==== Video fails to resume from suspend2ram ====
+
=== TV showing a black border around the screen ===
ATI's proprietary <tt>catalyst</tt> driver cannot resume from suspend if the framebuffer is enabled.  To disable the framebuffer, add '''vga=0''' to your kernel options in <code>/boot/grub/menu.lst</code>, for example:
+
{{Note|Make sure the tv has been setup correctly (see manual) before attempting the following solution.}}
# (0) Arch Linux
 
title  Arch Linux
 
root  (hd0,0)
 
kernel /vmlinuz26 root=/dev/sda3 resume=/dev/sda2 ro '''''vga=0'''''
 
initrd /kernel26.img
 
  
===System Freezes/Hard locks===
+
When connecting a TV using the HDMI port, the TV may show a blurry picture with a 2-3cm border around it. This protects against overscanning (see [[Wikipedia:Overscan]]), but can be turned off using xrandr:
 +
xrandr --output HDMI-0 --set underscan off
  
* To prevent system lockups, try adding the following lines to your fglrx "Device" section in <code>xorg.conf</code>
+
=== Black screen and no console, but X works in KMS ===
    Option "UseInternalAGPGART"        "no"
 
    Option "KernelModuleParm"          "agplock=0" # AGP locked user pages: disabled
 
  
Note: Neither option is necessary anymore since 8.24.18 because ATI has removed the internal AGP GART support from the driver.
+
This is a solution to the 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 the wrong framebuffer device that exists on the wrong card. This can be fixed by adding this to the kernel boot line:
 +
fbcon=map:1
 +
This will tell the fbcon to map itself to the {{ic|/dev/fb1}} framebuffer dev and not the {{ic|/dev/fb0}}, that in our case exists on the wrong graphics card. If that does not fix your problem, try booting with
 +
fbcon=map:0
 +
instead.
  
* As well, the <code>radeonfb</code> framebuffer drivers have been known in the past to cause problems of this nature.  If your kernel has radeonfb support compiled in, you may want to try a different kernel and see if this helps. 
+
=== ATI X1600 (RV530 series) 3D application show black windows ===
  
===Hardware Conflicts===
+
There are three possible solutions:
 +
* Try adding {{ic|<nowiki>pci=nomsi</nowiki>}} to your boot loader [[Kernel parameters]].
 +
* If this does not work, you can try adding {{ic|noapic}} instead of {{ic|<nowiki>pci=nomsi</nowiki>}}.
 +
* If none of the above work, then you can try running {{ic|<nowiki>vblank_mode=0 glxgears</nowiki>}} or {{ic|<nowiki>vblank_mode=1 glxgears</nowiki>}} to see which one works for you, then install {{AUR|driconf}} and set that option in {{ic|~/.drirc}}.
  
Radeon cards used in conjunction with some versions of the nForce3 chipset (e.g. nForce 3 250Gb) won't have 3D acceleration. Currently the cause of this issue is unknown, but some sources indicate that it may be possible to get acceleration with this combination of hardware by booting Windows with the drivers from nVIDIA and then rebooting the system. This can be verified by issuing in a root console the following command:
+
=== Cursor corruption after coming out of sleep ===
  
    dmesg | grep agp
+
If the cursor becomes corrupted like it's repeating itself vertically after the monitor(s) comes out of sleep, set {{ic|"SWCursor" "True"}} in the {{ic|"Device"}} section of the {{ic|/etc/X11/xorg.conf.d/20-radeon.conf}} configuration file.
  
If you get something similar to this (using an nForce3-based system)
+
=== DisplayPort stays black on multimonitor mode ===
  
    agpgart: Detected AGP bridge 0
+
Try booting with the [[kernel parameter]] {{ic|1=radeon.audio=0}}.
    agpgart: Setting up Nforce3 AGP.
 
    agpgart: aperture base > 4G
 
  
and also if issuing this command...
+
=== R9-390 Poor Performance and/or Instability ===
  
      tail -n 100 /var/log/Xorg.0.log | grep agp
+
Firmware issues with R9-390 series cards include poor performance and crashes (frequently caused by gaming or using Google Maps) possibly related DPM. Comment 115 of this bug [https://bugs.freedesktop.org/show_bug.cgi?id=91880 report] includes instructions for a fix.
  
...gets something similar to:
+
=== QHD / UHD / 4k support over HDMI for older Radeon cards ===
  
      (EE) fglrx(0): [agp] unable to acquire AGP, error "xf86_ENODEV"
+
Older cards have their pixel clock limited to 165MHz for HDMI. Hence, they do not support QHD or 4k only via dual-link DVI but not over HDMI.
  
Then you have this bug.
+
One possibility to work around this is to use [https://www.elstel.org/software/hunt-for-4K-UHD-2160p.html.en custom modes with lower refresh rate], e.g. 30Hz.
  
Some sources indicate that in some situations, downgrading the motherboard BIOS may help, but this cannot be verified in all cases. Also, a bad BIOS downgrade can render your hardware useless, so beware.
+
Another one is a kernel patch removing the pixel clock limit, but this may damage the card!
  
See bug http://bugzilla.kernel.org/show_bug.cgi?id=6350 for more information and a potential fix.
+
Official kernel bug ticket with patch for 4.8: https://bugzilla.kernel.org/show_bug.cgi?id=172421
  
===Compaq Presario Laptops===
+
The patch introduces a new kernel parameter {{ic|radeon.hdmimhz}} which alters the pixel clock limit.  
Even after installing the drivers and editing the configuration file as required, some laptops (e.g. Presario R4000 with Xpress 200M) just come up with a blank screen.
 
  
The problem seems to be incorrect memory detected by the kernel(even if you have 128M of video memory lspci -v always reports 256M). Changing the BIOS settings so that it uses the "SidePort+UMA" option and 128M video memory plus another 128M taken from the system seems to work fine.
+
Be sure to use a high speed HDMI cable for this.
  
It could be a bug in the BIOS or in the Linux PCI code.
+
== See also ==
  
= External Resources =
+
[https://www.phoronix.com/scan.php?page=article&item=radeonsi-cat-wow&num=1 Benchmark] showing the open source driver is on par performance-wise with the proprietary driver for many cards.
More info can be found here
 
* [http://ati.cchtml.com/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=&content= Unofficial ATI Linux Bugtracker]
 
* [http://www.rage3d.com/board/forumdisplay.php?f=88 Rage3D ATI Linux Forums]
 
* [http://www.thinkwiki.org/wiki/Problems_with_fglrx ThinkWiki fglrx Problems page]
 
* [http://www.phoronix.com/scan.php?page=article&item=560 ATI R300: Open v. Closed Drivers]
 
* [http://www.thinkwiki.org/wiki/Additional_options_for_the_radeon_driver Additional options for the radeon driver]
 

Latest revision as of 07:34, 30 March 2019

This article covers the radeon open source driver which supports the majority of AMD (previously ATI) GPUs.

Selecting the right driver

Depending on the card you have, find the right driver in Xorg#AMD. This page has instructions for ATI.

If unsure, try this open source driver first, it will suit most needs and is generally less problematic. See the feature matrix to know what is supported and the decoder ring to translate marketing names (e.g. Radeon HD4330) to chip names (e.g. R700).

Installation

Note: If coming from the proprietary Catalyst driver, see AMD Catalyst#Uninstallation first.

Install the mesa package, which provides the DRI driver for 3D acceleration.

  • For 32-bit application support, also install the lib32-mesa package from the multilib repostory.
  • For the DDX driver (which provides 2D acceleration in Xorg), install the xf86-video-ati package.

Support for accelerated video decoding is provided by mesa-vdpau and lib32-mesa-vdpau packages.

Loading

The radeon kernel module should load fine automatically on system boot.

If it does not happen, then:

Enable early KMS

See Kernel mode setting#Early KMS start.

Xorg 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.

Performance tuning

Enabling video acceleration

See Hardware video acceleration.

Graphical tools

  • WattmanGTK — A GTK3 user-interface written in Python 3, which allows you to view, monitor Radeon performance, fan speeds and power states and the ability to overclock the graphics processor. It uses the AMDGPU kernel driver.
https://github.com/BoukeHaarsma23/WattmanGTK || wattman-gtk-gitAUR
Note: It is required to set a kernel parameter (amdgpu.ppfeaturemask) in order to enable the AMD Overdrive technology within GNU/Linux. Which is necessary to use WattmanGTK.
  • radeon-profile — Qt application for displaying info about a Radeon card.
https://github.com/marazmista/radeon-profile || radeon-profile-gitAUR

Driver options

The following options apply to /etc/X11/xorg.conf.d/20-radeon.conf.

Please read radeon(4) and RadeonFeature first before applying driver options.

Acceleration architecture; Glamor is available as a 2D acceleration method implemented through OpenGL, and it is the default for R600 (Radeon HD2000 series) and newer graphic cards. Older cards use EXA.

Option "AccelMethod" "glamor"

DRI3 is enabled by default since xf86-video-ati 7.8.0. For older drivers, which use DRI2 by default, switch to DRI3 with the following option:

Option "DRI" "3"

TearFree is a tearing prevention option which prevents tearing by using the hardware page flipping mechanism:

Option "TearFree" "on"

ColorTiling and ColorTiling2D are supposed to be enabled by default. Tiled mode can provide significant performance benefits with 3D applications. It is disabled if the DRM module is too old or if the current display configuration does not support it. KMS ColorTiling2D is only supported on R600 (Radeon HD2000 series) and newer chips:

Option "ColorTiling" "on"
Option "ColorTiling2D" "on"

When using Glamor as acceleration architecture, it is possible to enable the ShadowPrimary option, which enables a so-called "shadow primary" buffer for fast CPU access to pixel data, and separate scanout buffers for each display controller (CRTC). This may improve performance for some 2D workloads, potentially at the expense of other (e.g. 3D, video) workloads. Note that enabling this option currently disables Option "EnablePageFlip":

Option "ShadowPrimary" "on"

EXAVSync is only available when using EXA and can be enabled 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 known to cause instability on some chips:

Option "EXAVSync" "yes"

Below is a sample configuration file of /etc/X11/xorg.conf.d/20-radeon.conf:

Section "Device"
	Identifier  "Radeon"
	Driver "radeon"
	Option "AccelMethod" "glamor"
        Option "DRI" "3"
        Option "TearFree" "on"
        Option "ColorTiling" "on"
        Option "ColorTiling2D" "on"
EndSection
Tip: driconfAUR is a tool which allows several settings to be modified: 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).

Kernel parameters

Tip: You may want to debug the new parameters with systool as stated in Kernel modules#Obtaining information.

Defining the gartsize, if not autodetected, can be done by adding radeon.gartsize=32 as a kernel parameter.

Note: Setting this parameter should not be needed anymore with modern AMD video cards:
[drm] Detected VRAM RAM=2048M, BAR=256M
[drm] radeon: 2048M of VRAM memory ready
[drm] radeon: 2048M of GTT memory ready.

The changes take effect at the next reboot.

Deactivating PCIe 2.0

Since kernel 3.6, PCI Express 2.0 in radeon is turned on by default.

It may be unstable with some motherboards. It can be deactivated by adding radeon.pcie_gen2=0 as a kernel parameter.

See Phoronix article for more information.

Gallium Heads-Up Display

The radeon driver supports the activation of a heads-up display (HUD) which can draw transparent graphs and text on top of applications that are rendering, such as games. These can show values such as the current frame rate or the CPU load for each CPU core or an average of all of them. The HUD is controlled by the GALLIUM_HUD environment variable, and can be passed the following list of parameters among others:

  • "fps" - displays current frames per second
  • "cpu" - displays the average CPU load
  • "cpu0" - displays the CPU load for the first CPU core
  • "cpu0+cpu1" - displays the CPU load for the first two CPU cores
  • "draw-calls" - displays how many times each material in an object is drawn to the screen
  • "requested-VRAM" - displays how much VRAM is being used on the GPU
  • "pixels-rendered" - displays how many pixels are being displayed

To see a full list of parameters, as well as some notes on operating GALLIUM_HUD, you can also pass the "help" parameter to a simple application such as glxgears and see the corresponding terminal output:

# GALLIUM_HUD="help" glxgears

More information can be found from this mailing list post or this blog post.

Hybrid graphics/AMD Dynamic Switchable Graphics

It is the technology used on recent laptops equiped with two GPUs, one power-efficent (generally Intel integrated card) and one more powerful and more power-hungry (generally Radeon or Nvidia). There are two ways to get it work:

  • If it is not required to run 'GPU-hungry' applications, it is possible to disable the discrete card (see Ubuntu wiki): echo OFF > /sys/kernel/debug/vgaswitcheroo/switch.
  • PRIME: Is a proper way to use hybrid graphics on Linux, but still requires a bit of manual intervention from the user.

Powersaving

Note: Power management is supported on all chips that include the appropriate power state tables in the vbios (R1xx and newer). "dpm" is only supported on R6xx and newer chips.

With the radeon driver, power saving is disabled by default and has to be enabled manually if desired.

You can choose between three different methods:

  1. dpm (enabled by default since kernel 3.13)
  2. dynpm
  3. profile

See https://www.x.org/wiki/RadeonFeature/#index3h2 for more details.

Dynamic power management

Since kernel 3.13, DPM is enabled by default for lots of AMD Radeon hardware. If you want to disable it, add the parameter radeon.dpm=0 to the kernel parameters.

Tip: DPM works on R6xx gpus, but is not enabled by default in the kernel (only R7xx and up). Setting the radeon.dpm=1 kernel parameter will enable dpm.

Unlike dynpm, the "dpm" method uses hardware on the GPU to dynamically change the clocks and voltage based on GPU load. It also enables clock and power gating.

There are 3 operation modes to choose from:

  • battery lowest power consumption
  • balanced sane default
  • performance highest performance

They can be changed via sysfs

# echo battery > /sys/class/drm/card0/device/power_dpm_state

For testing or debugging purposes, you can force the card to run in a set performance mode:

  • auto default; uses all levels in the power state
  • low enforces the lowest performance level
  • high enforces the highest performance level
# echo low > /sys/class/drm/card0/device/power_dpm_force_performance_level

Commandline Tools

  • radcard - A script to get and set DPM power states and levels

Old methods

Dynamic frequency switching

This method dynamically changes the frequency depending on GPU load, so performance is ramped up when running GPU intensive apps, and ramped down when the GPU is idle. The re-clocking is attempted during vertical blanking periods, but due to the timing of the re-clocking functions, does not always complete in the blanking period, which can lead to flicker in the display. Due to this, dynpm only works when a single head is active.

It can be activated by simply running the following command:

# echo dynpm > /sys/class/drm/card0/device/power_method

Profile-based frequency switching

This method will allow you to select one of the five profiles (described below). Different profiles, for the most part, end up changing the frequency/voltage of the GPU. This method is not as aggressive, but is more stable and flicker free and works with multiple heads active.

To activate the method, run the following command:

# echo profile > /sys/class/drm/card0/device/power_method

Select one of the available profiles:

  • default uses the default clocks and does not change the power state. This is the default behaviour.
  • auto selects between mid and high power states based on the whether the system is on battery power or not.
  • low forces the gpu to be in the low power state all the time. Note that low can cause display problems on some laptops, which is why auto only uses low when monitors are off. Selected on other profiles when the monitors are in the DPMS-off state.
  • mid forces the gpu to be in the mid power state all the time.
  • high forces the gpu to be in the high power state all the time.

As an example, we will activate the low profile (replace low with any of the aforementioned profiles as necessary):

# echo low > /sys/class/drm/card0/device/power_profile

Persistent configuration

The methods described above are not persistent. To make them persistent, you may create a udev rule (example for #Profile-based frequency switching):

/etc/udev/rules.d/30-radeon-pm.rules
KERNEL=="dri/card0", SUBSYSTEM=="drm", DRIVERS=="radeon", ATTR{device/power_method}="profile", ATTR{device/power_profile}="low"

As another example, dynamic power management can be permanently forced to a certain performance level:

/etc/udev/rules.d/30-radeon-pm.rules
KERNEL=="dri/card0", SUBSYSTEM=="drm", DRIVERS=="radeon", ATTR{device/power_dpm_force_performance_level}="high"
Note: If the above rules are failing, try removing the dri/ prefix.

Graphical tools

  • Radeon-tray — A small program to control the power profiles of your Radeon card via systray icon. It is written in PyQt4 and is suitable for non-Gnome users.
https://github.com/StuntsPT/Radeon-tray || radeon-trayAUR

Other notes

To view the speed that the GPU is running at, perform the following command and you will get something like this output:

# cat /sys/kernel/debug/dri/0/radeon_pm_info
  state: PM_STATE_ENABLED
  default engine clock: 300000 kHz
  current engine clock: 300720 kHz
  default memory clock: 200000 kHz

It depends on which GPU line yours is, however. Along with the radeon driver versions, kernel versions, etc. So it may not have much/any voltage regulation at all.

Thermal sensors are implemented via external i2c chips or via the internal thermal sensor (rv6xx-evergreen only). To get the temperature on asics that use i2c chips, you need to load the appropriate hwmon driver for the sensor used on your board (lm63, lm64, etc.). The drm will attempt to load the appropriate hwmon driver. On boards that use the internal thermal sensor, the drm will set up the hwmon interface automatically. When the appropriate driver is loaded, the temperatures can be accessed via lm_sensors tools or via sysfs in /sys/class/hwmon.

Fan Speed

While the power saving features above should handle fan speeds quite well, some cards may still be too noisy in their idle state. In this case, and when your card supports it, you can change the fan speed manually.

Warning:
  • Keep in mind that the following method sets the fan speed to a fixed value, hence it will not adjust with the stress of the GPU, which can lead to overheating under heavy load.
  • Check GPU temperature when applying lower than standard values.

To control the GPU fan, see Fan speed control#AMDGPU sysfs fan control (amdgpu and radeon share the same controls for this).

For persistence, see the example in #Persistent configuration.

If a fixed value is not desired, there are possibilities to define a custom fan curve manually by, for example, writing a script in which fan speeds are set depending on the current temperature (current value in /sys/class/drm/card0/device/hwmon/hwmon0/temp1_input).

A GUI solution is available by installing radeon-profile-gitAUR.

TV out

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 supports only 800x600):

xrandr --addmode S-video 800x600

Clone mode:

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

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

Force TV-out in KMS

The kernel can recognize video= parameter in following form (see KMS for more details):

video=<conn>:<xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd]

For example:

video=DVI-I-1:1280x1024-24@60e

Parameters with whitespaces must be quoted:

"video=9-pin DIN-1:1024x768-24@60e"

Current mkinitcpio implementation also requires # in front. 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 Legacy can pass such command line as is.
  • LILO needs backslashes for doublequotes (append # \"video=9-pin DIN-1:1024x768-24@60e\")

You can get list of your video outputs with following command:

$ ls -1 /sys/class/drm/ | grep -E '^card[[:digit:]]+-' | cut -d- -f2-

HDMI audio

HDMI audio is supported in the xf86-video-ati video driver. To disable HDMI audio add radeon.audio=0 to your kernel parameters.

If there is no video after boot up, the driver option has to be disabled.

Note:

Multihead setup

Using the RandR extension

See Multihead#RandR how to setup multiple monitors by using RandR.

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:

/etc/X11/xorg.conf.d/20-radeon.conf
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, when using videocards that 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 explicitly specify "ZaphodHeads" "VGA-0".

Turn vsync off

The radeon driver will probably enable vsync by default, which is perfectly fine except for benchmarking. To turn it off try the vblank_mode=0 environment variable or create ~/.drirc (edit it if it already exists) and add the following:

~/.drirc
<driconf>
    <device screen="0" driver="dri2">
        <application name="Default">
            <option name="vblank_mode" value="0" />
        </application>
    </device>
    <!-- Other devices ... -->
</driconf>
Note: Make sure the driver is dri2, not your video card code (like r600).

If vsync is still enabled, you can disable it by editing /etc/X11/xorg.conf.d/20-radeon.conf. See #Driver options.

Troubleshooting

Performance and/or artifacts issues when using EXA

Note: This only applies to cards older than R600 (Radeon X1000 series and older). Newer cards you should use Glamor instead of EXA.

If having 2D performance issues, like slow scrolling in a terminal or webbrowser, adding Option "MigrationHeuristic" "greedy" as device option may solve the issue.

In addition disabling EXAPixmaps may solve artifacts issues, although this is generally not recommended and may cause other issues.

/etc/X11/xorg.conf.d/20-radeon.conf
Section "Device"
    Identifier "Radeon"
    Driver "radeon"
    Option "AccelMethod" "exa"
    Option "MigrationHeuristic" "greedy"
    #Option "EXAPixmaps" "off"
EndSection

Adding undetected/unsupported resolutions

See Xrandr#Adding undetected resolutions.

TV showing a black border around the screen

Note: Make sure the tv has been setup correctly (see manual) before attempting the following solution.

When connecting a TV using the HDMI port, the TV may show a blurry picture with a 2-3cm border around it. This protects against overscanning (see Wikipedia:Overscan), but can be turned off using xrandr:

xrandr --output HDMI-0 --set underscan off

Black screen and no console, but X works in KMS

This is a solution to the 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 the wrong framebuffer device that exists on the wrong card. This can be fixed by adding 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 exists on the wrong graphics card. If that does not fix your problem, try booting with

fbcon=map:0

instead.

ATI X1600 (RV530 series) 3D application show black windows

There are three possible solutions:

  • Try adding pci=nomsi to your boot loader Kernel parameters.
  • If this does not work, you can try adding noapic instead of pci=nomsi.
  • If none of the above work, then you can try running vblank_mode=0 glxgears or vblank_mode=1 glxgears to see which one works for you, then install driconfAUR and set that option in ~/.drirc.

Cursor corruption after coming out of sleep

If the cursor becomes corrupted like it's repeating itself vertically after the monitor(s) comes out of sleep, set "SWCursor" "True" in the "Device" section of the /etc/X11/xorg.conf.d/20-radeon.conf configuration file.

DisplayPort stays black on multimonitor mode

Try booting with the kernel parameter radeon.audio=0.

R9-390 Poor Performance and/or Instability

Firmware issues with R9-390 series cards include poor performance and crashes (frequently caused by gaming or using Google Maps) possibly related DPM. Comment 115 of this bug report includes instructions for a fix.

QHD / UHD / 4k support over HDMI for older Radeon cards

Older cards have their pixel clock limited to 165MHz for HDMI. Hence, they do not support QHD or 4k only via dual-link DVI but not over HDMI.

One possibility to work around this is to use custom modes with lower refresh rate, e.g. 30Hz.

Another one is a kernel patch removing the pixel clock limit, but this may damage the card!

Official kernel bug ticket with patch for 4.8: https://bugzilla.kernel.org/show_bug.cgi?id=172421

The patch introduces a new kernel parameter radeon.hdmimhz which alters the pixel clock limit.

Be sure to use a high speed HDMI cable for this.

See also

Benchmark showing the open source driver is on par performance-wise with the proprietary driver for many cards.