Showing posts with label driver. Show all posts
Showing posts with label driver. Show all posts

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 \
                    x11-video-fglrxG02-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.

Build ATI fglrx RPMs on openSUSE -- part 1

How to install the ATI/AMD fglrx video drivers is one of the first questions many users have when they start up a new distro. The easiest option is an install from the distro's package manager; otherwise you have to manually download and compile from the ATI website.

Although they are evil proprietary binary code, without these drivers, 3d acceleration for games and desktop effects is usually missing or extremely poor performance. In some cases even the 2d performance is quite bad; so most users like to install them as soon as possible.

Traditionally (see SBD:ATI) on openSUSE a YaST/zypper repository has been available at http://www2.ati.com/suse/ (not viewable in a web browser). However in recent releases the ATI driver rpms in this repo have had bugs (originating in the original driver, not in the SUSE packaging); for some time the 64bit version installed files to 32bit locations and so failed to work; with the 11.3 release, the fglrx-10.7 rpms provided simply segfault on boot.

So with openSUSE 11.3 everyone had to fall back to the manual method. Some enterprising openSUSE users have written scripts and workarounds ([1],[2]) that automate at least part of the process; but it still requires installing development tools (kernel-sources, gcc, etc.) on a non-development machine, which I especially dislike.

As it turns out the real source of the ATI rpms (and nVidia rpms BTW, but that's a topic for another day) normally available in the YaST repository is Stefan Dirsch's hard work in the X11:Drivers:Video OBS project. Since the drivers are non-free, the actual source code is not uploaded to the OBS, but it is made available in what as known as a "nosrc" format - including all the build instructions and patches, just missing the source package. Happily, this makes it possible for anyone to build their own video driver RPMs to exactly the same quality that would be available from the repo, and without having to install development packages.

Step by-step instructions are available in part 2 of this post.
Creative Commons Licence
This work by Tejas Guruswamy is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.