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.
#12 by Patrick Lindsey on March 13, 2010 - 5:31 am
Quote
OK. I created the file radeon.conf and added the line:
options radeon dynpm=1 . I needed to run nano as root using sudo. When I tried to run it as you suggested I got bash: /etc/modprobe.d/radeon.conf: Permission denied at the command prompt. I ran the purge, but I took out the flgrx drivers previously. They are not on my system. Fixed the radeon.conf file and rebooted, but it is acting the same. Very very slow.
#13 by sque on March 13, 2010 - 5:45 am
Quote
It is funny, sometimes you read something numerous times but its like reading something else.
You are right about the command, it cannot work with simple user privileges you need sudo, I thought I had written it!. I modified the post and added an update section at the end of the post. Ty
However this was not the reason for not working, this module parameter only enables the power management inside the driver.
Moreover I searched for RS780 and I think it should work. I will try to do redo all the process in a clean installation, I may missed to record a step that I don’t remember. But it will take 1 or 2 days as I am on exams this weekend :S
#14 by Patrick Lindsey on March 13, 2010 - 6:03 am
Quote
Good luck on your exams! # dmesg | grep drm still turns nothing up (not that is should have). I look forward to your future post. In the mean time I am going to search around google.com for some more insight. Chat with you soon =)
#15 by Manuel on March 13, 2010 - 12:35 pm
Quote
Hi
Does this work in Debian sueeze’?
And more important with my card: Radeon HD 3300 i think its R600 then the exact card is: http://en.wikipedia.org/wiki/AMD_700_chipset_series#790GX
Thanks for help
And how good are the drivers? do they work with most of the games?
Does compiz work? Because it did not with fglrx for me.
Im running Xorg.7.5 do i need update?
Thanks again
Manuel
#16 by Patrick Lindsey on March 13, 2010 - 11:24 pm
Quote
My advice is go ahead and try it, but make sure all fglrx packages are removed. The worst thing that could happen is you need to remove and go back to your previous setup. I have installed it twice and removed it twice. The setup does not yet work for me. I am pretty sure you have a 700 series chipset mine is a HD 3200 RS780M/RS780MN. Once you have it installed Go here http://forlong.blogage.de/entries/pages/Compiz-Check running this script will tell you if compiz fusion will work or not. Post back to tell of your progress.
#17 by Patrick Lindsey on March 14, 2010 - 6:57 am
Quote
Manuel,
Here is a thread about these drivers which has some benchmarks for a few games: http://www.overclock.net/linux-unix/621497-how-getting-3d-acceleration-your-r6xx.html
Here is an article about the differences between Debian and Ubuntu (they are minimal): http://www.ubuntu.com/community/ubuntustory/Debian there are may more articles online, they all say just about the same. Downloading and running compiz-check will tell you the exact chip set you have. I am guessing R?/7xx.
#18 by sque on March 15, 2010 - 3:14 pm
Quote
@Manuel,
First of all you need kernel 2.6.33 or drm-next tree compiled in your kernel.
No you don’t need to update your Xorg but you need latest xorg driver radeon 6.12.191
and this implies that you have installed latest unreleased mesa (7.8) dri stack.
I am not experienced in debian releases, but if you are, then you can look around for these packages.
Compiz plays perfectly, and the 2D enviroment is ultra stable (no crash here). DRI2 gives you proper support of video and 3d when running compiz, no more lags, or video in overlay mode when running compiz.
OpenGL support misses some extensions of OpenGL 2.1 so it is classified as 2.0 and some games dont play at all and others may have artifacts. 3D (in game) performance is not the best that your card can do but in future versions it will be fixed.
I personally wanted a compiz-enabled 2D enviroment that can support properly dual-screens, and for me it is one step (I have a small issue with fan speed sometimes) behind perfection.
#19 by Jonathan van Zuijlekom on March 16, 2010 - 9:44 pm
Quote
This worked like a charm, thanks!
With the proprietary fglrx drivers I had the following problems:
Slow resizing with Compiz (backclear/backfill bug)
Crazy memory leaks
Standy/resume swap everything to disk or just black screen
ALL of these problems are now GONE! Man I love open source.
#20 by sque on March 16, 2010 - 9:55 pm
Quote
I am so glad that it worked
Another sign that open-source development can overcame obstacles created by industries, and provide a competing and better software for everyone.
Also I would like to forward some news:
——————————————————–
You may have noticed that with firefox in somepages scrolling up/down may be REALLY slow! This is because it uses the XGetImage function of 2D EXA API which was not accelerated until now in 6.13.0rc2
version. We will have to wait one or two days until xorg-edgers-ppa pulls the latest version. Check for updates in update manager, install them and logout/login.
Pingback: ATi 簡單切換KMS « 偽物筆記本
#21 by Serg G. on May 16, 2010 - 7:39 pm
Quote
Hey sque, thanks for this post, it’s really helpful, but can you please tell how to fix that damn overheating? I’m running Lucid, 2.6.34+drm-next on laptop with HD3650 Mobility.
I tried to load system with all possible combinations of modeset and dynpm options, but after 20-40 minutes of idle the system getting unexplainable hot.
Here is my current situation: http://pastebin.com/UpNWr70i
Any help please, i don’t know where to post this on Phoronix