Open-source attack!

Are you bored off that crappy closed-source fglrx (AMD’s official linux driver)? Or you just can’t stand having Unidentified Flying Object in your RAM? If you own an R6xx/R7xx gpu based card then good news for you, there is finally 3d support for you! Not finished yet but at very good stage.

Let’s try to explain something before we start, there is one “new” technology that this new driver is based on, the KMS.

Mode-setting

Is setting up the screen resolution and depth mode for the graphics card. Modern mode setting software support multiple monitors (“multi-head”) and hot plugging. In linux there are two ways to do it the old one User Mode Setting (UMS) and Kernel Mode Setting.

UMS is the old one and it was done by the X-server driver at the start of X session. For this to work, the X server needed to run as root so that it could access the resources of graphics card. Further-more switching to console involved freeing resources from graphics card and giving gpu back to the kernel. Switching back to X session from console, the driver had to reinitialize hardware from the scratch and lock it again.

KMS is the new one and the mode-setting is done by the kernel its self without the need of X server. Kernel modules has been written for some cards and are being developped for the rest, that are capable of controlling gpu mode-setting in-kernel. X server driver does not need to access GPU in low-level anymore but requests mode changes from the kernel’s KMS API which sends commands to GPU. Advantages are numerous, like switching to console and back does not involve releasing/locking card and reinitializing it each time. Kernel can detect monitors and console is run at the screens optimal resolution (no more 640×480 console). Also x server drivers does not need any more to run under “root” to access gpu, (this has been accomplished with changes in others areas of X-server stack too). To work in KMS mode you need the appropriate modules in kernel that will implement KMS for your GPU, and the new X server driver that will access graphics card through KMS and not directly.

There are more stuff involved in the new X server stack like DRM/DRI2, vga_switcheroo (vga switching). There are plenty of information out-there to read.

Latest R600/R700 stack on Karmic 9.10

WARNING: You will run experimental software, that may have serious bugs and make your system unstable. To perform the following steps you must be familiar with linux terminal and deb packages. If you don’t know what are these, don’t even try it. In any way the process may result in broken X session.

You want open-source radeon driver with 3D, compiz, KMS support right now? You have to update to the latest unreleased code of drm-next source tree (yes you have to pull 2.6.34 DRM code for proper support), and to the latest MESA-DRI-Xorg radeon driver.

Get latest kernel with drm-next tree from the kernel mainline

Visit http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-next/current/ and download 3 files on folder that you will create on the Desktop named drmnext

linux-headers-[VERSION]_all.deb
linux-headers-[VERSION]_{ARCH}.deb
linux-image-[VERSION]_{ARCH}.deb

For example for my i386 I downloaded the following files:

linux-headers-2.6.33-996_2.6.33-996.201003011149_all.deb
linux-headers-2.6.33-996-generic_2.6.33-996.201003011149_i386.deb
linux-image-2.6.33-996-generic_2.6.33-996.201003011149_i386.deb

Then open-terminal and CD to the folder where you downloaded them, and install them

cd ~/Desktop/drmnext
sudo dpkg -i linux-*2.6.33*.deb

Kernel misses some firmware files R600_rlc.bin and R700_rlc.bin that you have to download manually and install them in your linux installation.

sudo wget -O /lib/firmware/2.6.33-996-generic/radeon/R600_rlc.bin http://people.freedesktop.org/~agd5f/radeon_ucode/R600_rlc.bin
sudo wget -O /lib/firmware/2.6.33-996-generic/radeon/R700_rlc.bin http://people.freedesktop.org/~agd5f/radeon_ucode/R700_rlc.bin

You have to update initramfs because this firmware is needed early at kernel load. You will also need to enable the experimental “power management” code of the module otherwise your GPU will work at full speed even when idle, resulting in heat and fan working continuously.

sudo bash -c "echo \"options radeon dynpm=1\" > /etc/modprobe.d/radeon.conf" 
sudo update-initramfs -u -k 2.6.33-996-generic

Now you have to update your xorg stack to the latest. This can be done easily using xorg-edgers ppa.

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get upgrade

Ok you are ready! Cross your fingers and reboot, select kernel 2.6.33 on grub and good luck :D

F*$% that crap! I want to go back

If you are not a satisfied client then you can always return back to default ubuntu packages with the following commands

sudo apt-get install ppa-purge
sudo ppa-purge xorg-edgers

Reboot and select 2.6.31 kernel. After that you can use synaptic and remove all *2.6.33* kernels from repository, if you think that you will never need it again.

Please write back your experience or comments in comments section. :)

Updates

  • The command to add module options missed sudo prefix, and resulted in “permission denied”. Kudos to Patric!