个人工具

UbuntuHelp:CompositeManager/Xgl

来自Ubuntu中文

跳转至: 导航, 搜索

Warnings

<!> This guide works great for Feisty Fawn 7.04. Do NOT follow this guide for Gutsy Gibbon 7.10 since Xgl framework has changed dramatically. <!> Xgl is alpha software so it isn't recommended that you install this software on a production machine. For Dual Monitor (or more) users: A lot of people are experiencing troubles when enabling Xgl. Especially for this group, be *very* careful with Xgl.


<!> For a simpler way that should work with Gusty Gibbon and ATI Radeon and Mobility Radeon GPU's click on the following link: >/simple<


Introduction

This page details how to install Xgl on your system.

Prerequisites

  1. You need to be running at least the Dapper (6.06 LTS) release.
  2. You need a supported video card. (See list below.)
  3. You need to have video card drivers with 3D acceleration installed. See Hardware on the Ubuntu Documentation for help with this.

Supported Hardware

  • ATI
  • Mobility Radeon 9700 SE: Xgl running with proprietary fglrx driver 8.23
  • Radeon X300: Xgl running with proprietary fglrx driver 8.23
  • NVIDIA
  • A MX 4xxx series card or newer using the NVIDIA binary driver.
  • Intel
  • i8xx and i9xx

(./) For a comprehensive list of supported graphics cards with user comments, see this Gentoo Wiki page. (!) Note for intel users : Running xgl might be slow with intel cards. If you want to run compiz, you might prefer to run aiglx.

Installation

Installing Xgl packages

All you have to do is install the xserver-xgl package, it will take care of all the dependencies. See Adding, Removing and Updating Applications for help with this.

sudo apt-get install xserver-xgl

For Gutsy (Ubuntu 7.10) users this is all you need to do. Once installed, Gutsy's Xgl will automatically start next time you log in. Users of Feisty (Ubuntu 7.04) and older will need to do the further set up described on the rest of this page.

Choose How Your Computer Will Start Xgl (Feisty and older)

There are multiple ways to run Xgl. You may first want to test everything works before making Xgl and compiz your default configuration. One way to do this is to run Xgl as part of your desktop session. Short of a hard lock, you can terminate that session to stop Xgl and continue using the regular X server. Method A below describes this route. Method B is about setting Xgl as the standard X server started by GDM, the Gnome Display Manager. This is basically system-wide deployment of Xgl rather than per user desktop session. (!) KDE and XFCE Users should use method A, GNOME users may choose either. <
>

Method A: Xgl Session on Login Window

This will allow you to start Xgl as an option at the login screen. The Xgl server starts on DISPLAY :1 as part of your desktop session and terminates when you end your session. This is convenient route as you can simply select a regular session if Xgl doesn't work. Xorg continues running on DISPLAY :0 since it's needed by Xgl.

  • We will need to create two new files: a startup script and a X session file.

Open up a terminal and create a new script named startxgl.sh:

gksudo gedit /usr/bin/startxgl.sh

On Kubuntu run:

kdesu kate /usr/bin/startxgl.sh

(!) Note that /usr/bin is the place where most of the system's binaries get installed; /usr/local/bin or ~/bin are usually regarded as better places for locally installed and administered software. If you decide to create your script in one of these places be aware that you may need to create the directories as well. Don't forget to change the script's location accordingly throughout the tutorial.

NVIDIA (using GNOME) #!/bin/sh >Xgl :1 -fullscreen -ac -accel xv:fbo -accel glx:pbuffer &>DISPLAY=:1>dbus-launch --exit-with-session gnome-session
NVIDIA (using KDE) #!/bin/sh >Xgl :1 -fullscreen -ac -accel xv:fbo -accel glx:pbuffer &>DISPLAY=:1>exec startkde
NVIDIA (using XFCE) #!/bin/sh >Xgl :1 -fullscreen -ac -accel xv:fbo -accel glx:pbuffer &>DISPLAY=:1>exec xfce4-session
ATI or Intel (using GNOME) #!/bin/sh >Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &>DISPLAY=:1>dbus-launch --exit-with-session gnome-session
ATI or Intel (using KDE) #!/bin/sh >Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &>DISPLAY=:1>exec startkde
ATI or Intel (using XFCE) #!/bin/sh >Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &>DISPLAY=:1>exec xfce4-session

(!) The package dbus-x11 is needed for the dbus-launch command. If it is not installed your xsession will terminate on launch.

  • Save this file, and close the editor.
  • Make the script executable with the following command:
sudo chmod +x /usr/bin/startxgl.sh
  • Now we'll add an option to the gnome login manager so that we can choose to log into our new Xgl-gnome session. Create an Xsession file like so:
gksudo gedit /usr/share/xsessions/xgl.desktop

In Kubuntu run

kdesu kate /usr/share/xsessions/xgl.desktop
  • In this file, paste the following:
[Desktop Entry]
Encoding=UTF-8
Name=Xgl
Comment=Start an Xgl Session
Exec=/usr/bin/startxgl.sh
Icon=
Type=Application
  • Save this file and close the editor.
  • To log into Xgl, logout of your current session, and from the login screen click "Options" and "Session chooser".
  • Select "Xgl" from the Session menu.
  • When you login, gdm will ask if you would like to make the "Xgl" session the default session. For now, choose "Just for this session".

(!) When your Xgl desktop appears for the first time, gnome may ask you about your keyboard localization preference. Choose "Use Gnome keyboard localization" to continue using your usual keyboard settings.


<
>

Method B: Make Xgl Your Standard Display Server for Ubuntu Users

Another way to run Xgl involves replacing Xorg with Xgl as the standard X display server for use with GDM, the Gnome Display Manager. Xgl will take DISPLAY :0 and start Xorg on DISPLAY :93 since it's needed by Xgl. Switching between X servers will not be as simple as logging out and back in again though; it will require a little bit of file editing instead.

If you have NVIDIA

We'll configure the gnome display manager. In the terminal type:

gksudo gedit /etc/gdm/gdm.conf-custom

Find the [servers] section and modify it to look like this:

[servers]
0=Xgl

[server-Xgl] 
name=Xgl server 
command=/usr/bin/Xgl -fullscreen -br -accel xv:fbo -accel glx:pbuffer
flexible=true
If you have ATI with fglrx drivers

When we use this alternative we must change standard server to 1

gksudo gedit /etc/gdm/gdm.conf

Find this lines and switch standard server to 1

#0=Standard
1=Standard

Now we configure a custom display server:

gksudo gedit /etc/gdm/gdm.conf-custom

Add a new [server-Xgl] section and change the [servers] section to look like this:

[servers]
1=Xgl #Override display 1 to use Xgl (DISPLAY 1 IMPORTANT FOR FGLRX, 0 works on Edgy+FGLRX).  

[server-Xgl] 
name=Xgl server
command=/usr/bin/Xgl -fullscreen -br -accel xv:pbuffer -accel glx:pbuffer -dpi 100 -nolisten tcp
flexible=true
Else

Add a new [server-Xgl] section and change the [servers] section to look like this:

[servers]
0=Xgl

[server-Xgl] 
name=Xgl server 
command=/usr/bin/Xgl -fullscreen -br -accel xv:pbuffer -accel glx:pbuffer
flexible=true

(!) If you have ATI with the ati drivers then display is 0 and not 1 as with the fglrx drivers. To find out what drivers you are using type grep "Driver" /etc/X11/xorg.conf in a terminal and look for "ati" or "fglrx". Display 0 may work with the FGLRX driver under Edgy Eft/6.10. (!) Xgl server takes a bit longer to start up than normal X server. If you are not able to reach the login screen and you notice that the Xgl server tries to start up multiple times before falling back to console login, you may try editing the file /etc/gdm/gdm.conf and changing the line GdmXserverTimeout=10 into GdmXserverTimeout=50 -- Battlehorse (!) To make sure Xgl is running in your current session, just run ps -e | grep Xgl from a terminal. If there is output it is running, if not you have a configuration issue and should seek assistance. (!) If you are using an ATI card with method B, you may end up with the ATI driver unable to find the card during XGL startup. You will know if this is the case if animations are slow when opening or moving a program window. This has been verified on a Dell Optiplex GX620 with a Radeon X600. If this occurs, you can attempt to use display 0 instead of display 1 in the gdm-conf.custom file. (!) If you are using an ATI card with fglrx drivers, your dpi is set to non-default 100 and your fonts will look fuzzy. After you complete this guide and start Gnome, select System/Preferences/Fonts, click on Details, and adjust Resolution to 100 dots per inch. <
>

Method C: Make Xgl Your Standard Display Server for Kubuntu Users

Yet again, another way to run Xgl involves replacing Xorg with Xgl as the standard X display server for use with KDM, the KDE Display Manager. Xgl will take DISPLAY :0 and start Xorg on DISPLAY :93 since it's needed by Xgl. Switching between X servers will not be as simple as logging out and back in again though; it will require a little bit of file editing instead. (!) You should be warned, this method has been reported to be unstable on several configurations with no real cause. If this is the case for you you should try Method A instead. We'll configure the KDE display manager. In the terminal type:

kdesu kate /etc/kde3/kdm/kdmrc
If you have NVIDIA

We need to edit the ServerCmd line to look like this:

ServerCmd=/usr/bin/Xgl -fullscreen -br -accel xv:fbo -accel glx:pbuffer
If you have ATI

We need to edit the ServerCmd line to look like this:

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

We need to edit the ServerCmd line to look like this:

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

You will need to restart KDM before the changes take place. If X does not come back up, revert your kdmrc. <
>

Xgl Installed!

Let's move on to installing a composite|manager!

Further reading

<
>

Discussion

  • MatteoZandi, I choosed method A, but when I log out there is no shutdown button, how comes? How should I fix it?

see also thread http://www.ubuntuforums.org/showthread.php?t=206122&highlight=xgl+shutdown


  • AlwinGarside: I can't get Xgl to start using method A no matter what I try. I think it should be documented better.

  • NicholasIstre: Also, method A currently has an issue where the screen will black out if no input has been entered in around 10 minutes, despite any settings in the screensaver and power management. This is an issue when watching movies that are longer than 10 minutes. Method B doesn't have this problem.

  • Focher: Can someone add a method for checking to see if Xgl is running?

Open System > Administration > System Monitor, then look for Xgl as a running process.


  • casper911ca : Xgl is running terribly slow. I've gone though this TWICE and it each time i get the same result. Nvidia Quadro FX Go1400. I sucessfully set Xgl/compiz in FC5 and it ran beautifully, so I know its possible.
~$ glxgears

85357 frames in 5.0 seconds = 17071.295 FPS 95417 frames in 5.0 seconds = 19083.328 FPS


  • Fafek2: Does anybody know how to install Xgl on Matrox G450 card with Ubuntu 6.06? Open source drivers "mga" are already installed and they support direct rendering.

  • Angrykeyboarder : What if I run both KDE and GNOME and wish to enable XGL on both? And can this be done with KDM vs. GDM? Also, are the existing instructions any different for Edgy?

  • GianlucaDAndrea : i've an ati x600 video card on a toshiba satellite m50 running dapper. the method A works perfectly, while the method B don't works, even if I use 0=Xgl in /etc/gdm/gdm.conf-custom. what's the problem?


  • DavidWenRiccardiZhu : XGL through method A worked on both GNOME and KDE. However XGL on KDE runs much more slowly. Moving windows, icons, and the selected items highlight in menus all have a short delay. Any known cause(s) and possible solution(s)?