Xgl

From ArchWiki

Jump to: navigation, search
i18n
English
Français
Italiano
한국어

Contents

[edit] Introduction

Xgl is an X server architecture, started by David Reveman, layered on top of OpenGL via glitz. It takes advantage of modern graphics cards via their OpenGL drivers, supporting hardware acceleration of all X, OpenGL and XVideo applications and graphical effects by a compositing window manager such as Compiz. It is, as of February 2006, in the early stages of production and in need of lower-level OpenGL drivers. Read more about Xgl in Wikipedia

[edit] Prerequisites

Xgl requires the following:

  • Xorg must be installed and configured for your hardware
  • ATI and NVIDIA owners must use proprietary drivers (e.g. fglrx)

[edit] Installation

[edit] From the Repositories (recommended)

Xgl is available from the Community repository:

# pacman -S xgl

Turn off any existing X server, then run:

$ startxgl --help

to determine what parameters you need to use. Then run startxgl once again with the correct parameters.

[edit] From Source

You need to obtain PKGBUILD. You can find them in AUR. Compile and install:

  • xgl

[edit] Configuration

Currently to take advantage of Xgl on the desktop you would install either Compiz Fusion, Xcompmgr, Compiz or Beryl.

[edit] GDM

[edit] Method 1 - GDM uses Xgl

This guide is largely a modification of these instructions from the Gentoo Wiki. This guide will explain the steps I used to get Xgl running while using the GDM.

First, we need to set GDM to use Xgl instead of regular X, so open /opt/gnome/etc/gdm/gdm.conf as root with your favorite text editor (be sure to make a backup first):

(Note: With GNOME 2.13 these changes should go into /opt/gnome/etc/gdm/custom.conf, or optionally you can use the /opt/gnome/sbin/gdmsetup GUI to create the gdm.conf. With GNOME 2.18 and/or GDM 2.18 you'll use /etc/gdm/custom.conf to override the defaults.)

  1. Search for the [servers] section
  2. Comment out 0=Standard, replacing it with 0=inactive
  3. Add another line after 0=inactive to read 1=Xgl

You should end up with:

[servers]
# These are the standard servers.  You can add as many you want here
# and they will always be started.  Each line must start with a unique
# number and that will be the display number of that server.  Usually just
# the 0 server is used.
# 0=Standard
0=inactive
1=Xgl

Since we have 1=Xgl we have to define Xgl as a server. To do that, go to the end of gdm.conf (or custom.conf) and add:

# Definition of the xgl X server.
[server-Xgl]
name=Xgl
command=/usr/bin/Xgl :1 -accel glx:pbuffer -accel xv
flexible=true
chooser=false
handled=true
priority=0 

For ATI users, the command line should read:

command=/usr/bin/Xgl :1 -accel xv:pbuffer -accel glx:pbuffer

[edit] Method 2 - New GDM entry starts GNOME with Xgl

Note: this method starts an Xgl session separate from GDM (GDM starts on a regular X server), which means GDM doesn't actually manage the session - causing several issues. The first method is more proper.

Simple (UTjunkie) method which seems to work. The only problem I've found with this method is that you can no longer directly shut down or restart from GNOME. You have to first log out and then choose the shut down/restart from GDM. I'm going to do this for GNOME with Nvidia, but it's basically the same for other settings...:

As root: create /etc/X11/sessions/gnome-xgl.desktop using your favorite text editor It's contents should be:

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=startxgl-custom
TryExec=startxgl-custom
Name=GNOME with Xgl support
Name[en_CA]=GNOME with Xgl support
Name[en_GB]=GNOME with Xgl support

Now create /usr/bin/startxgl-custom. Put this in it:

#!/bin/sh
Xgl :1 -fullscreen -accel xv:pbuffer -accel glx:pbuffer & # This is for ATI users, NVIdia users should use: Xgl :1 -accel glx:pbuffer -accel xv
DISPLAY=:1 gnome-session

And make it executable:

chmod 755 /usr/bin/startxgl-custom

You now have an additional entry in the "choose session" under GDM. You have the option of loading up gdm with or without xgl from within GDM. If you're using different hardware, or want to add other desktop environments, edit /usr/bin/startxgl and replace the "gnome-session" with your favorite desktop environment Obviously you can create more of these .desktop files in the /etc/X11/sessions directory for other configurations or window managers.

Please note that I chose my locale. If you're living somewhere else, you'll probably want to choose yours. You can get a full list of the locales (and copy and paste the text into your new .desktop file) from any of the files that were originally in /etc/X11/sessions/. If you get the locales wrong, the name will come up in GDM as "foo" or something, not the description you gave it.

[edit] KDM

[edit] Method 1 - KDM uses Xgl

edit the file /opt/kde/share/config/kdm/kdmrc

Find the line

ServerCmd=/usr/bin/X -br

if you have a nvidia card, replace it with

ServerCmd=/usr/bin/Xgl :0 -fullscreen -accel xv -accel glx:pbuffer

for ati video cards, replace the line with

ServerCmd=/usr/bin/Xgl :0 -fullscreen -accel xv:pbuffer -accel glx:pbuffer

after that, locate the [X-*-Core] section and add the following lines

#Xgl extra lines
OpenRepeat=5
OpenDelay=15
OpenTimeout=2000
ServerTimeout=60


[edit] Method 2 - New KDM entry starts KDE with Xgl

Note: this method starts an Xgl session separate from KDM (KDM starts on a regular X server - is not necessary change kdmrc file ), which means KDM doesn't actually manage the session - causing several issues. The first method is more proper but can cause some problems starting KDM from rc.conf.

The only problem I've found with this method is that you can no longer directly shut down or restart from KDE. You have to first log out and then choose the shut down/restart from KDM. I'm going to do this for KDE with ATI, but it's basically the same for other settings...:

As root: create /etc/X11/sessions/kde-xgl.desktop using your favorite text editor (mine's vim.....so laugh at me) It's contents should be:

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=startxgl-kde
TryExec=startxgl-kde
Name=KDE with Xgl support
Name[en_CA]=KDE with Xgl support
Name[en_GB]=KDE with Xgl support

Now create /usr/bin/startxgl-kde. Put this in it:

#!/bin/sh
Xgl :1 -fullscreen -accel xv:pbuffer -accel glx:pbuffer -nolisten tcp & 
# Nvidia users should change xv:pbuffer for xv if it doesn't work directly (it does for me)
DISPLAY=:1 startkde

And make it executable:

chmod 755 /usr/bin/startxgl-kde

And you're done. You now have an additional entry in the "choose session" under KDM. You have the option of loading up kde with or without xgl from within KDM.

[edit] Method 3 - Using Xstartup

Edit the file /opt/kde/share/config/kdm/kdmrc

Find the line

ServerCmd=/usr/bin/X -br

if you have an nvidia card, replace it with

ServerCmd=/usr/bin/Xgl :0 -fullscreen -br -accel glx:pbuffer -accel xv:pbuffer

for ati video cards, replace the line with

ServerCmd=/usr/bin/Xgl :0 -fullscreen -accel xv:pbuffer -accel glx:pbuffer

after that, locate the [X-*-Core] section and add the following lines

#Xgl extra lines
OpenRepeat=5
OpenDelay=15
OpenTimeout=2000
ServerTimeout=60

[edit] Using startxgl

In order to use a startxgl script, we need to copy the startx script.

cp /usr/bin/startx /usr/bin/startxgl

Now we can change the commands to start xgl. Please find and replace the following with either the nVidia command or the ATI command.

xinit $clientargs -- $serverargs -deferglyphs 16 &
  • nVidia:
xinit $clientargs -- /usr/bin/Xgl -br -ac -accel xv:pbo -accel glx:pbuffer $serverargs -deferglyphs 16 &
  • ATI:
xinit $clientargs -- /usr/bin/Xgl -br -ac -accel xv:pbuffer -accel glx:pbuffer $serverargs -deferglyphs 16 &

[edit] Starting a window manager

Now, to see all XGL things, you must have installed a window manager with these effects. You can install

pacman -S compiz

or

pacman -S compiz-fusion

For more information, see their wiki page Compiz Fusion or Compiz

[edit] Troubleshooting

See Xgl Troubleshooting

[edit] Tips & Tricks

See Xgl Tips and Xgl Success Stories

[edit] Additional Resources

  • AIGLX
  • Composite -- A Xorg extension required by composite managers
  • Compiz Fusion -- A composite and window manager offering a rich 3D accelerated desktop environment
  • Compiz -- The original composite/window manager from Novell
  • Xcompmgr -- A simple composite manager capable of drop shadows and primitive transparency
  • Beryl -- A composite/window manager forked from Compiz (since merged to become Compiz Fusion)
Personal tools