LinuxNiche

The ramblings of a Linux geek

Sep 2, 2009 - 7 minute read - Comments - Linux

Karmic Koala (2.6.31 kernel) and ATI Catalyst 9.7

Welcome Back!

This is no longer required. ATI has released 9.10 for Karmic Koala users!

I recently decided I wanted to try to upgrade to Karmic Koala to test the “alpha” release that Ubuntu has out there and realized that the ATI drivers don’t support the 2.6.31 kernel.  When you google, you will invariably be sent to this bug report which does in fact explain the problem but doesn’t really give you a step by step on how to fix it.  I missed it at first (even though it is perfectly logical), and ended up reloading Jaunty in frustration.  After a few days I tried to give it another go and this time I figured it out.

At first, I was sitting there trying to apply all the different patches or debdiff’s that are linked to in that website before realizing they are all for 9.7 and I was using the 9.8 Catalyst drivers.  But even better still, I noticed someone named dinxter has a PPA setup specifically for graphics drivers that gets linked to in the middle of that bug report somewhere (easy to miss in my case).  Once I noticed that it became obvious what to do.

Note: Throughout this guide I show you commands with VI, which is my preferred editor.  If you prefer emacs or nano, use those, or if you’re a more gui person, use gedit.  This is not a tutorial on VI, I do not show you what to do to add these lines in VI, so if you don’t know – I suggest using gedit.

Upgrade Jaunty to Karmic Koala

1 ) Press ALT+F2 to get a Run Dialogue
2 ) type “update-manager -d” (no quotes)
3 ) The Update Manager appears with a little box that tells you a “New Distribution Release” (9.10) is available.  Select Upgrade.
4 ) Follow Prompts

That’s it!  When it finishes you will need to reboot and continue on.  If you already have the ATI Catalyst drivers installed, I recommend completely removing them with:

sudo apt-get remove -purge xorg-driver-fglrx

And also comment out the line in /etc/X11/xorg.conf that says:

Driver “fglrx”

By adding a # to the beginning of the line.  After this when you reboot you should get back up to a new Ubuntu splash screen (that I personally don’t think I’m very fond of, actually) and be logging into the new Karmic Koala 9.10.

Getting Back my Catalyst!

Now that you are into Karmic Koala, we need to add a couple of lines to our apt sources.

sudo vi /etc/apt/sources.list

deb http://ppa.launchpad.net/dinxter/ppa/ubuntu karmic main deb-src http://ppa.launchpad.net/dinxter/ppa/ubuntu karmic main

I also had to comment out the two lines that make reference to Koala Restricted Packages (otherwise it will try to install them instead of the PPA’s.)  Now we do a standard sudo apt-get update which will yell at us that we don’t have GPG keys for this PPA and from there we run:

sudo apt-get install xorg-driver-fglrx fglrx-amdcccle fglrx-kernel-source libamdxvba1

Which will still yell at us that we can’t verify the files.  If you’re a big GPG guy (or gal) he does include his signing key on the website which you can load it into apt with  sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys AAFF1F16 I believe.  I didn’t do this so am not 100% sure that command is accurate.

Now, on my setup for some reason any time I try to install any of the AMD packages the dkms fails to compile it (on 2.6.31), and not in the way it’s supposed to fail on the non-patched ones.  When I read the make.log file it gives me a message telling me I need to be root to run this, which is stupid – I am root.  So after I installed all of those packages I got a dkms build error (though the packages still installed) and I had to manually go into the source directory (if yours installed without errors telling you dkms failed, SKIP THIS PART):

cd /var/lib/dkms/fglrx/8.632/build _sudo bash make.sh

This then properly compiles the fglrx.ko module that you need.  Move this module to /lib/modules/`uname -r`/updates/dkms/ like so:

sudo mv 2.6.x/fglrx.ko /lib/modules/\uname -r`/updates/dkms/ sudo depmod -a`

At this point, fglrx should be properly installed.  From here, if you already had ati drivers then you can just go back into /etc/X11/xorg.conf and uncomment the fglrx driver line, or if you are too lazy or didn’t have ati drivers run:

sudo aticonfig --initial -f

To have ati’s tool set it up for you.  One thing I realized after the fact was these drivers are actually 9.7, not 9.8 which is the newest release.  That’s fine for me for now but in the next week or two I expect to see 9.9 come out from ATI and I will have to manually compile my own.  I will blog that when I do so you can see the process of doing it “the hard way” so to speak.

Now, before we reset the X we need to remove a few modules and put in fglrx:

sudo rmmod i915 sudo rmmod drm sudo rmmod radeon sudo rmmod ttm sudo modprobe fglrx

Some of those rmmod may error saying they aren’t present, this is fine.  If the modprobe fglrx fails you will need to look into this.  If this all runs successful then you can restart the GDM and one HOPES you get the desktop back:

sudo /etc/init.d/gdm restart

When you log in, pop open a terminal and run fglrxinfo, if you get any errors or BAD Descriptors, etc, then the fglrx didn’t load properly and this didn’t work.  If, however, it tells you your card and a few lines of information you should be good to go!  Congrats, working 3D on a 2.6.31 kernel.  Note however that because this required removing some calls in the code of the driver there is a known error that will flood your dmesg output when using 3D:

[16294.482489] [fglrx: _firegl_find_anymap] *ERROR* Invalid map handle!

Which is very annoying. This you will have to live with until ATI releases 9.10 which is when they expect to fully support 2.6.31 kernel, should be released in October in time for the Koala official release.  This is merely a temporary work around for around 2 months.

Now, in order to get this to work across reboots you are SUPPOSED to be able to add the following to /etc/modprobe.d/blacklist.conf:

blacklist drm blacklist radeon

And it is supposed to not load those on reboot so fglrx can load properly. So far this isn’t working for me, and I can’t remove drm without removing i915, so I am thinking these are being loaded as a sort of dependency that I haven’t tracked down yet.  For now, every time I reboot I have to drop to a shell, and run the above rmmod/modprobe commands I listed to get fglrx in and restart gdm.  It’s working, but this is very annoying and I will really need to find why the blacklist is not working.

As far as Performance, well, I don’t want to give too much away since they will be in my benchmarks :D – but suffice to say I have run through 3 benchmarks so far that I had previously run through with 2.6.29 and I am actually getting higher FPS than before in all tests.  This could be due to a number of things: These patched drivers may be disabling some 3D feature that is degrading graphics (however if it is, it isn’t in any way noticeable, everything still says it’s running ultra), or it could just be the different between 9.7 and 9.8 ATI drivers, or it could be the new kernel has something in it that supports better 3D.  I don’t know which of these is the cause but I do know that all native 3D games worked immediately, but World of Warcraft on Wine was all kinds of messed up and required tweaking.  I ended up having to disable Full Screen Glow effect in order to fix it.  I think this was a 9.7 bug that was fixed in 9.8, so I should be able to go back to full Ultra settings once I patch and manually compile 9.9 to work with 2.6.31 (if ati doesn’t do a huge and wonderful “gotcha” to the community and fix 9.9 for 2.6.31 first :)).

Have fun and Happy Gaming!

Quick Update – New System

comments powered by Disqus