Sunday, August 19, 2007

How-to: Debian, ATI, XGL + Compiz Fusion/Beryl

After a LOT of research, I am proud to present the Debian, ATI, XGL + Compiz Fusion/Beryl How-To!

Current version: 1.1

1.1 changes:
- Added Fusion Icon in Compiz. Now you can easily manage Compiz Fusion with the help of a tray icon :)

What's needed:
- Debian Unstable (sid): Etch could work too, but I haven't tried it.
- KDE or Gnome Desktop w/ GDM (KDM won't cut it, its so slow you need a minute to login...)
- ATI Graphics card supported by the (in)famous fglrx driver (tested on Radeon Mobility 9600)
- Basic shell knowledge


1. Update your system and get GDM if you don't have it

Either use your favorite package management tool (Adept/Synaptic) or the following commands to make sure you have the latest packages.

sudo apt-get update
sudo apt-get dist-upgrade

Make sure you're running the 2.6.22 kernel. If you aren't, get the new one:

// AMD
sudo apt-get install linux-image-2.6-k7

// INTEL
sudo apt-get install linux-image-2.6-686

Now install GDM

sudo apt-get install gdm

when asked, select gdm as your default login manager (don't worry, you can login to kde with gdm)

Note: I am using sudo to run commands as root. If you don't like it, become root and run the same commands without sudo!

2. Add some new repositories

Some stuff needed for this aren't included in Debian. Open the file /etc/apt/sources.list with your favorite text editor (as root) and add the lines listed below:

deb http://cairographics.org/packages/debian/ unstable/
deb http://download.tuxfamily.org/osrdebian/ unstable compiz-fusion-git
deb http://download.tuxfamily.org/3v1deb/ debian-unstable beryl-svn


save and close the file

Now update your package lists by typing

sudo apt-get update

===
Note: to edit the file from a terminal type

sudo vi /etc/apt/sources.list

to edit the file with a Graphical Text Editor type

sudo kwrite /etc/apt/sources.list
OR
sudo gedit /etc/apt/sources.list

===


3. Get the xserver-xgl package from ubuntu feisty

You're probably wondering why... Simple, it works! I've tried other packages without any luck but this one worked :)

Get the file from this link:
Ubuntu xserver-xgl mirrors


4. Download and install the latest and greatest (yeah right...) ATI driver.

You can download the file from this link:
ATI Linux Driver

You're gonna need some extra tools to finish the installation, its a good idea to install them now by typing:

sudo apt-get install module-assistant debhelper
sudo m-a prepare
(say yes to all)

When everything is done, you'll have to prepare the ATI driver for installation (make sure your shell is at the same directory where the ATI driver is located)

chmod +x ati-driver-installer-8.40.4-x86.x86_64.run
sudo ./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Debian/unstable
sudo dpkg -i fglrx*


This phase may bring up some errors but you can ignore them for now. Next is the kernel module of the driver:

sudo m-a a-i fglrx
sudo apt-get -f install


Right now you should be ready to switch to the latest fglrx driver. Patch your xorg.conf by typing:

sudo aticonfig --initial --overlay-type=Xv

then edit your
/etc/X11/xorg.conf file (sudo vi /etc/X11/xorg.conf) and make sure that you have the following sections looking like mine (if a section is missing, add it!):

Section "Extensions"
Option "Composite" "0"
Option "RENDER" "Enable"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
Load "GLcore"
EndSection

Section "DRI"
Mode 0666
EndSection

Just to make sure, you can reboot your computer now and type the following command in a console after your Desktop has loaded:

fglrxinfo

If you get something similar to this, you're good to go!

display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI MOBILITY RADEON 9600/9700 Series
OpenGL version string: 1.2 (2.0.6747 (8.40.4))


5. Installing XGL

Type the following commands in a console (you need to be where the xgl package currently is)

sudo apt-get install libglitz-glx1 libglitz1
sudo dpkg -i xserver-xgl_7.2.0.git.20070224-0ubuntu3_i386.deb
sudo apt-get -f install


6. Installing Compiz Fusion and/or Beryl

Run the following commands:

// Compiz Fusion
sudo apt-get install compiz compiz-fusion-plugins-main compiz-fusion-plugins-extra compiz-fusion-plugins-unsupported compizconfig-settings-manager
fusion-icon

If you're running KDE get this package as well:
sudo apt-get install compiz-kde

// Beryl
sudo apt-get install beryl



7. Installing Window Decorators

Run the following commands:

// KDE (beryl only)
sudo apt-get install aquamarine


// Gnome (beryl only)
sudo apt-get install heliodor


// Emerald (optional)
sudo apt-get install emerald emerald-themes


8. Fix some important paths to enable XGL acceleration

XGL expects to find dri modules in the old dri directory, so we have to create a link to the new one

sudo mkdir -p /usr/X11R6/lib/modules/
sudo ln -s /usr/lib/dri /usr/X11R6/lib/modules/dri


9. Create a wrapper for the fusion-icon app (COMPIZ ONLY)

Run the following command (or edit /usr/bin/compiz-manager with your favorite text editor as root):

sudo vi /usr/bin/compiz-manager

type in the following:
#!/bin/bash
LD_PRELOAD=/usr/lib/fglrx/diversions/libGL.so.1.2 /usr/bin/fusion-icon $@

then make the file an executable:

sudo chmod +x /usr/bin/compiz-manager

10. Alter GDM configuration to start with XGL (also: KDM instructions for the brave)

IMPORTANT NOTE: kdm is painfully slow (unusuable) under XGL, especially in high resolutions. I recommend running GDM even if you're using a KDE desktop :)

// GDM
edit the file
/etc/gdm/gdm.conf

sudo vi /etc/gdm/gdm.conf

add the following under [servers]:

0=Xgl

add the following lines at the end of the file

[server-Xgl]
name=Xgl
command=/usr/X11R6/bin/Xgl -fullscreen -ac -accel glx:pbuffer -accel xv:fbo -fp /usr/share/fonts/X11/misc/
flexible=true

// KDM
If you must use KDM, here's how (NOT recommended):

Edit /etc/kde3/kdm/kdmrc

sudo vi /etc/kde3/kdm/kdmrc

Find the following line:

ServerCmd=/usr/bin/X -br

and make it look like this one:

ServerCmd=/usr/X11R6/bin/Xgl -fullscreen -ac -accel glx:pbuffer -accel xv:fbo -fp /usr/share/fonts/X11/misc/


11.a. GNOME ONLY

You should be ready to go.

Reboot your computer (or restart your login manager) and login to your Desktop.

If you think everything's a bit too slow, don't worry! Its because you haven't launched Compiz/Beryl yet.

Launch a terminal and type the following command to get Compiz Fusion up and running (as a normal user):

compiz-manager

if nothing happens, you'll have to activate compiz. Do that by right-clicking on the new blue cube in your system tray and selecting Select Window Manager -> Compiz


To start beryl type:

beryl-manager

(you might need to right click on the diamond @ your system tray and select Beryl from the window manager submenu before beryl actually takes over)

Thats it! If all went well, you should be looking at your newly XGL accelerated desktop.

Try moving a window around to confirm it and check Compiz/Beryl options for more features!

Check out point 12 on how to make Compiz/Beryl autostart :)


11.b. KDE

IMPORTANT: If you're running KDE, DONT REBOOT. KDE is extremely slow without compiz/beryl loaded. So slow, it'll take you a minute to open up a console! Follow the instructions at point 12, then restart! KDE will take a while to load, but then everything should run smoothly!


12. Autostart Compiz/Beryl

If everything went well, you'll probably want to autostart compiz/beryl each time you login:

// KDE (if you have the session restore feature of kde enabled, you dont have to do this)
edit the file
~/.kde/Autostart/xglmanager (new file, normal user) and add the following lines in it:

#!/bin/bash
compiz-manager &

or these lines for beryl:

#!/bin/bash
beryl-manager &

then make the file an executable

chmod +x ~/.kde/Autostart/xglmanager

// GNOME
Go to
System -> Preferences -> Sessions
Click
New
Type in
Compiz or Beryl in the name field
and
compiz-manager or beryl-manager in the command field
click
OK and you're done!

=== DONE! ===

I hope this How-To helps all you guys out there who love Debian and are using an ATI card :)
Comments/Corrections most welcome.

Have fun with Compiz/Beryl!

13 comments:

Anonymous said...

wow, thanks for the guide man. very easy to understand and comprehend. but i have a question, isn't compiz fusion both beryl and compiz? why is *or* compiz or beryl (whether in sessions, or installation) always involved?

Anonymous said...

under sessions, which one should i have? beryl or compiz? which one is better, i have beryl right now. i've seen videoes on youtube with compiz fusion, and they are different, by using beryl --replace, or compiz --replace, you'll just have either one, not both, am i correct?

wired said...

Compiz Fusion is the merge of Compiz and Beryl, so I guess its the best option. It's configuration tool feels more solid and it has some extra plugins.

However beryl has been around for quite some time and many people are used to it (its also a tad easier to install in Debian, you can skip the LD step), so I included it in my guide. There is also a limited number of plugins that haven't been ported to Compiz Fusion yet...

I successfully installed fusion-icon (similar to beryl-manager), which makes managing the Window Managers and Window Decorators easier (no more compiz --replace) so...

watch out for an update! :)

Anonymous said...

hello again ! if you don't mind, i need suggestions. i installed compiz fusion with xgl using a different method. the results were not well, because fglrx disables 3D acceleration thus only 2D was allowed. Under beryl and under these settings, beryl would automatically switch to *metacity*. all of this applies to my x850 xt (r480) video card. and finally, i thought, and from reading research, AILGX is suggested rather than XGL, older, and more difficult to use.

wired said...

The real problem is that the fglrx driver from ATI does not support AIGLX.

Its true that AIGLX is easier and better to use. It also allows other programs to access the 3D functions of your graphics card. However, the only way to currently use AIGLX is to use the free radeon driver, which is (so much) slower than the fglrx driver and doesn't support the newer ATI/AMD cards. Until ATI gives us AIGLX support, XGL is the only fast way to go.

The only problem with XGL is that you can't run other 3D applications at the same time. If you need fast 3D acceleration, you'll have to wait for AIGLX support in order to have Desktop Effects AND 3D support.

Are you using Debian? If yes, did you try to follow my guide? It includes some important linking of directories that is required to make XGL work.

Don't forget that you must have fglrx configured and running properly before you attempt to run XGL, otherwise XGL will fall back to software acceleration. Trust me, you don't want that, its TOO slow.

Anonymous said...

where you mentioned "way too slow" is happening to me right now, where at login i have to switch from my beryl session to regular gnome mode, and also under gnome mode, my typing is really slow right now! , there were errors in configuring and installing using your method only under step *6* installing compiz fusion,it says packages are not available, when i do "sudo apt-get update" there was an error relating to the deb packages you listed. also i had a problem using vi when editing documents, i used gedit instead, which should work right? in conclusion, it is just really slow right now, and unsatisfying, i hope to revert or fix this problem as soon as possible please. lastly i am using debian ubuntu 7.04 btw.

Anonymous said...

i reverted back to my previous settings, lol, i think i'm better off with AILGX man haha, i had to do lots of reconfiguring under the "black screen terminal" when my XORG failed by accidentally deleting the XGL files, b reconfiguring XORG to defaults, and fixing the GDM configuration file as well. well thanks for everything dude. please fix those deb packages , because they don't work properly for all your commands, specifically compiz-fusion, and that linux file in the beginning. thanks

wired said...

Ouch. My guide does not work with Ubuntu! It only works with plain Debian.

There are other guides for Ubuntu. Try this: how-to beryl on ubuntu feisty with ati

Good luck!

Anonymous said...

Excellent!
At last my HP 5120 works with compizFusion.

It's a Debian/Lenny (KDE) on Turion64, with an (stupid) ATI Radeon Xpress 200M.

an AMD64 repository for compizFusion?
Try this:
http://shame.tuxfamily.org/repo/?page_id=29

Anonymous said...

actually, that's brilliant. Thank you. I'm going to pass that on to a couple of people.

Anonymous said...

Nice Article.

Man with Mepis said...

I want to thank you from the bottom of my heart. I've jsut got beryl running smoothly on Mepis 7.0 with my radeon xpress 1100.
Your guide was invaluable in figuring out how to do it, you F**##ng rock! :D :D

Orion said...

It nearly worked for me. I needed to replace Option "Composite" "0" by Option "Composite" "1" in my xorg.conf file, after compiz --replace complained about Composite not being enabled. Now it works fine (on Debian testing (currently Lenny)).
Thanks for the tutorial man (the only one on all the f***ing web that worked for me) !

Powered By Blogger