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
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!
#1 by BitE on March 2, 2010 - 1:23 am
Quote
Nice i will try it soon
#2 by DragonionS on March 7, 2010 - 3:04 pm
Quote
Thanks for this tutorial. I’ve tried it on Ubuntu Karmic with my 2nd notebook with RadeonHD 2400. It works!
P.S. The 1st notebook is under Gentoo
#3 by sque on March 7, 2010 - 10:06 pm
Quote
Congratz DragonionS! Happy free software browsing
#4 by Patrick on March 12, 2010 - 8:05 am
Quote
I ran compiz-check on my system after re-booting and got the following error
“Error: Software Rasterizer in use”. Everything else checked out. I can not enable visual effects. Can you help me out?
Regards,
Patrick
#5 by sque on March 12, 2010 - 12:18 pm
Quote
Welcome aboard Patric,
The problem that you are describing means that the DRM or DRI driver did not work, either because it cannot work with your card, or it couldn’t find the firmware.
You can check if the DRM driver was loaded by running
dmesg | grep drmIf you see no output it means that it cannot detect your card, in that case tell us what card are you using.
If you see output then check if there is a line with an error or waring like “Unable to load firmware” or something similar.
If this output is ok then you probably have problem in the xorg DRI driver, recheck that you have added xorg-edgers ppa and the latest version of radeon is installed by running:
apt-cache policy xserver-xorg-video-radeonIt must be saying tha you have installed 1:6.12.191+git2010xxxx and NOT 1:6:12:99+git2009xxxx
Hope it helped. In any case come back and tell us if you need more help.
#6 by Patrick Lindsey on March 13, 2010 - 3:23 am
Quote
OK. I went through the steps again. This time ./compiz-check says everything checks out OK, but my 3D runs REALLY slow. I am basing this upon using AWN. The menus are not running smoothly at all. When I use the ATI proprietary driver they did. Anyway, I tried running # dmesg | grep drm, and nothing came back at all. The command just went right back to the command prompt. According to ./compiz-check here is my card type: Graphics chip: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics] If there is something else I can do let me know. Maybe my setup is not powerful enough to run these drivers on this kernel smoothly. If thats the case I just go back to the proprietary flgrx drivers. Let me know =)
#7 by Patrick Lindsey on March 13, 2010 - 3:25 am
Quote
P.S. I forgot to say Thank You! This has been an adventure in command line Linux =)
#8 by sque on March 13, 2010 - 3:30 am
Quote
If there is no drm output on dmesg, the kernel module “radeon” did not recognize your card, so you don’t have KMS at all and 3D comes from the old stack.
I will try to find more info about driver support on your specific chipset, and update comments/page for your info. I know that some of them are currently not supported, but don’t have the list available.
I am glad you enjoyed it, and wish you better luck next time :=D
#9 by Patrick Lindsey on March 13, 2010 - 4:31 am
Quote
Thanks again. I am going to roll back to my previous setup, but I look very forward to what you find about my card. Where are places I can look for this information myself? I am simply curious.
#10 by Patrick Lindsey on March 13, 2010 - 4:35 am
Quote
silly question on echo “options radeon dynpm=1″ > /etc/modprobe.d/radeon.conf directions. I am simply adding:
echo “options radeon dynpm=1″ to the radeon.conf file, quotes and all?
#11 by sque on March 13, 2010 - 4:41 am
Quote
echo “options radeon dynpm=1″ > /etc/modprobe.d/radeon.confmust be run in terminal and it overwrites/creates /etc/modprobe.d/radeon.conf file with data “options radeon dynpm=1″ (without the quotes).
In other words opening file with a text editor you must see:
options radeon dynpm=1Something else that it might need to do is removing completely fglrx installation, this can be done with the following command
sudo apt-get purge xorg-driver-fglrxPlease try this too, and reboot system.
Resources to look at
——————————————————
I don’t have any “trusted sources”
I usually look arround the drm-next log http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6.git;a=shortlog;h=drm-next
Airled blog: http://airlied.livejournal.com/
Phoronix: http://www.phoronix.com
And a LOT of google.
This guide I made was not a single page copy paste, was the result of my experience trying to make KMS work on my system. So there is no one big resource to point.