XglHowto

Revision 36 as of 2006-05-11 09:59:00

Clear message

Note:New version easier and merged (for now only copy and paste) with xglati how-to. NOTHING has been deleted!!!

What is Xgl?

Xgl is a window subsystem. Basically, 3d acceleration finally meets the X.org desktop. This allows for a new era of usability (and eye candy). Note this is not the only 3D solution. More information can be found at the following link: * http://www.novell.com/linux/xglrelease/

Summary

Just to be clear, there are packages for XGL in Ubuntu Dapper, but they will not be installed by default, are not officially supported and might or might not break your system. In any case there is a lot of work going on on XGL since it is still experimental software, and these packages will definitely be outdated.

Now, if you still want to give it a try:

Here's how to get XGL working on Ubuntu Dapper. It won't ever be working on earlier versions without massive recompiling and manually installing a whole lot of things. So don't try Smile :)

Caveats

Certain Xgl / Compiz combinations have conflicts with certain programs. In particular, this combination does not play well with any other OpenGL applications on ATI cards.

Other stability issues (covered in troublshooting section below)

Overview of Installation

1. Working Direct Rendering (prerequisite)

2. Install necessary software

2. Configure new sessions for login manager

3. Test configuration

4. Troubleshooting

Installing Xgl / Compiz

We need compiz to start with the new Xgl server, so place the following in your session file. This is located at "System -> Preference -> Sessions. Go to the far right tab, and create a new entry and type in the following data:

compiz --replace gconf for more features in a new terminal try:

gset-compiz 

or in Sessions use

compiz --replace gconf decoration wobbly fade minimize cube rotate zoom scale move resize place switcher

1. We need a window decorator to start with the new Xgl server, so place the following in your session file. This is located at "System -> Preference -> Sessions. Go to the far right tab, and create a new entry and type in the following data:

gnome-window-decorator

Modify your sources.list file

1. Enable Universe and Multiverse repositories. Search around for this one - it is easy.

2. Add the following lines and then save the file:

{{{deb http://xgl.compiz.info/ dapper main deb http://www.beerorkid.com/compiz/ dapper main}}}

3. Apply the changes by updating sources. In the Synaptic Package Manager, click "Reload"

Getting the required software

(Information taken from DeeZid from here): * http://www.ubuntuforums.org/showthread.php?t=148860

Mark packages for installation:

Do a search for the following files using Synaptic Package Manager and mark for installation:

1. libglitz1

2. libglitz-glx1

3. xserver-xgl

4. libgl1-mesa

5. libsvg

6. libsvg-cairo

7. compiz

8. compiz-gnome

9. gset-compiz

Now, click "Apply changes" to install the newly marked software.

Configuring the environment

There are multiple ways to run Xgl. You can (for testing purposes) run Xgl as a session inside of an existing X windows session. Short of a hard lock, you can terminate the session, and go back to the regular X server. This will help in troubleshooting.

Stand alone Xgl session

Having a stand alone session as an option will allow the user to revert to the normal X server instantly, as no editing existing files are needed. This is the safest route because it if doesn't work, there is nothing to revert:

1. We will need to create two new files. Open up a terminal and copy the following code:

 sudo gedit /usr/bin/startxgl.sh. 

1. Inside this document, type in

{{{ #!/bin/bash

Xgl -fullscreen :1 -ac -accel glx:pbuffer -accel xv:fbo & sleep 2 && DISPLAY=:1 gnome-session }}}

1. Save this file, and close it.

1. Create a second file using the following code:

 sudo gedit /usr/share/xsessions/xgl.desktop 

1. In this file, paste the following:

{{{ [Desktop Entry] Encoding=UTF-8 Name=XGL Exec=/usr/bin/startxgl.sh Icon= Type=Application }}}

1. Save this file, and close it.

1. We need to make both these files executable:

{{{ sudo chmod 755 /usr/bin/startxgl.sh sudo chmod 755 /usr/share/xsessions/xgl.desktop }}}

1. Now logout of your current session, and from the login screen click "Options" and "Session chooser"

2. Select "Xgl"

3. When you login, it will ask you if you want to make this the default, or just for this session. For safety reasons, choose "Just for this session".

Troubleshooting

Xgl hard lock on ATI cards

There seems to be hardlocking issues with the Radeon X*** series of ATI cards with the "fglrx" drivers. This can be resolved by modifying the "/etc/X11/xorg.conf" file and placing the following in the graphics card section:

Option "KernelModuleParm" "agplock=0"

Windows don't have borders

Check to make sure that the "decoration" plugin is in the list of running compiz plugins. To do this, run "gconf-editor" and drill down to "apps" "compiz" "options" "plugins" and look for "decorator". If it isn't there, add it.

Other troubleshooting tools

  • Check to make sure that you have 3D acceleration by typing in "fglrxinfo" into a terminal. You should see "OpenGL vendor string: ATI Technologies Inc.". If not, resolve that issue first.
  • The original HOWTO by Mattisking asks the user to edit their /etc/gdm/gdm.conf and /etc/gdm/gdm.conf-custom files. With the new method, these alterations should be taken out.
  • If Xgl is hard locking your system before you can start compiz, follow the logs for the system by entering in the command:

 sudo tail -f /var/log/syslog 

  • If you are running Xgl and/or compiz, but are not seeing the fancy results everyone is describing, then check to make sure you have the following packages installed:
    • compiz (0.0.5-0ubuntu4)
    • compiz-gnome (0.0.5-0ubuntu4)
    • xserver-xgl (7.0.0-0ubuntu3)


Old HOW-TO

Many thanks to Matthew Garrett for packaging XGL so quickly and writing the e-mail that's the base of this page.

Warning /!\ XGL is still highly experimental and not recommended for casual use.

  1. Enable the universe repository (see AddingRepositoriesHowto)

  2. Make sure that you have the latest mesa, libglitz1 and libglitz-glx1, xserver-xgl

    sudo apt-get update

    sudo apt-get install libgl1-mesa libglitz1 libglitz-glx1 xserver-xgl
  3. Install compiz-kde and/or compiz-gnome depending on your desktop

    sudo apt-get install compiz-gnome

If you do not want to replace the default X session with Xgl, you may look at NestedXglHowto, otherwise proceed with the instructions:

  1. Replace /etc/X11/X with a symlink to /usr/bin/Xgl

    sudo ln -sf /usr/bin/Xgl /etc/X11/X
  2. Close all applications and restart gdm (This will log you out, consider this your cue to print these instructions!)

    sudo /etc/init.d/gdm restart
  3. Log in, then in a terminal start compiz and the Gnome window decorator (do NOT use sudo here)

    compiz --replace gconf decoration wobbly fade minimize cube rotate zoom scale move resize place switcher

    nohup gnome-window-decorator &

Leave out the gconf plugin if you don't have compiz-gnome installed

  1. Add these commands to ~/.gnomerc if you want this on every login (which you probably do)

    echo "compiz --replace gconf decoration wobbly fade minimize cube rotate zoom scale move resize place switcher" >> ~/.gnomerc

    echo "nohup gnome-window-decorator &" >> ~/.gnomerc

Here are the various key combinations and uses for various plugins (Super-key is the same as the windows key). You can change all of these using gconf-editor (Might be necessary since the windows key is reported not to work with xgl on some systems).

Warning /!\ The key combinations interact! If you bind something to <Alt><Ctrl>Button4 and to <Ctrl>Button4 both will be activated if you use the first!

Warning /!\ The key combinations are also passed-through to apps below the cursor.

  • Kill the Xgl server = Shift + Backspace
  • Switch windows = Alt + Tab
  • Arrange and View All Windows = F12 turns on or off; clicking a window will zoom it to the front
  • Switch desktops on cube = Ctrl + Alt + Left/Right Arrow
  • Switch desktops on cube with active window following = Ctrl + Shift + Alt + Left/Right Arrow
  • Rotate desktop cube = Ctrl + Alt + Left-click on wallpaper and drag
  • Change opacity = Ctrl + Shift + Mouse wheel
  • Make window translucent/opaque = right-click the window's title bar and select Opacity (seems to be absent in current compiz cvs. Use the tip above to set transparency)
  • Zoom-in once = Super-key right-click
  • Zoom-in manually = Super-key + wheel mouse up
  • Zoom-out manually = Super-key + wheel mouse down
  • Move window = Alt + left-click
  • Snap Move window (will stick to borders) = Ctrl during move (either by Alt + left-click or by title bar)
  • Resize window = Alt + right-click
  • Display svg picture on top of cube = modify gconf db,add svg files to /apps/compiz/plugins/cube/screen0/options/svgs (restart needed) [http://ubuntuforums.org/showthread.php?p=778420#post778420 Option broken in current repos]

To get back to sanity (normal X):

  1. If you edited ~/.gnomerc in the last step of the previous part, remove the commands again
  2. Replace /etc/X11/X with a symlink to /usr/bin/Xorg

    sudo ln -sf /usr/bin/Xorg /etc/X11/X
  3. Close all applications and restart gdm (This will log you out!)

    sudo /etc/init.d/gdm restart

    If the X server still does not come up, you may have to reset the original X server with this command:

    sudo dpkg-reconfigure xserver-xorg-core

As noted before, these are highly experimental packages. If it crashes, this is unsurprising. Please do feel free to file bugs, but right now they'll probably just be forwarded upstream. Please do not be surprised if it doesn't work. If you're running binary drivers, things get even more complicated and there's a reasonable chance that things will fail to work in strange and unexpected ways.

Have fun, and start thinking of ways that this technology can be used for the force of good.

For the users who are having troubles (hard lockups, no response to keyboard) with ATI PCI Express graphics cards (x300, x700 etc) editing your xorg.conf file to make it look like this has been known to work:

Section "Device"
   Identifier  "card0"
   Driver      "fglrx"
   Option       "no_accel" "no"
   Option       "no_dri" "no"
   Option       "DynamicClocks" "on"
   Option       "mtrr" "on"
   Option       "DesktopSetup" "Single"
   Option       "ScreenOverlap" "0"
   Option       "Capabilities" "0x00000000"
   Option       "CapabilitiesEx" "0x00000000"
   Option       "VideoOverlay" "on"
   Option       "OpenGLOverlay" "off"
   Option       "CenterMode" "off"
   Option       "PseudoColorVisuals" "off"
   Option       "Stereo" "off"
   Option       "StereoSyncEnable" "1"
   Option       "FSAAEnable" "no"
   Option       "FSAAScale" "1"
   Option       "FSAADisableGamma" "no"
   Option       "FSAACustomizeMSPos" "no"
   Option       "FSAAMSPosX0" "0.000000"
   Option       "FSAAMSPosY0" "0.000000"
   Option       "FSAAMSPosX1" "0.000000"
   Option       "FSAAMSPosY1" "0.000000"
   Option       "FSAAMSPosX2" "0.000000"
   Option       "FSAAMSPosY2" "0.000000"
   Option       "FSAAMSPosX3" "0.000000"
   Option       "FSAAMSPosY3" "0.000000"
   Option       "FSAAMSPosX4" "0.000000"
   Option       "FSAAMSPosY4" "0.000000"
   Option       "FSAAMSPosX5" "0.000000"
   Option       "FSAAMSPosY5" "0.000000"
   Option       "UseFastTLS" "0"
   Option       "BlockSignalsOnLock" "on"
   Option       "UseInternalAGPGART" "no"
   Option       "ForceGenericCPU" "no"
   Option       "KernelModuleParm" "agplock=0"
   Option       "PowerState" "1"
   BusID       "PCI:1:0:0"
EndSection


Alternate Instructions

http://www.ubuntuforums.org/showthread.php?t=131267 https://wiki.ubuntu.com/xglati


CategoryDocumentation