PURPOSE AND OVERVIEW
----------------------------------------
- This guide is for people who want to try the latest open-source, hardware-accelerated 3D code on their ATI RadeonHD (R600/R700) GPU. At the time of this writing, the r600 mesa driver only supports OpenGL 1.4, DO NOT expect 3D performance gains or extra features over fglrx/Catalyst drivers (though the open-source drivers may work better in other areas).
- I have personally used this guide (successfully) on Ubuntu 9.04, Ubuntu 9.10, and Debian sid(ux).
----------------------------------------
STATUS OF SOME 3D PROGRAMS
----------------------------------------
Reference: http://wiki.x.org/wiki/radeonhd%3Aexperimental_3D
Code:
# googleearth: runs ok, start this program from the terminal with vblank_mode=0 (thanks to John Bridgman @ AMD for the tip)
# glxgears: runs, I get ~1800fps on a RadeonHD4550, (glxgears isn't a good benchmark to compare different systems because of its CPU dependence)
# neverball: runs, nice!
# savage2: doesn't run,
* Savage2 - Fatal Error: OpenGL 2.0 not available.
* Savage2 - Fatal Error: Segmentation Fault
* Segmentation fault (core dumped)
# ETQW: doesn't run;
* ERROR: The current video card / driver combination does not support the necessary features: GL_ARB_occlusion_query
# sauerbraten: starts, switches to graphics mode, starts initialize shaders and hangs after a while (Alt-SysRq-B only works)
# trophy: runs, playable, ok
# tremulous: works, playable, fast!
# compiz: starts and runs, most effects work (blur may not), gnome-terminal suffers from invisible characters (I personally have not noticed this)
# openarena: works, playable, fast, ok!
----------------------------------------
ISSUES/DISCLAIMER
----------------------------------------
- DO NOT do this on production systems. You probably shouldn't do this on your main install if borking it would be a huge problem for you. I wouldn't even recommend this to anyone but those that like to experiment and don't mind if their install gets messed up. BOTTOM LINE: Please don't send me angry PM's if this screws up your system.
- This guide overwrites Ubuntu's default mesa install. I believe there is a way to keep the git code and the Ubuntu stuff separate (suggestions welcome).
- A special note for LAPTOP and owners of PASSIVELY-cooled GPU's: The open-source drivers currently only have limited dynamic power management. This can cause your GPU to run significantly warmer than it would with the proprietary drivers, which use AMD/ATI's PowerPlay technology for dynamic volting/clocking. (The open-source devs are currently working on implementing PowerPlay features, but they face a lack of documentation on this feature). BOTTOM LINE: You've been warned. Please don't send me angry PM's if this burns up your GPU.
----------------------------------------
PURGING PROPRIETARY DRIVERS (skip to the next section if you've never installed fglrx/Catalyst on your system)
----------------------------------------
- Previous or current installations of ATI's proprietary Catalyst/fglrx drivers are known to interfere with the installation of the open-source drivers. If you manually downloaded and installed drivers from AMD/ATI, run the following command first:
Code:
sudo sh /usr/share/ati/fglrx-uninstall.sh
- Now purge the Ubuntu fglrx packages (you WILL lose any custom configuration settings of these packages):
Code:
sudo apt-get purge xorg-driver-fglrx fglrx-amdcccle fglrx-kernel-source xorg-driver-fglrx-dev
- This command is necessary to replace some proprietary libraries that fglrx leaves behind.
Code:
sudo apt-get --reinstall install libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
- Finally, use this command to make sure you have a "clean" xorg.conf file (and back up your existing one)
Code:
sudo dpkg-reconfigure -phigh xserver-xorg
- If you had special options for your input devices in your previous xorg.conf, you'll probably want to put them in the new one. At this point, restart your system and make sure you get the correct resolution and direct rendering works (look at /var/log/Xorg.0.log if you're unsure).
----------------------------------------
PREREQUISITES
----------------------------------------
- Before you begin, make sure your package information and system are updated.
Code:
sudo apt-get install linux-headers-`uname -r` freeglut3-dev x11proto* xutils-dev autoconf libltdl7-dev libpciaccess-dev libdrm-dev git-core gawk xorg-dev libgl1-mesa-dev pciutils-dev libglu1-mesa-dev pkg-config
- Before you build the DRM kernel modules, I suggest you back up your existing ones:
Code:
cd /lib/modules/`uname -r`/kernel/drivers/gpu/drm/
cp drm.ko radeon/radeon.ko ~/
cd ~/
tar -czf drm-modules.tar.gz drm.ko radeon.ko
----------------------------------------
GETTING A RECENT 2D/MODESETTING DRIVER
----------------------------------------
You can either use the ati/radeon or radeonhd driver. I prefer to use https://help.ubuntu.com/community/RadeonHD
----------------------------------------
ALEX DEUCHER's (aka agd5f) DRM, INITIAL BUILD
----------------------------------------
Code:
cd /opt
sudo git clone git://anongit.freedesktop.org/~agd5f/drm
cd drm
sudo git checkout -t -b r6xx-r7xx-3d origin/r6xx-r7xx-3d
sudo ./autogen.sh --prefix=$(pkg-config --variable=prefix libdrm) --libdir=$(pkg-config --variable=libdir libdrm) --includedir=$(pkg-config --variable=includedir libdrm)
sudo make
sudo make install
cd linux-core/
sudo make radeon.o drm.o
sudo make install
sudo cp drm.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm/
sudo cp radeon.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm/radeon
sudo depmod -a
----------------------------------------
MESA, INITIAL BUILD
----------------------------------------
- In this guide, we only build the Mesa software rasterizer (to fall back on) and the r600 DRI 3D module for r600/r700 cards (and should include r800 cards in the future). We do this to speed compilation significantly. If you need other DRI drivers, be sure to build/install them by either adding them to the --with-dri-drivers list or omitting that flag completely to build all available DRI drivers.
Code:
sudo mv /usr/lib/pkgconfig/libdrm_radeon.pc /usr/lib/pkgconfig/libdrm_radeon.pc.copy #It's okay if you get file not found
cd /opt
sudo git clone git://anongit.freedesktop.org/mesa/mesa
cd mesa
sudo ./autogen.sh --with-dri-drivers=swrast,r600 --libdir=/usr/lib/ --includedir=$(pkg-config --variable=includedir dri) --disable-gallium --disable-egl --enable-debug
sudo make
sudo make install
TRYING IT OUT
- For some reason, I find this necessary after everything is built:
Code:
cd /opt/drm
sudo make install
cd /opt/mesa
sudo make install
- Now you can restart your system and check glxinfo.
Code:
glxinfo | grep renderer
Should report 'Mesa DRI R600...'. (If you see 'Software Rasterizer', something went wrong; check your /var/log/Xorg.0.log). Hopefully, all is well and you can enjoy 3D stuff.
----------------------------------------
UPDATING DRM
----------------------------------------
Check this page to see if any updates have been pushed since you last built it: http://cgit.freedesktop.org/~agd5f/drm/?h=r6xx-r7xx-3d
Code:
cd /opt/drm
sudo git pull
sudo make clean
sudo make install
cd linux-core/
sudo make clean
sudo make radeon.o drm.o
sudo cp drm.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm/
sudo cp radeon.ko /lib/modules/`uname -r`/kernel/drivers/gpu/drm/radeon
sudo depmod -a
----------------------------------------
UPDATING MESA
----------------------------------------
- Mesa is under heavy development and is being updated very frequently: http://cgit.freedesktop.org/mesa/mesa/ Before you report a bug, make sure your copy is updated.
- Remember to modify --with-dri-drivers flag to your needs (like in the initial build)
Code:
cd /opt/mesa
sudo git pull
sudo make clean
sudo mv /usr/lib/pkgconfig/libdrm_radeon.pc /usr/lib/pkgconfig/libdrm_radeon.pc.copy #Again, the file may not exist
sudo ./autogen.sh --with-dri-drivers=swrast,r600 --libdir=/usr/lib --includedir=$(pkg-config --variable=includedir dri) --disable-gallium --disable-egl --enable-debug
sudo make
sudo make install
----------------------------------------
TODO
----------------------------------------
A reverting procedure for people who want to go back to Ubuntu defaults.
Bookmarks