Tuesday, 21 September 2010

Build ATI fglrx RPMs on openSUSE -- part 2

UPDATE 26/09/10: Switch the repositories back to X11:Drivers:Video; thanks to Stefan's work it is updated. Also, a post on the list says that ati-fglrxG01 legacy driver won't work on openSUSE 11.3 even if it builds, due to Xserver incompatibilities :(
UPDATE 24/09/10: I've branched and submitreq'ed the changes back to X11:Drivers:Video. Therefore I've changes the instructions below to checkout my branch instead and avoid the patching.
UPDATE 24/09/10: If you need the ATI legacy driver, for example for Radeon X1400 chipsets, checkout X11:Drivers:Video/ati-fglrxG01 instead. I've patched that to build on openSUSE 11.3 but don't have the hardware to test if it actually works.

In part 1 of this topic, I discussed the current (sad) state of ATI/AMD fglrx video driver RPMs on openSUSE Linux, and suggested that the best, cleanest way to build them was actually via the OBS. Here I cover step-by-step instructions on how to do so.

(Note: I use sudo on my machine, if you don't have it configured, use su)
The first step is to install the OBS command-line frontend, osc.
sudo zypper in osc
This will also pull in the famous SUSE 'build' script that allows cleanly building rpms.

Then, in a clean working directory (e.g. ~/src):
osc co X11:Drivers:Video ati-fglrxG02
Voila! The necessary spec files and patches will be made available in X11:Drivers:Video/ati-fglrxG02.

If you use sudo, make sure to edit the osc configuration file ~/.oscrc to tell it that. Uncomment the line starting with su-wrapper and change the value to suit you.

Now time to build! (Fix distro version/arch as necessary)
mkdir ~/src/packages
cd X11\:Drivers\:Video/ati-fglrxG02
sh ./fetch.sh
osc build -k ~/src/packages -j 4 openSUSE_11.3 x86_64 ati-fglrxG02.spec
fetch.sh downloads the ATI driver release you wanted. The osc build will download necessary pacakges, create an entirely separate build system running in a chroot at /var/tmp/build-root - where it cannot affect your main system - and safely build the kernel module rpms, and once built save them in ~/src/packages. You will be asked for the root (or yours, if using sudo) password to create the chroot.
Similarly build the X11 drivers.
osc build -k ~/src/packages -j 4 openSUSE_11.3 x86_64 x11-video-fglrxG02.spec
Now go to your brand new rpms and install them!
cd ~/src/packages
sudo zypper in -f ati-fglrxG02-kmp-desktop-8.771_*.x86_64.rpm \
This does take a bit of bandwidth (~150 binary packages to download into /var/tmp/osbuild-packagecache), and is slightly slower than compiling the driver yourself, but it's much cleaner and you end up with a better constructed package. The package will automatically change your display driver to fglrx on installing, and when uninstalling will not leave any cruft about your system. This method is also completely applicable to openSUSE 11.2 and previous.

Incidentally, if you add something useful in these RPMs (spec file, code patch), feel free to submit the changes back to the OBS so everyone can benefit - see OBS Collaboration.


  1. Am I missing a step:
    osc co X11:Drivers:Video ati-fglrxG02
    Server returned an error: HTTP Error 403: Forbidden
    Error getting meta for project 'X11:Drivers:Video' package 'ati-fglrxG02'


  2. Are you using an OBS account or are you trying to do it anonymously?


Creative Commons Licence
This work by Tejas Guruswamy is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.