Announcement

Collapse
No announcement yet.

Getting Open Source 3D graphics on R6XX/R7XX cards (NO FGLRX)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting Open Source 3D graphics on R6XX/R7XX cards (NO FGLRX)

    NEW!!!: THIS GETS KERNEL MODESETTING WORKING AS WELL!

    This guide will enable 3D acceleration on R6XX/R7XX (HD 2000 - HD 4000 series) graphics cards.

    PLEASE NOTE: Do not run this source code on machines with old user space. If you are using Ubuntu 9.04, please check unsupported updates and proposed updates in System > Administration > Software Sources and run "sudo apt-get update && sudo apt-get dist-upgrade" without quotes.

    1a.) Obtain the required development tools and programs to compile, install, and fetch the source code:

    Ubuntu (9.04) / Debian (sid

    sudo apt-get install git-core build-essential dh-make debconf debhelper automake autoconf libstdc++5 libstdc++6 xorg-dev gawk bison cdbs dkms && sudo apt-get build-dep libdrm mesa

    Gentoo:

    emerge -pv git automake autoconf xf86-video-ati mesa libdrm libpthread-stubs x11-proto/dri2proto x11-proto/glproto

    Arch Linux:

    sudo pacman -Syyu && sudo pacman -S xorg xf86-video-radeonhd base-devel ati-dri libgl dri2proto glproto

    2a.) Obtain kernel source source code (REQUIRED FOR OLD KERNELS WITHOUT KMS CODE AND IF YOU WANT KMS):

    cd /usr/src && sudo git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git && cd linux-2.6 && sudo git --global user.name "Neo"

    You may replace "Neo" with whatever you like. "John Lennon," "Keanu Reeves," etc.

    Pull from drm-radeon-testing for the most bleeding edge code (OPTIONAL):

    sudo git pull git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-radeon-testing

    Run any of the two commands to start editing the config. make xconfig looks nice but requires qt3 development headers and tools. make menuconfig uses the ncurses / screen interface.

    sudo make xconfig
    or
    sudo make menuconfig

    OPTIONAL: You may make changes to the config file regarding hard drives, firmware, wireless, bluetooth etc. to your preference.


    REQUIRED SETTINGS: Under Graphics Support, compile "Lowlevel video output switch controls" INTO (Y) the kernel. "/dev/agpgart (AGP SUPPORT)" should be compiled INTO (Y) the kernel and your chipset (not graphics card) must be compiled INTO (Y) the kernel. Run lspci in a terminal to find out what chipset you have. If you can't tell, compile all the chipsets into the kernel (AGP_INTEL AGP_VIA etc.) Right below /dev/agpgart (AGP SUPPORT) is "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)" and you want that compiled INTO (Y) the kernel as well along with your graphics card (not chipset) INTO (Y) the kernel which is ATi Radeon. Right below that is "Support for frame buffer devices" and you want that compiled INTO (Y) the kernel. Within that, compile "Enable Firmware EDID" INTO (Y) the kernel. DO NOT COMPILE ANY ATI FRAME BUFFER SUPPORT COMPILED AS A MODULE OR INTO THE KERNEL!!!! Now you must turn on "Staging drivers" which is below HID Devices and USB support and the second option above "Firmware Drivers." Compile "Staging drivers" INTO (Y) the kernel and turn off 'Exclude Staging drivers from being built." Look for "Enable modesetting on radeon by default." It should be the 5th from the bottom. Last, you must compile firmware. You must turn on "CONFIG_FIRMWARE_IN_KERNEL" as this is extremely mandatory.

    3a.) Compile the kernel:

    sudo make all && sudo make modules_install && sudo make firmware && sudo make firmware_install && sudo make headers_check && sudo make headers_install && sudo make install

    If sudo make install (only the last command) does not work:

    sudo cp arch/x86/boot/bzImage /boot/vmlinuz-kms

    Edit /boot/grub/menu.lst or /boot/grub/grub.cfg (which ever one exists) accordingly. I will not cover editing the file. Sorry. Please visit http://grub.enbug.org/grub.cfg and http://www.gnu.org/software/grub/manual/grub.html for more info. There should be some comments in that file to help you.

    PLEASE NOTE: BEFORE RESTARTING, BE SURE TO DISABLE X ON START UP AS YOU S/MAY/WILL HAVE TO INSTALL MESA AND DDX DRIVER IF YOU WANT TO SEE YOUR MOUSE AGAIN!

    4a.) Restart your computer:

    sudo reboot

    You may also do "sudo telinit 6" without quotes depending on your preference. "sudo shutdown -r now" without quotes also works.

    5a.) Clone all the required git repositories and switch to the required branches:

    Radeon DDX driver and mesa:

    mkdir devel && cd devel && git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-ati && git clone git://anongit.freedesktop.org/mesa/mesa

    6a.) Clone additional git repositories for compiling DDX:

    git clone git://anongit.freedesktop.org/xorg/util/macros && cd macros && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

    git clone git://anongit.freedesktop.org/xcb/pthread-stubs && cd pthread-stubs && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

    1b.) dri2proto and glproto

    git clone git://anongit.freedesktop.org/xorg/proto/dri2proto && cd dri2proto && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

    git clone git://anongit.freedesktop.org/xorg/proto/glproto && cd glproto && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

    7a.) Now you must compile and install libdrm_radeon:

    git clone git://anongit.freedesktop.org/mesa/drm && cd drm && ./autogen.sh --prefix=/usr --enable-radeon-experimental-api && sudo make install && cd ..

    So far, if you haven't gotten any errors, please proceed onto compiling the DDX and Mesa

    8a.) Compiling radeon DDX:

    cd xf86-video-ati && ./autogen.sh --prefix=/usr && make && sudo make install && cd ..

    For Ubuntu, Debian, Gentoo, and Fedora:

    cd mesa && ./autogen.sh --prefix=/usr --disable-gallium --with-dri-drivers=r600 && make && sudo make install

    For ArchLinux and Slackware:

    cd mesa && ./autogen.sh --prefix=/usr --with-dri-driverdir=/usr/lib/xorg/modules/dri --with-dri-drivers=r600 --disable-gallium && make && sudo make install

    For some linux distributions, this will be needed in addition to get full 3D acceleration (Safe to do this just in case):

    sudo mkdir /usr/local/lib/dri && sudo cp lib/*_dri.so /usr/local/lib/dri

    10a.) Making your linux distribution use radeon over radeonhd:

    You will need to generate an xorg.conf file that does not look very simple, so it is easier to modify:

    If on KDE and on Kubuntu, Debian, or Gentoo (write all this down before proceeding on paper preferabbly
    sudo /etc/init.d/kdm stop
    Log in (If you see a black screen with white text, you're doing great)
    sudo Xorg -configure
    sudo mv xorg.conf.new /etc/X11/xorg.conf

    If on KDE on ArchLinux:
    sudo /etc/rc.d/kdm stop
    Log in (Black screen blah blah blah)
    sudo Xorg -configure
    sudo mv xorg.conf.new /etc/X11/xorg.conf

    If you are on Xfce, just do the above with your according linux distribution but replace "kdm" with "xdm" WITHOUT QUOTES!
    If you are on gnome (Ubuntu by default) with GDM replace "kdm" with "gdm" without quotes.

    1c.) Editing the config file:

    Replace nano with kwrite, gedit, or whatever your favorite editor is (I perfer nano

    sudo nano /etc/X11/xorg.conf

    The config file should be relativley big now. Please take your time doing this to avoid problems. Find where the file says:

    Section "Device"

    Below those comments under that (lines that start with #) you should see the following:

    Driver "radeonhd"

    Where it says "radeonhd" it might already say "radeon" but if it does not say "radeon" change it now (REQUIRED FOR KMS. RADEONHD WILL NOT WORK WITH KMS!):

    Driver "radeon"

    Now hit Control O (its not a zero) to overwrite the /etc/X11/xorg.conf file. To exit, press Control X.

    If you like to use vi or vim (I _LOVE_ vim) then you need to press, "i" with no quotes, and edit the file accordingly. To write and exit, press Escape (all the way on the top left of your keyboard) and press ":wq" without quotes.

    I recommend that you restart your computer now using any of the following commands:

    sudo telinit 6
    sudo shutdown -r now
    sudo reboot

    You are now finished.
    Last edited by Neo_The_User; 01-26-2010, 09:57 PM. Reason: changed some stuff again

  • Neo_The_User
    replied
    For those who want to do this for older radeon cards, please go to:

    http://neo-technical.wikispaces.com/radeon-kms

    It may be a bit out of date as I have to play cat and mouse a lot since the developers keep moving and code around, making new branches / trees and such so if you want to re-write that guide (if even necessary) please post a fresh guide here at phoronix.com/forums. Thank you.

    Leave a comment:


  • ankerman
    replied
    This guide.

    And I am happy that I can use the open source drivers for my crappy X600 mobility card, and don't have to use the proprietary drivers anymore (which have been deprecated for my hardware).

    Too bad it doesn't work for you. And if you don't like openSUSE, please use something else. Nobody is forcing you.

    Leave a comment:


  • Panix
    replied
    What guide?

    OpenSUSE and older ATI hardware with open source radeon driver sucks.

    I tried it with RV250 hardware and 3D cannot be enabled.

    OpenSUSE gets direct help from X.Org people AFAIK and it still didn't result in working 3D with that older hardware.

    Heck, I couldn't get it to work in Ubuntu but after trying a hundred different configurations in xorg.conf, I finally got one that sort of worked. Even Mandriva 2010 had it work OUT OF THE BOX and they don't have even half the resources. Fedora 12 worked, too, out of the box.

    OpenSUSE is massively overrated...imho..

    Leave a comment:


  • ankerman
    replied
    openSUSE 11.2 working

    Just wanted to share that Neo's guide works like a charm on vanilla openSUSE 11.2 as well. I had to install xorg-x11-server-sdk as well as expat, to resolve some dependencies.
    I started at step 5 - no need to patch and compile your own kernel, just build the Xorg stuff.

    My system:

    ATI Radeon Mobility X600 (M24) 3150 (PCIE) on a Dell D810.

    Thanks for the guide!

    Leave a comment:


  • tball
    replied
    Originally posted by h3xis View Post
    I can't get it to work on anything less than 2.6.33. It seems we have the opposite problem.

    As an update, I got KMS working. I just rebuilt everything and it worked. Dunno what I did wrong last time.
    Well thats odd. I wonder if it has anything to do with fbcon. It is loaded with 2.6.32-9, but I don't know if its loaded with 2.6.33-rc2.
    As I have been told, this modules should be loaded before the radeon module or else you won't see anything in the console.

    EDIT:
    BTW I am using Ubuntu Karmic with latest tormod ddx,drm, mesa etc. for Lucid.
    Last edited by tball; 12-27-2009, 04:20 AM.

    Leave a comment:


  • h3xis
    replied
    Originally posted by tball View Post
    I have the exact same problem on a laptop with 4650.
    With the mainline kernel 2.6.32-9 everything seems fine. But when I try to boot into a mainline ubuntu 2.6.33-rc2 kernel, I get the problem you describes. I don't see any errors in the kern.log, but it just stays black when gdm used to load.

    I get this in the 2.6.33-rc2's kernel log also:
    kernel: [ 20.811585] Console: switching to colour frame buffer device 240x67

    I don't know if thats a problem at all.
    Plz tell me if you find anything about the problem.
    I can't get it to work on anything less than 2.6.33. It seems we have the opposite problem.

    As an update, I got KMS working. I just rebuilt everything and it worked. Dunno what I did wrong last time.

    Leave a comment:


  • tball
    replied
    Originally posted by rjwaldren View Post
    quoted - "Is there anybody running Debian testing/unstable who can no longer get this to work?"

    I'm having the same or similar problem with Lucid on my hd4850 - Since around the time the interrupt patches made it into the kernel tree. The current 2.6.32-9.13 kernel from Ubuntu works fine with KMS enabled, it looks to have drm upto the .32 release plus a few backported patches. The latest Ubuntu kernels from the mainline along with a custom compiled DRM-Radeon-Testing applied to Linus' git and Ubuntus 32-9.13 git source have all failed the same way. The remainder of the stack is the lastest (tried both Edgers-PPA and git compiles) and does not appear to be the problem.

    I've been busy with other things so I haven't been trying to chase it down lately. When radeon modprobes on the newer kernels the screen immediately blanks (as though the HMDI output is disabled). This occurs with both UMS or KMS. SSHing in, dmesg shows the driver probed and loaded the firmwares with out error and reports that it's switching to a massive console mode (? 267x67). And Xorg.0.log looks like everything is going fine (detected modes look good,etc) and it selects the usual 1920x1080 mode. But the log just stops after that, haven't seen any errors reported aside from the failure to actually produce output.

    Like I said the current 32-9.13 kernel along with the latest libdrm, mesa, DDX works great. So I've just been using that and checking every couple of days to see if the kernel (X server) issue is resolved. If rc2 is out now, I should be able to try it and collect some logs this w/e.
    I have the exact same problem on a laptop with 4650.
    With the mainline kernel 2.6.32-9 everything seems fine. But when I try to boot into a mainline ubuntu 2.6.33-rc2 kernel, I get the problem you describes. I don't see any errors in the kern.log, but it just stays black when gdm used to load.

    I get this in the 2.6.33-rc2's kernel log also:
    kernel: [ 20.811585] Console: switching to colour frame buffer device 240x67

    I don't know if thats a problem at all.
    Plz tell me if you find anything about the problem.

    Leave a comment:


  • aljaz
    replied
    Originally posted by h3xis View Post
    I couldn't find a thread for the R300 and this one worked, only I just replaced r600 with r300. I've narrowed down the KMS issue to the kernel. I get the same error as I did before (the "no usable configuration" one) if I use a kernel below 2.6.33, but KMS says it's enabled. If I use 2.6.33, everything works (including DRI), except for KMS. I don't really need that then since I have only 1 user on here. When configuring the kernel, instead of using radeon/R700_rlc.bin, I have been putting radeon/R300_cp.bin. Would this be correct?
    Khm... For R300 you shouldn't add anything. It should work out of the box. Though I must say I haven't tried 2.6.33 yet on the mentioned laptop so it could be you've done nothing wrong. Maybe tomorrow I'll compile this kernel on the laptop and see what I get.

    Leave a comment:


  • h3xis
    replied
    Originally posted by aljaz View Post
    KMS=kernel modesetting. And no, you don't really need it unless you have multiple concurrent users on the same computer. Under KMS every user has DRI enabled as opposed to without KMS option (this is why it's useful to me).

    Apart from that, you're in the wrong thread. This one talks about R6XX/R7XX. But anyway, it should be the same for R300 and below, because I use the same guide for a laptop with a R1XX. I only leave out the --with-dri-drivers=r600, which under the latest mesa git you shouldn't even need anymore.

    So why don't you have KMS? Have you checked all your kernel options from the guide - they have to be exactly like written in the guide? Did you disable KMS via grub (radeon.modesett=0)?

    For mesa and dri and stuff you should find a wiki.
    I couldn't find a thread for the R300 and this one worked, only I just replaced r600 with r300. I've narrowed down the KMS issue to the kernel. I get the same error as I did before (the "no usable configuration" one) if I use a kernel below 2.6.33, but KMS says it's enabled. If I use 2.6.33, everything works (including DRI), except for KMS. I don't really need that then since I have only 1 user on here. When configuring the kernel, instead of using radeon/R700_rlc.bin, I have been putting radeon/R300_cp.bin. Would this be correct?

    Leave a comment:

Working...
X