Difference between pages "Metro" and "Package:AMD Catalyst Video Drivers"

(Difference between pages)
 
 
Line 1: Line 1:
{{#layout:doc}}{{#widget:AddThis}}[[Metro]] is the build system for Funtoo Linux and [[Gentoo Linux]] stages. It automates the bootstrapping process.
+
{{Ebuild
 
+
|Summary=Accelerated ATI/AMD binary drivers for Radeon HD 5000 and newer chipsets.
This tutorial will take you through installing, setting up and running [[Metro]].
+
|CatPkg=x11-drivers/ati-drivers
 
+
|Maintainer=Drobbins
These other Metro documents are also available:
+
|Homepage=
 
+
|Repository=Funtoo Overlay
{{#ask: [[Category:Metro]]
+
|Overlay=Funtoo
|format=ul
+
 
}}
 
}}
  
= Preface =
+
{{Important|Version 14.12-r3 and above now include ATI GLESv2 and EGL libraries, which should improve stabilty with GNOME.}}
  
== How Metro Works ==
+
<tt>x11-drivers/ati-drivers</tt> (often referred to as "<tt>fglrx</tt>", the name of its kernel module) is the proprietary, accelerated driver for AMD (ATI) graphics cards.
  
Metro is the Funtoo Linux automated build system, and is used to build Funtoo Linux stage tarballs.
+
=== Preparing to Install ===
  
[[Metro]] cannot create a stage tarball out of thin air. To build a new stage tarball, [[Metro]] must use an existing, older stage tarball called a "seed" stage. This seed stage typically is used as the ''build environment'' for creating the stage we want.
+
==== Default Kernel ====
  
[[Metro]] can use two kinds of seed stages. Traditionally, [[Metro]] has used a stage3 as a seed stage. This stage3 is then used to build a new stage1, which in turn is used to build a new stage2, and then a new stage3. This is generally the most reliable way to build [[Gentoo Linux]] or Funtoo Linux, so it's the recommended approach.
+
If you are using the default kernel -- one like debian-sources that was built automatically, then you'll want to blacklist a few modules to prevent them from loading and interfering with the AMD Catalyst module. To avoid having the open source Radeon drivers automatically load and ruin your day, create a blacklist file as follows:
{{fancyimportant|'''After switching metro builds to Funtoo profile, Gentoo stages are no longer provided'''!}}
+
  
== Seeds and Build Isolation ==
+
{{file|name=/etc/modprobe.d/radeon.conf|desc=Prevent open source DRM and radeon drivers from loading|body=
 +
blacklist radeon
 +
blacklist drm
 +
}}
  
Another important concept to mention here is something called ''build isolation''. Because [[Metro]] creates an isolated build environment, and the build environment is explicitly defined using existing, tangible entities -- a seed stage and a portage snapshot -- you will get consistent, repeatable results. In other words, the same seed stage, portage snapshot and build instructions will generate an essentially identical result, even if you perform the build a month later on someone else's workstation.
+
==== Custom Kernel ====
  
== Local Build ==
+
If you are building a custom kernel, rather than blacklisting modules as above, you can simply ensure that the Direct Rendering Manager and in-kernel Radeon drivers are not enabled. If you do build them as modules, you will need to blacklist them as above. Also ensure that the following kernel options are enabled.
  
Say you wanted to build a new <tt>pentium4</tt> stage3 tarball. The recommended method of doing this would be to grab an existing <tt>pentium4</tt> stage3 tarball to use as your seed stage. [[Metro]] will be told to use this existing <tt>pentium4</tt> stage3 to build a new stage1 for the same <tt>pentium4</tt>. For this process, the generic <tt>pentium4</tt> stage3 would provide the ''build environment'' for creating our new stage1. Then, the new stage1 would serve as the build environment for creating the new <tt>pentium4</tt> stage2. And the new <tt>pentium4</tt> stage2 would serve as the build environment for creating the new <tt>pentium4</tt> stage3.
+
{{kernelop|desc=
 +
[*] Enable loadable module support
 +
Processor type and features --->
 +
      [*] MTRR (Memory Type Range Register) support
 +
Bus options (PCI etc.) --->
 +
      [*] PCI Express Port Bus Support
 +
      [*] Message Signaled Interrupts (MSI and MSI-X)
 +
Device Drivers --->
 +
      Graphics support --->
 +
            < > Direct Rendering Manager (xFree86 4.1.0 and higher DRI support) --->
 +
}}
  
In the [[Metro]] terminology this is called a '''local build''', which means a stage3 of a given architecture is used to seed a brand new build of the same architecture. Incidentally this will be the first exercise we are going to perform in this tutorial.
+
{{note|If you need support for AGP cards, enable the following kernel options:}}
 
+
{{kernelop|desc=
A week later, you may want to build a brand new <tt>pentium4</tt> stage3 tarball. Rather than starting from the original <tt>pentium4</tt> stage3 again, you'd probably configure [[Metro]] to use the most-recently-built <tt>pentium4</tt> stage3 as the seed. [[Metro]] has built-in functionality to make this easy, allowing it to easily find and track the most recent stage3 seed available.
+
Device Drivers --->
 
+
      Graphics support --->
== Remote Build ==
+
            <*> /dev/agpgart (AGP Support) --->
 
+
                  Select an appropriate AGP driver:
[[Metro]] can also perform '''remote build''', where a stage3 of a different, but binary compatible, architecture is used as a seed to build a different architecture stage3. Consequentiality the second exercise we are going to perform in this tutorial will be to build a <tt>core2 32bit</tt> stage3 tarball from the <tt>pentium4</tt> stage3 tarball we have just built.
+
                  <*> AMD Opteron/Athlon64 on-CPU GART support
 
+
}}
TODO: add caveats about what archs can be seeded and what can be not (maybe a table?)
+
 
+
== Tailored Build ==
+
 
+
Last, it's also worthy noting that both in <tt>local</tt> and <tt>remote builds</tt>, [[Metro]] can be configured to add and/or remove individual packages to the final tarball.
+
Let's say you can't live without <tt>app-misc/screen</tt>, at the end of this tutorial, we will show how to have your tailored stage3 to include it.
+
 
+
== Installing Metro ==
+
 
+
'''The recommended and supported method''' is to use the Git repository of [[Metro]]. 
+
  
Ensure that {{Package|dev-vcs/git}} and {{Package|dev-python/boto}} (optional; required for EC2 support) are installed on your system:
+
=== Editing make.conf ===
  
 +
Add the following to your <code>/etc/make.conf</code>:
 
<console>
 
<console>
# ##i##emerge dev-vcs/git
+
# ##i##nano /etc/make.conf
# ##i##emerge dev-python/boto
+
VIDEO_CARDS="fglrx"
 
</console>
 
</console>
  
Next, clone the master git repository as follows:
+
=== Enabling AMD Catalyst Control Center ===
  
 +
Then, add the following to <code>/etc/portage/package.use</code> if you would like to enable support for AMD Catalyst Control Center:
 
<console>
 
<console>
# ##i##cd /root
+
###i## nano /etc/portage/package.use
# ##i##git clone git://github.com/funtoo/metro.git
+
x11-drivers/ati-drivers qt4
# ##i##cp /root/metro/metro.conf ~/.metro
+
 
</console>
 
</console>
  
You will now have a directory called <tt>/root/metro</tt> that contains all the [[Metro]] source code.
+
{{Note|If you are using a desktop or workstation profile, this USE flag will be enabled by default.}}
  
Metro is now installed. It's time to customize it for your local system.
+
=== Emerging the package ===
  
= Configuring Metro =
+
If you allready have emerged xorg-server, all you need to install the drivers is running the following command:
 
+
{{Note|Metro is not currently able to build Gentoo stages. See {{Bug|FL-901}}.}}
+
 
+
[[User:Drobbins|Daniel Robbins]] maintains [[Metro]], so it comes pre-configured to successfully build Funtoo Linux releases. Before reading further, you might want to customize some basic settings like the number of concurrent jobs to fit your hardware's capabilities or the directory to use for produced stage archives. This is accomplished by editing <tt>~/.metro</tt> which is the [[Metro]]'s master configuration file.
+
 
+
Please note that <code>path/install</code> must point to where metro was installed. Point <code>path/distfiles</code> to where your distfiles reside. Also set <code>path/mirror/owner</code> and <code>path/mirror/group</code> to the owner and group of all the files that will be written to the build repository directory, which by default (as per the configuration file) is at <code>/home/mirror/funtoo</code>. The cache directory normally resides inside the temp directory -- this can be modified as desired. The cache directory can end up holding many cached .tbz2 packages, and eat up a lot of storage. You may want to place the temp directory on faster storage, for faster compile times, and place the cache directory on slower, but more plentiful storage.
+
 
+
{{file|name=.metro|desc=Metro configuration|body=
+
# Main metro configuration file - these settings need to be tailored to your install:
+
 
+
[section path]
+
install: /root/metro
+
tmp: /var/tmp/metro
+
cache: $[path/tmp]/cache
+
distfiles: /var/src/distfiles
+
work: $[path/tmp]/work/$[target/build]/$[target/name]
+
 
+
[section path/mirror]
+
 
+
: /home/mirror/funtoo
+
owner: root
+
group: repomgr
+
dirmode: 775
+
 
+
[section portage]
+
 
+
MAKEOPTS: auto
+
 
+
[section emerge]
+
 
+
options: --jobs=4 --load-average=4 --keep-going=n
+
 
+
# This line should not be modified:
+
[collect $[path/install]/etc/master.conf]
+
}}
+
 
+
== Arch and Subarch ==
+
 
+
In the following example we are creating a pentium4 stage 3 compiled for x86-32bit binary compatibility. Pentium4 is a subarch of the x86-32bit architecture. Once you have metro installed you may find a full list of each subarch in your <tt>/root/metro/subarch</tt> directory each subarch will have the file extension .spec
+
Example:
+
 
<console>
 
<console>
###i## ls /root/metro/subarch
+
###i## emerge -av --changed-use --deep @world
# ls subarch/
+
amd64-bulldozer-pure64.spec  armv7a.spec          core-avx-i.spec        i686.spec        pentium.spec
+
amd64-bulldozer.spec        armv7a_hardfp.spec  core2_32.spec          k6-2.spec        pentium2.spec
+
amd64-k10-pure64.spec        athlon-4.spec        core2_64-pure64.spec    k6-3.spec        pentium3.spec
+
amd64-k10.spec              athlon-mp.spec      core2_64.spec          k6.spec          pentium4.spec
+
amd64-k8+sse3.spec          athlon-tbird.spec    corei7-pure64.spec      native_32.spec    pentiumpro.spec
+
amd64-k8+sse3_32.spec        athlon-xp.spec      corei7.spec            native_64.spec    prescott.spec
+
amd64-k8-pure64.spec        athlon.spec          generic_32.spec        niagara.spec      ultrasparc.spec
+
amd64-k8.spec                atom_32.spec        generic_64-pure64.spec  niagara2.spec    ultrasparc3.spec
+
amd64-k8_32.spec            atom_64-pure64.spec  generic_64.spec        nocona.spec      xen-pentium4+sse3.spec
+
armv5te.spec                atom_64.spec        generic_sparcv9.spec    opteron_64.spec  xen-pentium4+sse3_64.spec
+
armv6j.spec                  btver1.spec          geode.spec              pentium-m.spec
+
armv6j_hardfp.spec          btver1_64.spec      i486.spec              pentium-mmx.spec
+
 
</console>
 
</console>
  
= First stages build (local build) =
+
otherwise you may install the drivers with
 
+
To get this all started, we need to bootstrap the process by downloading an initial seed stage3 to use for building and place it in its proper location in <tt>/home/mirror/funtoo</tt>, so that [[Metro]] can find it. We will also need to create some special &quot;control&quot; files in <tt>/home/mirror/funtoo</tt>, which will allow [[Metro]] to understand how it is supposed to proceed.
+
 
+
== Step 1: Set up pentium4 repository (local build) ==
+
 
+
Assuming we're following the basic steps outlined in the previous section, and building an unstable funtoo (<tt>funtoo-current</tt>) build for the <tt>pentium4</tt>, using a generic <tt>pentium4</tt> stage3 as a seed stage, then here the first set of steps we'd perform:
+
 
+
 
<console>
 
<console>
# ##i##install -d /home/mirror/funtoo/funtoo-current/x86-32bit/pentium4
+
###i## emerge -av x11-drivers/ati-drivers
# ##i##install -d /home/mirror/funtoo/funtoo-current/snapshots
+
# ##i##cd /home/metro/mirror/funtoo/funtoo-current/x86-32bit/pentium4
+
# ##i##install -d 2011-12-13
+
# ##i##cd 2011-12-13
+
# ##i##wget -c http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-32bit/pentium4/2011-12-13/stage3-pentium4-funtoo-current-2011-12-13.tar.xz
+
# ##i##cd ..
+
# ##i##install -d .control/version
+
# ##i##echo "2011-12-13" > .control/version/stage3
+
# ##i##install -d .control/strategy
+
# ##i##echo local >  .control/strategy/build
+
# ##i##echo stage3 > .control/strategy/seed
+
 
</console>
 
</console>
  
OK, let's review the steps above. First, we create the directory <tt>/home/mirror/funtoo/funtoo-current/x86-32bit/pentium4</tt>, which is where Metro will expect to find unstable <tt>funtoo-current</tt> pentium4 builds -- it is configured to look here by default. Then we create a specially-named directory to house our seed x86 stage3. Again, by default, Metro expects the directory to be named this way. We enter this directory, and download our seed x86 stage3 from funtoo.org. Note that the <tt>2010-12-24</tt> version stamp matches. Make sure that your directory name matches the stage3 name too. Everything has been set up to match Metro's default filesystem layout.
+
Before using the driver, ensure that the "fglrx" module has been loaded -- run {{c|modprobe fglrx}} as root  -- it should return with no error. If the module can't be found, run {{c|depmod -a}} as root -- then the modprobe command should work. If you are switching from the open source Radeon driver, then shutting down your desktop and rebooting your system (be sure to disable xdm) may be required to get the new "fglrx" module to load cleanly.
 
+
Next, we go back to the <tt>/home/mirror/metro/funtoo-current/x86-32bit/pentium4</tt> directory, and inside it, we create a <tt>.control</tt> directory. This directory and its subdirectories contain special files that Metro references to determine certain aspects of its behavior. The <tt>.control/version/stage3</tt> file is used by Metro to track the most recently-built stage3 for this particular build and subarch. Metro will automatically update this file with a new version stamp after it successfully builds a new stage3. But because Metro didn't actually ''build'' this stage3, we need to set up the <tt>.control/version/stage3</tt> file manually. This will allow Metro to find our downloaded stage3 when we set up our pentium4 build to use it as a seed. Also note that Metro will create a similar <tt>.control/version/stage1</tt> file after it successfully builds an pentium4 funtoo-current stage1.
+
 
+
We also set up <tt>.control/strategy/build</tt> and <tt>.control/strategy/seed</tt> files with values of <tt>local</tt> and <tt>stage3</tt> respectively. These files define the building strategy Metro will use when we build pentium4 funtoo-current stages. With a build strategy of <tt>local</tt>, Metro will source its seed stage from funtoo-current pentium4, the current directory. And with a seed strategy of <tt>stage3</tt>, Metro will use a stage3 as a seed, and use this seed to build a new stage1, stage2 and stage3.
+
  
== Step 2: Building the pentium4 stages ==
+
=== Configuring ===
  
Incidentally, if all you wanted to do at this point was to build a new pentium4 funtoo-current stage1/2/3 (plus openvz and vserver templates). You would begin the process by typing:
+
Next, set ati-drivers to manage the system's OpenGL and OpenCL implementations.  
 +
Doing this is particulary important for desktop environments like GNOME, which use hardware acceleration by default. Not doing this will result in the GNOME display manager not being able to start!
  
 
<console>
 
<console>
# ##i##cd /root/metro
+
###i## eselect opengl set ati
# ##i##scripts/ezbuild.sh funtoo-current pentium4
+
###i## eselect opencl set amd
 
</console>
 
</console>
  
If you have a slow machine, it could take several hours to be completed because several "heavy" components like gcc or glibc have to be recompiled in each stage. Once a stage has been successfully completed, it is placed in the <tt>"${METRO_MIRROR}/funtoo-current/x32-bit/pentium4/YYYY-MM-DD"</tt> subdirectory, where <tt>YYYY-MM-DD</tt> is today's date at the time the <tt>ezbuild.sh</tt> script was started or the date you put on the ezscript.sh command line.
+
Afterwards, run <code>aticonfig</code> to modify the X-server configuration file to work with the ati-drivers:  
 
+
= Building for another binary compatible architecture (remote build) =
+
 
+
As written above, [[Metro]] is able to perform '''remote build''' building different architecture stage3 from a binary compatible seeding stage3 (e.g. using a pentium4 stage3 to seed a <tt>Intel Core2 32bits</tt> stage3).
+
 
+
In the Metro terminology this is called a '''remote build''' (a stage 3 of a different, but binary compatible, architecture is used as a seed).
+
What's not compatible? You can't use a <tt>Sparc</tt> architecture to generate an <tt>x86</tt> or <tt>ARM</tt> based stage and vice-versa. If you use a 32bit stage then you don't want to seed a 64bit build from it. Be sure that you are using a stage from the same architecture that you are trying to seed. Check [http://ftp.osuosl.org/pub/funtoo/funtoo-current/ Funtoo-current FTP Mirror] for a stage that is from the same Architecture that you will be building. 
+
 
+
{{Note|Often, one build (ie. funtoo-current) can be used as a seed for another build such as funtoo-stable. However, hardened builds require hardened stages as seeds in order for the build to complete successfully.}}
+
 
+
== Step 1: Set up Core_2 32bit repository ==
+
 
+
In this example, we're going to use this pentium4 funtoo-current stage3 to seed a new Core_2 32bit funtoo-current build. To get that done, we need to set up the pentium4 build directory as follows:
+
 
+
 
<console>
 
<console>
# ##i## cd /home/mirror/funtoo/funtoo-current/x86-32bit
+
###i## aticonfig --initial
# ##i##install -d core2_32
+
# ##i##cd core2_32
+
# ##i##install -d .control/strategy
+
# ##i##echo remote > .control/strategy/build
+
# ##i##echo stage3 > .control/strategy/seed
+
# ##i##install -d .control/remote
+
# ##i##echo funtoo-current > .control/remote/build
+
# ##i##echo x86-32bit > .control/remote/arch_desc
+
# ##i##echo pentium4 > .control/remote/subarch
+
 
</console>
 
</console>
  
The steps we follow are similar to those we performed for a ''local build'' to set up our pentium4 directory for local build. However, note the differences. We didn't download a stage, because we are going to use the pentium4 stage to build a new Core_2 32bit stage. We also didn't create the <tt>.control/version/stage{1,3}</tt> files because Metro will create them for us after it successfully builds a new stage1 and stage3. We are still using a <tt>stage3</tt> seed strategy, but we've set the build strategy to <tt>remote</tt>, which means that we're going to use a seed stage that's not from this particular subdirectory. Where are we going to get it from? The <tt>.control/remote</tt> directory contains this information, and lets Metro know that it should look for its seed stage3 in the <tt>/home/mirror/funtoo/funtoo-current/x86-32bit/pentium4</tt> directory. Which one will it grab? You guessed it -- the most recently built ''stage3'' (since our seed strategy was set to <tt>stage3</tt>) that has the version stamp of <tt>2010-12-24</tt>, as recorded in <tt>/home/mirror/funtoo-current/x86-32bit/pentium4/.control/version/stage</tt>. Now you can see how all those control files come together to direct Metro to do the right thing.
+
{{tip|If you would like to have a full-resolution framebuffer with ati-drivers, check out [[uvesafb| uvesafb]]}}
  
{{Note|<code>arch_desc</code> should be set to one of: <code>x86-32bit</code>, <code>x86-64bit</code> or <code>pure64</code> for PC-compatible systems. You must use a 32-bit build as a seed for other 32-bit builds, and a 64-bit build as a seed for other 64-bit builds.}}
+
=== Multi-Head Display ===
  
== Step 2: Building the Core_2 32bit stages ==
+
There are a couple of options for setting up a multi-head display. For some systems, all you need to do is plug in your additional monitor, and it will be detected by your desktop environment, and will work.
  
Now, you could start building your new Core_2 32bit stage1/2/3 (plus openvz and vserver templates) by typing the following:
+
If your second monitor does not display anything at all, then play around with your X configuration. Try using the following command to generate a new X config:
 
+
<console>
+
# ##i##/root/metro/scripts/ezbuild.sh funtoo-current core2_32
+
</console>
+
 
+
In that case, the produced stages are placed in the <tt>/home/mirror/funtoo/funtoo-current/x32-bit/core2_32/YYYY-MM-DD</tt> subdirectory.
+
 
+
== Step 3: The Next Build ==
+
 
+
At this point, you now have a new Core_2 32bit stage3, built using a "remote" pentium4 stage3. Once the first remote build completes successfully, metro will automatically change <code>.control/strategy/build</code> to be <code>local</code> instead of <code>remote</code>, so it will use the most recently-built Core_2 32bit stage3 as a seed for any new Core_2 32bit builds from now on.
+
 
+
= Build your own tailored stage3 =
+
 
+
Metro can be easily configured for building custom stage3 by including additional packages. Edit the following configuration file <tt>/root/metro/etc/builds/funtoo-current/build.conf</tt>:
+
{{file|name=funtoo-current/build.conf|body=
+
[collect ../../fslayouts/funtoo/layout.conf]
+
 
+
[section release]
+
 
+
author: Daniel Robbins <drobbins@funtoo.org>
+
 
+
[section target]
+
 
+
compression: xz
+
 
+
[section portage]
+
 
+
FEATURES:
+
SYNC: $[snapshot/source/remote]
+
USE:
+
 
+
[section profile]
+
 
+
format: new
+
path: gentoo:funtoo/1.0/linux-gnu
+
arch: $[:path]/arch/$[target/arch_desc]
+
build: $[:path]/build/current
+
flavor: $[:path]/flavor/core
+
mix-ins:
+
 
+
[section version]
+
 
+
python: 2.7
+
 
+
[section emerge]
+
 
+
 
+
[section snapshot]
+
 
+
type: live
+
compression: xz
+
 
+
[section snapshot/source]
+
 
+
type: git
+
branch: funtoo.org
+
# branch to have checked out for tarball:
+
branch/tar: origin/master
+
name: ports-2012
+
remote: git://github.com/funtoo/ports-2012.git
+
options: pull
+
 
+
[section metro]
+
 
+
options:
+
options/stage: cache/package
+
target: gentoo
+
 
+
[section baselayout]
+
 
+
services: sshd
+
 
+
[section multi]
+
 
+
snapshot: snapshot
+
 
+
[section files]
+
 
+
motd/trailer: [
+
 
+
>>> Send suggestions, improvements, bug reports relating to...
+
 
+
>>> This release:                  $[release/author]
+
>>> Funtoo Linux (general):        Funtoo Linux (http://www.funtoo.org)
+
>>> Gentoo Linux (general):        Gentoo Linux (http://www.gentoo.org)
+
]
+
 
+
[collect ../../multi-targets/$[multi/mode:zap]]
+
}}
+
 
+
= Building Gentoo stages =
+
 
+
Currently, Gentoo stages cannot be built in Metro. We have an open bug for this -- it is simply due to the fact that we focus on ensuring Funtoo Linux builds and building Gentoo is a lower priority. Historical note: Funtoo Linux originally started as a fork of Gentoo Linux so that metro could reliably build Gentoo stages.
+
 
+
= Advanced Features =
+
 
+
Metro also includes a number of advanced features that can be used to automate builds and set up distributed build servers. These features require you to {{c|emerge sqlalchemy}}, as SQLite is used as a dependency.
+
 
+
== Repository Management ==
+
 
+
Metro includes a script in the {{c|scripts}} directory called {{c|buildrepo}}. Buildrepo serves as the heart of Metro's advanced repository management features.
+
 
+
=== Initial Setup ===
+
 
+
To use {{c|buildrepo}}, you will first need to create a {{f|.buildbot}} configuration file. Here is the file I use on my AMD Jaguar build server:
+
 
+
{{file|name=/root/.buildbot|lang=python|body=
+
builds = (
+
"funtoo-current",
+
"funtoo-current-hardened",
+
"funtoo-stable",
+
)
+
 
+
arches = (
+
"x86-64bit",
+
"pure64"
+
)
+
 
+
subarches = (
+
"amd64-jaguar",
+
"amd64-jaguar-pure64",
+
)
+
 
+
def map_build(build, subarch, full, full_date):
+
# arguments refer to last build...
+
if full == True:
+
buildtype =  ( "freshen", )
+
else:
+
buildtype =  ("full", )
+
return buildtype
+
}}
+
 
+
This file is actually a python source file that defines the tuples {{c|builds}}, {{c|arches}} and {{c|subarches}}. These variables tell {{c|buildrepo}} which builds, arches and subarches it should manage. A {{c|map_build()}} function is also defined which {{c|buildbot}} uses to determine what kind of build to perform. The arguments passed to the function are based on the last successful build. The function can read these arguments and return a string to define the type of the next build. In the above example, the {{c|map_build()}} function will cause the next build after a freshen build to be a full build, and the next build after a full build to be a freshen build, so that the build will alternate between full and freshen.
+
 
+
== Automated Builds ==
+
 
+
Once the {{c|.buildbot}} file has been created, the {{c|buildrepo}} and {{c|buildbot.sh}} tools are ready to use. Here's how they work. These tools are designed to keep your repository ({{c|path/mirror}} in {{f|/root/.metro}} up-to-date by inspecting your repository and looking for stages that are out-of-date.
+
 
+
To list the next build that will be performed, do this -- this is from my ARM build server:
+
  
 
{{console|body=
 
{{console|body=
# ##i##./buildrepo nextbuild
+
# ##i##aticonfig --initial=dual-head
build=funtoo-current
+
}}  
arch_desc=arm-32bit
+
subarch=armv7a_hardfp
+
fulldate=2015-02-08
+
nextdate=2015-02-20
+
failcount=0
+
target=full
+
extras=''
+
}}
+
  
If no output is displayed, then all your builds are up-to-date.
+
You can use the {{c|--screen-layout={left|right|above|below}}} option to specify the relationship of the second screen to the first.
  
To actually run the next build, run {{c|buildbot.sh}}:
+
For more than two heads, or multiple cards, you can use the following approach to generate an appropriate X config. First, list adapters to see what adapters are available:
  
 
{{console|body=
 
{{console|body=
# ##i##./buildbot.sh
+
# ##i##aticonfig --list-adapters
 
}}
 
}}
  
If you're thinking that {{c|buildbot.sh}} would be a good candidate for a cron job, you've got the right idea!
+
Now, a variant of one of the following commands to generate an X configuration for your needs:
 
+
=== List Builds ===
+
 
+
To get a quick look at our repository, let's run the {{c|buildrepo fails}} command:
+
  
 
{{console|body=
 
{{console|body=
# ##i##./buildrepo fails
+
# ##i##aticonfig --initial --heads=4 --adapter=1
  0  2015-02-18 /home/mirror/funtoo/funtoo-current/x86-64bit/amd64-jaguar
+
# ##i##aticonfig --adapter=0,2 --initial
  0  2015-02-18 /home/mirror/funtoo/funtoo-current/pure64/amd64-jaguar-pure64
+
# ##i##aticonfig --adapter=all --initial
  0  2015-02-18 /home/mirror/funtoo/funtoo-current-hardened/x86-64bit/amd64-jaguar
+
# ##i##aticonfig --xinerama=on
  0   2015-02-18 /home/mirror/funtoo/funtoo-current-hardened/pure64/amd64-jaguar-pure64
+
  0  2015-02-18 /home/mirror/funtoo/funtoo-stable/x86-64bit/amd64-jaguar
+
  0  2015-02-18 /home/mirror/funtoo/funtoo-stable/pure64/amd64-jaguar-pure64
+
 
}}
 
}}
  
On my AMD Jaguar build server, on Feb 20, 2015, this lists all the builds that {{c|buildrepo}} has been configured to manage. The first number on each line is a '''failcount''', which is the number of consecutive times that the build has failed. A zero value indicates that everything's okay. The failcount is an important feature of the advanced repository management features. Here are a number of behaviors that are implemented based on failcount:
+
One you have your displays enabled so that your mouse pointer can move to all displays, you still may not be able to drag windows to certain monitors. In this situation, each monitor is probably configured as a separate X screen, and you'll need to use the Catalyst Control Center {{c|amdcccle}} GUI configuration tool to tie them together. The Catalyst Control Center is installed when the {{c|qt4}} USE variable is enabled.
  
* If {{c|buildbot.sh}} tries to build a stage and the build fails, the failcount is incremented.
+
Open up a graphical terminal, and become root by typing {{c|su -}} -- your user will need to be in the {{c|wheel}} group to do this:
* If the build succeeds for a particular build, the failcount is reset to zero.
+
* Builds with the lowest failcount are prioritized by {{buildrepo}} to build next, to steer towards builds that are more likely to complete successfully.
+
* Once the failcount reaches 3 for a particular build, it is removed from the build rotation.
+
 
+
=== Resetting Failcount ===
+
 
+
If a build has issues, the failcount for a build will reach 3, at which point it will be pulled out of build rotation. To clear failcount, so that these builds are attempted again -- possibly fixed by new updates to the Portage tree -- use {{c|buildrepo zap}}:
+
  
 
{{console|body=
 
{{console|body=
# /root/metro/scripts/buildrepo zap
+
$ ##i##su -
Removing /mnt/data/funtoo/funtoo-current/arm-32bit/armv7a_hardfp/.control/.failcount...
+
Password: ##i##*******
Removing /mnt/data/funtoo/funtoo-current/arm-32bit/armv6j_hardfp/.control/.failcount...
+
# source /etc/profile
Removing /mnt/data/funtoo/funtoo-current/arm-32bit/armv5te/.control/.failcount...
+
# amdcccle
 
}}
 
}}
  
== Repository Maintenance ==
+
[[File:amdcccle.png|class=img-responsive|center]]
 +
Navigate to Display Manager, and choose the option {{c|Multi-display desktop with display(s) X}} for each display. Then, drag and drop the blue displays to arrange them to match how they are arranged in front of you. Click {{c|OK}}. The Catalyst Control Center will tell you that you will need to restart your system for the changes to take effect. Simply log out if you are running {{c|xdm}}, or end your X session, and start it up again. You should now have a fully-functioning multi-head display.
  
A couple of repository maintenance tools are provided:
+
=== Troubleshooting ===
 +
==== I am using a HDMI connection, and my monitor's display has a black border around it. ====
 +
Disable overscan as follows:
  
* {{c|buildrepo digestgen}} will generate hash files for the archives in your repository, and clean up stale hashes.
+
<console>
* {{c|buildrepo index.xml}} will create an index.xml file at the root of your repository, listing all builds available.
+
$ ##i##su -
* {{c|buildrepo clean}} will output a shell script that will remove old stages. No more than the three most recent stage builds for each build/arch/subarch are kept.
+
Password: ##i##*********
 +
# ##i##aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0
 +
</console>
  
== Distributed Repositories ==
+
You will need to restart your X session for the changes to take effect. If you are using a display manager, logging out and back in again should cause the new settings to be visible.
  
In many situation, you will have a number of build servers, and each will build a subset of your master repository, and then upload builds to the master repository. This is an area of Metro that is being actively developed. For now, automated upload functionality is not enabled, but is expected to be implemented in the relatively near future. However, it is possible to have your master repository differentiate between subarches that are built locally, and thus should be part of that system's {{c|buildbot}} build rotation, and those that are stored locally and built remotely. These builds should be cleaned when {{c|buildrepo clean}} is run, but should not enter the local build rotation. To set this up, modify {{f|/root/.buildbot}} and use the {{c|subarches}} and {{c|all_subarches}} variables:
+
==== The tabs in Google Chrome are becoming garbled/corrupted ====
  
{{file|name=/root/.metro|desc=Excerpt of .metro config for master repository|body=
+
New versions of Google Chrome use hardware acceleration by default which appears to have rendering issues with AMD's drivers. To work around this, disable hardware acceleration in Google Chrome by going to {{c|Settings}}, {{c|Show advanced settings...}} and then uncheck the {{c|Use hardware acceleration when available (requires Chrome restart)}}. Once Chrome is restarted, the rendering problem should be resolved.
# subarches we are building locally:
+
  
subarches = (
+
==== Compton with backend glx does not work well with ati-drivers ====
        "pentium4",
+
Try running compton with the following switches:
        "athlon-xp",
+
<console>
        "corei7",
+
###i## compton --backend glx --vsync none --paint-on-overlay
        "corei7-pure64",
+
</console>
        "generic_32",
+
        "i686",
+
        "amd64-k8",
+
        "amd64-k8-pure64",
+
        "core2_64",
+
        "core2_64-pure64",
+
        "generic_64",
+
        "generic_64-pure64",
+
)
+
 
+
# Things we need to clean, even if we may not be building:
+
 
+
all_subarches = subarches + (
+
        "atom_32",
+
        "atom_64",
+
        "atom_64-pure64",
+
        "amd64-k10",
+
        "amd64-k10-pure64",
+
        "amd64-bulldozer",
+
        "amd64-bulldozer-pure64",
+
        "amd64-steamroller",
+
        "amd64-steamroller-pure64",
+
        "amd64-piledriver",
+
        "amd64-piledriver-pure64",
+
        "amd64-jaguar",
+
        "amd64-jaguar-pure64",
+
        "intel64-haswell",
+
        "intel64-haswell-pure64",
+
        "intel64-ivybridge-pure64",
+
        "intel64-ivybridge",
+
        "armv7a_hardfp",
+
        "armv6j_hardfp",
+
        "armv5te"
+
)
+
}}
+
  
[[Category:HOWTO]]
+
[[Category:Video Cards]]
[[Category:Metro]]
+
[[Category:First Steps]]
__TOC__
+
{{EbuildFooter}}

Revision as of 17:42, February 22, 2015

x11-drivers/ati-drivers


Current Maintainer(s):Daniel Robbins
Source Repository:Repository:Funtoo Overlay


Summary: Accelerated ATI/AMD binary drivers for Radeon HD 5000 and newer chipsets.

Use Flags

qt4
Install qt4 dependent optional tools (e.g Catalyst Control Panel)
modules
Build the kernel modules
disable-watermark
Do a potentially dangerous binary search and replace to disable watermark
pax_kernel
Enable pax kernel specific patches
vaapi
Enabled Video Acceleration API

News

Drobbins

IP Space Migration Continues

All Funtoo user containers in the 8.28 IP space will be moving into our new IP space (172.97) over the next few days. If you have DNS set up -- be sure to watch your container and update to the new IP! container.host.funtoo.org DNS will be updated after the move.
2015-08-27 by Drobbins
Drobbins

Funtoo Hosting IP Move

Funtoo user containers with IPs in the 72.18.x.x range will be gradually migrating to new IP addresses this week. If you have DNS entries for your containers, please be aware that your DNS will need to be updated.
2015-08-11 by Drobbins
Drobbins

New ARM Stages

New ARM Stages, built with a new toolchain, are now hitting mirrors. Existing ARM users should re-install using these stages (dated Aug 3, 2015 or later,) rather than upgrade using emerge.
2015-08-06 by Drobbins
More...

AMD Catalyst Video Drivers

Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.


Important

Version 14.12-r3 and above now include ATI GLESv2 and EGL libraries, which should improve stabilty with GNOME.

x11-drivers/ati-drivers (often referred to as "fglrx", the name of its kernel module) is the proprietary, accelerated driver for AMD (ATI) graphics cards.

Preparing to Install

Default Kernel

If you are using the default kernel -- one like debian-sources that was built automatically, then you'll want to blacklist a few modules to prevent them from loading and interfering with the AMD Catalyst module. To avoid having the open source Radeon drivers automatically load and ruin your day, create a blacklist file as follows:

/etc/modprobe.d/radeon.conf - Prevent open source DRM and radeon drivers from loading
blacklist radeon
blacklist drm

Custom Kernel

If you are building a custom kernel, rather than blacklisting modules as above, you can simply ensure that the Direct Rendering Manager and in-kernel Radeon drivers are not enabled. If you do build them as modules, you will need to blacklist them as above. Also ensure that the following kernel options are enabled.


[*] Enable loadable module support
Processor type and features --->
      [*] MTRR (Memory Type Range Register) support
Bus options (PCI etc.) --->
      [*] PCI Express Port Bus Support
      [*] Message Signaled Interrupts (MSI and MSI-X)
Device Drivers --->
      Graphics support --->
            < > Direct Rendering Manager (xFree86 4.1.0 and higher DRI support) --->
Note

If you need support for AGP cards, enable the following kernel options:

Device Drivers --->
      Graphics support --->
            <*> /dev/agpgart (AGP Support) --->
                  Select an appropriate AGP driver:
                  <*> AMD Opteron/Athlon64 on-CPU GART support

Editing make.conf

Add the following to your /etc/make.conf:

# nano /etc/make.conf
VIDEO_CARDS="fglrx"

Enabling AMD Catalyst Control Center

Then, add the following to /etc/portage/package.use if you would like to enable support for AMD Catalyst Control Center:

# nano /etc/portage/package.use
x11-drivers/ati-drivers qt4
Note

If you are using a desktop or workstation profile, this USE flag will be enabled by default.

Emerging the package

If you allready have emerged xorg-server, all you need to install the drivers is running the following command:

# emerge -av --changed-use --deep @world

otherwise you may install the drivers with

# emerge -av x11-drivers/ati-drivers

Before using the driver, ensure that the "fglrx" module has been loaded -- run modprobe fglrx as root -- it should return with no error. If the module can't be found, run depmod -a as root -- then the modprobe command should work. If you are switching from the open source Radeon driver, then shutting down your desktop and rebooting your system (be sure to disable xdm) may be required to get the new "fglrx" module to load cleanly.

Configuring

Next, set ati-drivers to manage the system's OpenGL and OpenCL implementations. Doing this is particulary important for desktop environments like GNOME, which use hardware acceleration by default. Not doing this will result in the GNOME display manager not being able to start!

# eselect opengl set ati
# eselect opencl set amd

Afterwards, run aticonfig to modify the X-server configuration file to work with the ati-drivers:

# aticonfig --initial
Tip

If you would like to have a full-resolution framebuffer with ati-drivers, check out uvesafb

Multi-Head Display

There are a couple of options for setting up a multi-head display. For some systems, all you need to do is plug in your additional monitor, and it will be detected by your desktop environment, and will work.

If your second monitor does not display anything at all, then play around with your X configuration. Try using the following command to generate a new X config:

# aticonfig --initial=dual-head


You can use the right} option to specify the relationship of the second screen to the first.

For more than two heads, or multiple cards, you can use the following approach to generate an appropriate X config. First, list adapters to see what adapters are available:

# aticonfig --list-adapters


Now, a variant of one of the following commands to generate an X configuration for your needs:

# aticonfig --initial --heads=4 --adapter=1 
# aticonfig --adapter=0,2 --initial
# aticonfig --adapter=all --initial
# aticonfig --xinerama=on


One you have your displays enabled so that your mouse pointer can move to all displays, you still may not be able to drag windows to certain monitors. In this situation, each monitor is probably configured as a separate X screen, and you'll need to use the Catalyst Control Center amdcccle GUI configuration tool to tie them together. The Catalyst Control Center is installed when the qt4 USE variable is enabled.

Open up a graphical terminal, and become root by typing su - -- your user will need to be in the wheel group to do this:

$ su -
Password: *******
# source /etc/profile
# amdcccle


Amdcccle.png

Navigate to Display Manager, and choose the option Multi-display desktop with display(s) X for each display. Then, drag and drop the blue displays to arrange them to match how they are arranged in front of you. Click OK. The Catalyst Control Center will tell you that you will need to restart your system for the changes to take effect. Simply log out if you are running xdm, or end your X session, and start it up again. You should now have a fully-functioning multi-head display.

Troubleshooting

I am using a HDMI connection, and my monitor's display has a black border around it.

Disable overscan as follows:

$ su -
Password: *********
# aticonfig --set-pcs-val=MCIL,DigitalHDTVDefaultUnderscan,0

You will need to restart your X session for the changes to take effect. If you are using a display manager, logging out and back in again should cause the new settings to be visible.

The tabs in Google Chrome are becoming garbled/corrupted

New versions of Google Chrome use hardware acceleration by default which appears to have rendering issues with AMD's drivers. To work around this, disable hardware acceleration in Google Chrome by going to Settings, Show advanced settings... and then uncheck the Use hardware acceleration when available (requires Chrome restart). Once Chrome is restarted, the rendering problem should be resolved.

Compton with backend glx does not work well with ati-drivers

Try running compton with the following switches:

# compton --backend glx --vsync none --paint-on-overlay