Using Xgl on SUSE Linux

Jump to: navigation, search
正在翻譯中!!


This page gives the way of installing and using 3D effect on the desktop. This include installing the 3D drivers of your graphic card and the compiz windows manager that allow the effects.

openSUSE 10.3

If 10.2 wasn't simple enough, 10.3 brings home a whole new dimension to Compiz - Compiz without Xgl. Xorg/Compiz makes it easier to configure and use.

Three clics install and use

The three clics install is given in this mail]

And the howto use the effects in this other mail

NVidia Cards

Install the proprietary drivers using the 1-click install system

NVidia Cards(More Recent): Nvidia-1click.png

NVidia Cards(Legacy): Nvidia-legacy-1click.png --- Run the following commands to make nvidia configure Xorg for your configuration

Shellscript.png su -
nvidia-xconfig --composite
nvidia-xconfig --render-accel
nvidia-xconfig --add-argb-glx-visuals -d 24

For more information, see NVIDIA

ATI

Check this page for instructions

Setting up Xgl

Only for openSUSE 10.2 and older
Works on both KDE and GNOME

Run the following command as root:

Shellscript.png gnome-xgl-switch --enable-xgl

Reboot your computer after this for xgl to take over

Using more Compiz plugins

See Below. Instructions are common for 10.2 and 10.3 with respect to Compiz extra plugins

Using Compiz

Detailed instructions are available here Compiz

openSUSE 10.2

Using desktop effects with Xgl/Compiz on openSUSE 10.2 is really easy. The packages you need are installed by default.

3D Acceleration

First you have to make sure you have 3D acceleration. Some ATi cards are supported by the open source radeon driver - but in most cases you'll need the proprietary ATi or Nvidia drivers. See NVIDIA or this ATi howto

Enabling Xgl/Compiz with default plugins only

Works on both KDE and GNOME

Run the following command as root:

Shellscript.png gnome-xgl-switch --enable-xgl

Reboot your computer and you'll have desktop effects with Compiz/Xgl. However you'll only have the default plugins loaded, which doesn't include the popular wobbly windows.

Troubleshooting

If you get error /var/run/gdm.pid doesn't exist, perhaps GDM isn't running, see http://forum.beryl-project.org/viewtopic.php?f=44&t=922&start=30

Loading Xgl/Compiz with selected plugins

Kde-logo.png
如果您使用 KDE 桌面環境:


  • Create the file /home/<username>/bin/kde-start-compiz
  • Enter two lines into it:
compiz --replace glib gconf <plugins to load> &
gtk-window-decorator &

There are many plugins, and you need to be careful, because some of them depend on the others and the order in which they're loaded is important too. Here's a list of the available plugins in an order that works:

dbus decoration minimize place wobbly fade plane 
cube rotate switcher move resize screenshot scale zoom water
  • Finally, make sure the file is made executable (Right Click -> Properties -> Permissions). And this file will be executed during KDE startup whenever Xgl is enabled.

The above steps are automated by an external graphical tool called opensuse-xgl-settings that you might want to try.

Gnome-logo.png
如果您使用 GNOME 桌面環境:
Coming soon..

Disabling Xgl/Compiz

To disable Xgl/Compiz again run:

Shellscript.png gnome-xgl-switch --disable-xgl

New Xgl/Compiz Packages

To get the newest Xgl/Compiz packages for easy installation with your package manager you should add this repository:

Susemini.png
Version:
10.2
http://software.opensuse.org/download/X11:/XGL/openSUSE_10.2/

SUSE Linux 10.1

We have tried to make Xgl/Compiz installation and configuration relatively easy on SUSE Linux 10.1 and SUSE Linux Enterprise Desktop 10 (at least when compared to using Xgl on older versions of SUSE Linux). However, the software is still very young, and rough around the edges. This page explains what is involved in setting up Xgl on SUSE Linux, and a few of the problems you might encounter while doing so.

Getting the Latest Packages

There have already been several important updates to the Xgl packages since SUSE 10.1 was released, and even a few bug fixes since the release of SLED 10. Use YaST2 or the Software Updater tool to make sure you have the latest compiz, xgl, xgl-hardware-list, gnome-session and libwnck packages.

A fork of compiz, known as beryl, and its configuration tools is available at beryl-project.org. SUSE packages for Factory tree as well as SUSE LINUX 10.1 are available by the openSUSE buildservice. A straight forward tutorial on how to install the latest beryl packages is also available.

In the buildservice you can also find beta compiz packages and third-party plugins backported from beryl. These are not included in the standard SUSE packages (and therefore they may also have bugs that don't exist there).

If you want to use beryl, or try out compiz on AIGLX running openSUSE10.2, you also should add the latest xorg7.2 packages from buildservice.

A new Compiz-Fusion community now works with upstream Compiz, replacing Beryl. Compiz-Fusion community contributes many new plugins and settings tool.

Setup

(While most of what is described below will still work with openSUSE 10.2, a much simpler method of getting a basic KDE/XGL/Compiz setup running is described in the official openSUSE 10.2 documentation)

Xgl is not activated automatically when you install it. To turn it on, run the "Desktop Effects" control panel. (Available from the Control Center in GNOME, or by running the command "gnome-xgl-settings" from a terminal or the Run dialog in KDE.)

The Desktop Effects tool will analyze your system and attempt to determine whether or not you can run Xgl. If it finds anything wrong, it will advise you on what actions can be taken.

Note: "gnome-xgl-settings" is part of "compiz-gnome" package.

Supported and Unsupported Video Cards

Novell has tested a variety of popular video cards and embedded video chipsets from ATI, Intel, and NVIDIA to find out which ones work well with Xgl. The Desktop Effects tool will tell you one of four things:

Your graphics card is supported. 
Xgl should work fine.
Your graphics card will not work with Xgl. 
The Desktop Effects tool will not let you enable Xgl if you have a card that either (a) has no support for 3D acceleration, or (b) is known to cause Xgl to crash or garble the contents of the screen while performing basic operations.
Your graphics card is not supported, but may work. 
The card isn't completely useless with Xgl, but either (a) it's annoyingly slow, or (b) you may experience crashes or garbled graphics when doing "tricky" operations (eg, spinning the cube while playing full-screen video).
Your graphics card is not in Xgl's database. 
The Desktop Effects tool will still do its best to help you configure Xgl, but you may or may not be successful. We are continuing to test new cards and will be releasing updated versions of the xgl-hardware-list package as we gather more information.

In some cases, the problems with certain cards may turn out to be due to bugs in Xgl, or bugs in the video drivers, so if you are having problems, make sure you have the latest versions of all the relevant packages.

3D Acceleration

The next piece of information the Desktop Effects tool provides is whether or not 3D acceleration is enabled on your card. With some cards, this will be enabled automatically. With others, you will need to take special action; the Desktop Effects tool will do its best to help you here.

Enabling 3D Acceleration with Intel chipsets

On supported Intel chipsets, enabling 3D acceleration is just a matter of checking a box in SaX2. If Desktop Effects finds that you don't have 3D acceleration enabled, it will offer to run SaX2 to let you fix it. In the original release of SUSE 10.1, clicking the "Run SaX2" button will actually send you to SaX2, and you have to check the correct button (at the bottom of the page) yourself and click OK. With more recent packages, the "Run SaX2" button will make the change for you using libsax.

Enabling 3D Acceleration with ATI or NVIDIA cards

All supported ATI and NVIDIA cards require proprietary video drivers written by the manufacturers in order to support 3D Acceleration. If the Desktop Effects tool sees that you don't have the drivers installed, it will offer to run the Software Update tool to install them for you.

On SLED10, this should work if you registered with Novell during the installation. If you did not register then, you can do it now by using the "Novell Customer Center Configuration" tool in YaST. This will add the ATI and NVIDIA driver repositories to your YaST/ZMD installation sources list, so that the Desktop Effects tool will be able to find the packages it needs.

On SUSE 10.1, the easiest thing to do is to just install the drivers by hand before running Desktop Effects. You can find ATI drivers at http://www.ati.com and NVIDIA drivers at ftp://download.nvidia.com/novell/. (Alternate instructions for installing the binary drivers by hand can be found at http://www.suse.de/~sndirsch/.)

If you have an ATI card, several options must be set in your /etc/X11/xorg.conf in order for Xgl to work reliably. The version of the Desktop Effects tool that shipped with SUSE 10.1 will not make these changes itself; This is one of the reasons you should install the Factory Distribution compiz package before trying to use Xgl. The Using Xgl on older versions of SUSE Linux page has details on the changes that need to be made if you can't install the Factory packages. Some help for setting up ATI-card can be found at http://en.opensuse.org/Howto/ATI_Driver

Enabling 3D Acceleration with other cards

If the Desktop Effects tool doesn't recognize your video card, it might think that 3D Acceleration is disabled even though you know it's really enabled. Since Desktop Effects won't let you enable Xgl unless it thinks 3D Acceleration is enabled, this can be a problem.

To override the autodetected setting for 3D Acceleration, hold down the Shift key and then double-click on the word "Disabled" next to "3D Acceleration". Only do this if you are certain that 3D Acceleration is enabled on your machine. (For the record, you can also do this to change its idea of whether or not your video card is supported, but that's even less recommended.)

Enabling and Disabling Xgl

If you have a supported (or at least, "usable") video card, and have managed to enable 3D Acceleration, then button at the bottom will read "Enable Desktop Effects". Clicking this button will (after asking for the root password), configure your machine to use Xgl, and then log you out so it can restart the X server.

If you later decide that you no longer want to use Xgl, you can come back to the Desktop Effects tool and disable it, which will reverse the process.

If you try to enable Xgl, but the login screen doesn't come back up successfully for some reason, you can use the command gnome-xgl-switch --disable-xgl as root to disable Xgl from the command line. (You will probably also need to do rcxdm restart to restart X and the login screen.)

Using and Configuring Compiz

Compiz is the window manager and compositing manager for Xgl that provides all of the visual effects associated with Xgl.

Using Compiz with the GNOME desktop

If you were previously using metacity as your window manager in GNOME (the default setting), you will automatically be switched to compiz when you log in after enabling Xgl. Compiz defaults to using most of the same keybindings and mouse bindings as metacity for operations like "move window", "maximize", etc. If you have changed your metacity keybindings in the "Shortcuts" control panel, you will need to go back and change them again for compiz. Likewise, if you have made changes in the "Windows" control panel (eg, to enable "sloppy focus"), you will need to make those changes again.

Using Compiz with the KDE desktop

Note: please note that Compiz support to KDE (and KDE support to Compiz) is less mature than to Gnome. You may experience glitches and crashes expecially when the window manager loads and restores previous session. If you enable compiz following this instruction you can restore the default window manager (kwin) deleting file /opt/kde3/env/kdewm.sh. If you cannot start the graphical interface press CTRL-ALT-F1 to get a text login, login and then type the command

sudo rm /opt/kde3/env/kdewm.sh

enter the root password when prompted.

Manual method
default Packages

First, make sure you are logged into KDE just like normal. Right click on the Panel. Select "Configure Panel", then "Taskbar". Make sure "Show windows from all desktops" is checked. (Currently this is required for proper functioning of the taskbar under Compiz.)

Now you need to create two files that will let KDE know that you want another window manager (compiz) instead of the default kwin. Open the kate editor as root: KDE Launch (green SUSE logo), Run Command: kdesu kate (you will be prompted for the root password). Copy and paste the following into a new text document:

/usr/bin/compiz gconf & /usr/bin/gtk-window-decorator &

Note: "gnome-window-decorator" has been replaced by "gtk-window-decorator" since openSUSE 10.2.

Save it to /usr/local/bin with the name compiz.sh This file needs to be given execute permissions. That can be done this way: KDE Launch, System, File Manager, File Manager - Super User Mode (you will be promted for the root password). Go to /usr/local/bin, right-click on compiz.sh, choose Properties, Permissions tab, check [x] Is Executable.

One more file is needed: create it following the same procedure as for compiz.sh , but save this one in /opt/kde3/env with the name kdewm.sh and copy and paste this line in it:

export KDEWM=/usr/local/bin/compiz.sh

You also need to make this file executable, in the same way as for compiz.sh. This will instruct KDE to run compiz.sh instead of kwin. Once this is done, log out of KDE and log back in. You should have functioning Xgl on your shiny new K Desktop Environment.

Configuring Compiz

The Desktop Effects tool which is used for enabling and disable Xgl can also be used to configure compiz options. Start it up as before (via the GNOME Control Center or the command line), and look at the options under the "Window Effects", "Desktop Cube", and "Other Features" tabs. For example, you can turn wobbly windows on or off, change the number of virtual desktops available on the desktop "cube", and control which corner of the screen (if any) activates the window picker.

As mentioned above, some keybindings and window management settings are configured via the GNOME "Shortcuts" and "Windows" control panels instead.

Some of the more obscure (or more recently-added) compiz options are not configurable from the Desktop Effects tool.

Older Compiz releases used Gconf, but Compiz-Quinn CVS packages available from HERE use 'csm' to configure Compiz itself, and 'gcompizthemer' to theme and style windows. Some minimal documentation is available there (and in the Compiz page in this wiki) describing what the different options mean.

Running 'compiz-manager' will give you a nice system tray icon to launch the various config tools.

</div>

Misc

Troubleshooting

Nvidia: Cursor flickers or leaves artifact trails

If you have an Nvidia card (tested with 6600GT), and your mouse cursor is flickering, you need to set the HWCursor option to "On" in your /etc/X11/xorg.conf, under the [Screen] header.

In OpenSUSE 10.1 the /etc/X11/xorg.conf file is read only and autogenerated, thus editing it not possible. However using YAST you may right click to enable driver options and enter values where possible. When an option is highlighted it is selected. Then save the configuration. You may find setting the HWCursor option on does not solve the problem, rather selecting the SWCursor eliminates the flickering. Try the option which works.

White screen/cube

If you are only seeing a white screen after logging in, chances are you are using a Xgl server version that was built with different libraries than the window manager (see here for more information).

In 10.3 disable Xgl in case you have enabled it and let Compiz run on Xorg directly. Reboot after disable

Shellscript.png su -

gnome-xgl-switch --disable-xgl

A Xgl version that works with openSUSE 10.2 is cvs_060522-39.

But it would be best to use the latest version of Xgl (and of whole xorg7.2) from http://software.opensuse.org/download/xorg72/openSUSE_10.2/


No more Xinerama support

If you had a working Xinerama-setup (one large desktop on two monitors) with xorg7.2 and it does not work anymore with Xgl, then look at this bugzilla-entry: https://bugzilla.novell.com/show_bug.cgi?id=233112

you should add +xinerama to the Xgl-start-options or install a newer xgl package.


KDE Users

If you choose KDE as the default desktop during your installation of SUSE Linux 10.1 you may have some problems. The just before the logon manager is about to start you get dumped back to the first console. dmesg tells you "X server startup timeout, terminating". If you have both gnome and kde installed, edit your /etc/sysconfig/displaymanager and set the DISPLAYMANAGER="gdm".



Using Xgl on openSUSE (A way 2) in common KDE

Well, I got my laptop on Friday two weeks ago. I must say, the HP Compaq nx6310 was definitely a good choice. The only thing I don’t really like is the TrueLife screen. I don’t like it because of the glare, but I suppose I’ll get used to it. Anyway, one of the first things I did was partition the drive, and install openSUSE 10.2, 64bit version. The installation went smoothly and everything (including WLAN) worked perfect. In this workshop I want to explain the installation of the 3D cube using XGL and Compiz.

Install XGL and Compiz

The packages you need are available on the openSUSE DVD. Just use Yast ,search for xgl compiz gconf and install it. How easy can it be?

Hack the configuration files

Unfortunately we have to hack the configuration files a little bit. No worry, it is easier like it seems. Let’s start with the file displaymanager. Get root permissions and change the following lines using your favorite editor like explained below:

su
cd /etc/sysconfig
vi displaymanager

Search

DISPLAYMANAGER=
DISPLAYMANAGER_XSERVER=

and replace on

DISPLAYMANAGER="xgl"
DISPLAYMANAGER_XSERVER="xgl"

Also Search

DISPLAYMANAGER_XGL_OPTS=

and replace on

DISPLAYMANAGER_XGL_OPTS="-accel glx:pbuffer -accel xv:fbo"

Editing xorg.conf

Next we have to edit the X-Org configuration file like this:

cd cd /etc/X11/ vi xorg.conf

Add the following line in the Section “Device”

Option "NoFlip" "True"

Section "Device"
  BoardName    "GeForce 7800 GT"
  BusID        "4:0:0"      (try lspci | grep VGA. Last set of  numbers is your BusID)
  Driver       "nvidia"
  Identifier   "Device[0]"
  VendorName   "NVidia"
  Option       "NoFlip" "True"
EndSection

and add the next line to the Section "Extensions"

Option "Composite" "off"


Section "Extensions"
   Option "Composite" "off"
EndSection

Delete temporary file and create a symbolic link

We are close to the end. Let’s delete the following temporary file and add a symbolic link like this:

rm   /var/X11R6/bin/X
ln -s /usr/bin/Xgl  /var/X11R6/bin/X

Use Compiz as Window Manager

Just create a file (start-compiz) with the following content:

[Desktop Entry]

Encoding=UTF-8

Exec=compiz --replace decoration wobbly fade minimize cube rotate zoom scale move resize place   switcher & gnome-window-decorator &

 

GenericName[en_US]=

StartupNotify=false

Terminal=false

TerminalOptions=

Type=Application

X-KDE-autostart-after=kdesktop

and store it in the above mentioned directory /home/<user>/.kde/Autostart/ Remark: Please double-check if the new was (start-compiz) is owned by the user and not by root. Otherwise change ownership like this:

cd /home/<user>/.kde/Autostart
chown <user>:users start-compiz

After rebooting your notebook you should be able to see the cube. Good luck! --Strelok-ac 14:42, 19 June 2007 (UTC)


See Also


External Links


opensuse-xgl-settings

Visit #Xgl at irc.freenode.org for more support.