From Compiz
Original guide by RYX
Contributions by cyberorg
Revised and edited by AMGeeX
Since many people seem to be having problems with this, here is a complete guide on how to install the latest closed-source, binary nvidia drivers and compile the latest Compiz. No XGL/AIGLX is needed for this to work.
Contents |
[edit] Important
- Please be sure to backup all files that are going to be edited as there is no warranty that this will work on your particular computer.
- Whenever a line starts with sudo and you have no sudo installed on your system, simply enter the command(s) following the sudo as root.
- For distribution specific instructions please visit the Documentation Central
[edit] Download the source and drivers
- Download Compiz from compiz.org, versions 0.4 (stable) or 0.5 (development) are highly recommended.(at compiz.org 0.6.2 and 0.7.6 are offered???)
- Download the latest nvidia drivers (100.14.11 at the moment of revising this guide) for your system architecture from nvidia.com.
[edit] Install the needed packages
Now you will need to install the necessary packages to be able to build Compiz from source. The package names can vary from distribution to distribution. If your distribution is not listed here then please post the packages you need on the forums.
Debian/Ubuntu:
Type this into a terminal to get all the dependencies installed:
sudo aptitude install build-essential libxcomposite-dev libpng-dev libsm-dev libxrandr-dev libxdamage-dev libxinerama-dev libstartup-notification0-dev libgconf2-dev libgl1-mesa-dev libglu1-mesa-dev libgtk2.0-dev libwnck-dev libmetacity-dev librsvg2-dev libdbus-1-dev libdbus-glib-1-dev libfuse-dev libgnome-desktop-dev libgnome-window-settings-dev curl autoconf automake automake1.9 libtool intltool libxslt1-dev libdecoration0 libdecoration0-dev
Now type this to get the necessary packages to build a kernel interface for the nvidia driver:
sudo aptitude install linux-headers-`uname -r` xserver-xorg-dev
OpenSUSE:
Install the following packages with your package manager:
control-center2-devel freeglut-devel gcc-c++ gconf2-devel gtk2-devel intltool libdrm-devel librsvg-devel libwnck-devel metacity pango-devel update-desktop-files xorg-x11-devel perl-XML-Parser
[edit] Remove the old nvidia driver
This step only applies for those who have an older version of the nvidia driver installed from your distribution's repositories. To check what version of the nvidia driver you have installed now type this into a terminal:
glxinfo | grep "OpenGL version string:"
This should return something like this:
OpenGL version string: 2.1.0 NVIDIA 96.31
Where the last number is the driver version. If your version is 96.31 or higher then you can skip this step.
Ubuntu:
To uninstall the current driver type this into a terminal:
sudo aptitude purge nvidia-glx
Now edit the /etc/default/linux-restricted-modules configuration file and add the following:
DISABLED_MODULES="nv"
Now reboot your computer.
[edit] Install the latest nvidia driver
Now you will install the nvidia driver you downloaded earlier. You should print this step of the guide because you will be using a terminal interface only from here on. The first thing you need to do is stop the currently running X-Server.
Close all applications and press Ctrl+Alt+F1 to switch to a non-X terminal (at this point you can still go back to you X session by pressing Ctrl+Alt+F7). Now log in with your username and password, then stop the currently running X-server by typing the following:
sudo /etc/init.d/gdm stop
Now you must navigate to the directory where you downloaded the nvdidia driver. Once there type the following:
sudo sh NVIDIA-Linux-x86-1.0-9631-pkg1.run
Be sure to replace the x86 and the 9631 with the appropriate architecture and version number for the driver you downloaded.
Now follow the instructions; if it complains about not finding a matching kernel-interface choose to download a new one. It will most probably fail and create a matching interface of its own. If it asks you to modify your xorg.conf, choose Yes.
Now reboot your system by typing:
sudo shutdown now -r
If you see the nvidia logo on a gray background after rebooting it means that the driver is running and installed properly.
[edit] Modify your xorg.conf file
Now you have to add a few lines to your xorg.conf file. This is necessary for Compiz to run properly. Failure to do this will result in no eye candy for you. There are two ways of doing this:
The easy way is to enter the following commands into a terminal:
sudo nvidia-xconfig --composite sudo nvidia-xconfig --render-accel sudo nvidia-xconfig --allow-glx-with-composite sudo nvidia-xconfig --add-argb-glx-visuals
Now press Ctrl+Alt+Backspace to restart your X-server or reboot.
NOTE: If you use the above method, please check your xorg.conf file after you reboot and make sure the following lines are in the Driver section and NOT under the Screen section!
Option "RenderAccel" "true" Option "AllowGLXWithComposite" "true"
The hard way is editing your xorg.conf file manually, but it isn't that hard. Open up a terminal and type the following:
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf-backup sudo gedit /etc/X11/xorg.conf
Find this section:
Section "Module" Load "i2c" Load "bitmap" ... Load "type1" Load "vbe" EndSection
Comment out dri and GLcore (if present), like this:
# Load "dri" # Load "GLcore"
Make sure the glx module is loaded, like this:
Load "glx"
Find this section (your values may vary) :
Section "Device"
Identifier "NVIDIA Corporation NV40 [GeForce 6800]"
Driver "nvidia"
EndSection
Add the following lines below "Driver":
Option "RenderAccel" "true" Option "AllowGLXWithComposite" "true"
Find this section (your values may vary) :
Section "Screen"
Identifier "Default Screen"
Device "NVIDIA Corporation NV40 [GeForce 6800]"
Monitor "SyncMaster"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1440x900"
EndSubSection
EndSection
Make sure DefaultDepth is set to 24, if it isn't already, then add the following lines below "EndSubSection" or above the first "SubSection":
Option "AddARGBGLXVisuals" "true" Option "DisableGLXRootClipping" "true"
Save the file and exit the text editor. Now restart the X-server by pressing Ctrl+Alt+Del or reboot.
[edit] Compile and install Compiz
Now you are ready to get Compiz running. First open up a terminal and navigate to the directory where you downloaded the Compiz source tarball and extract its contents by typing the following:
tar xvf compiz-0.5.0.tar.gz
This will create a compiz-0.5.0 directory; change to it in your terminal and type this:
./configure --prefix=/usr --enable-librsvg --enable-gtk && make && make install
If no errors whatsoever are reported then all went well and Compiz is installed.
For more information please refer to the Compiling Page.
[edit] Test the installation
Now you will test the installation. To test if things worked, type the following line into a terminal:
compiz --replace gconf & gtk-window-decorator --replace &
If nothing weird happens its almost certain that Compiz is running ok, so you can proceed to the next step.
[edit] Configure Compiz
If nothing unexpected happened on the previous step it means Compiz is up and runing in your computer. You can setup Compiz and its plugins using the gconf-editor tool. There are other tools for setting up Compiz, but they are still in development. If you are using Ubuntu, gconf-editor is already installed, most probably. If it isn't then you can installing by typing the following command into a terminal:
sudo apt-get install gconf-editor
Once you've started the gconf-editor you can navigate to /apps/compiz. This is where the Compiz configuration keys can be found. Those for the plugins are under /apps/compiz/plugins/. If, by any chance you don't find any keys under the plugins folder, you can reload them. Open up a terminal and navigate to the source compiz directory, compiz-0.5.0 on this guide, and run the following command:
gconftool-2 --install-schema-file=plugins/compiz.schemas gconftool-2 --install-schema-file=gtk/window-decorator/gwd.schemas.in
Now navigate to /apps/compiz/general/allscreen/options/ and right click on the "active_plugins" key; choose to edit it. Add these values in the given order:
gconf,decoration,wobbly,fade,minimize,cube,switcher,move,resize,place,rotate,zoom,scale,dbus,png,svg
Alternatively you can use this command if you don't want to use the gconf-editor; type it into a terminal:
gconftool-2 -s /apps/compiz/general/allscreens/options/active_plugins "[gconf,decoration,wobbly,fade,minimize,cube,switcher,move,resize,place,rotate,zoom,scale,dbus,png,svg]" -t list --list-type=string
You might also want to browse through the keys in gconf-editor to see what other options exist and play with them to see what they do; feel free to ask about them in the forums.
[edit] Create the startup script
To auto-start Compiz when you boot you can use this script:
#!/bin/sh # Compiz startup script for version 0.4 or 0.5 compiz --replace gconf & gtk-window-decorator --replace &
You can use any of these alternatives of the first line, use whatever works best for you:
compiz --replace --loose-binding gconf & compiz --replace --indirect-rendering gconf & compiz --replace --loose-binding --indirect-rendering gconf &
To save the script open a terminal and type:
sudo gedit /usr/bin/gocompiz
Copy & paste the above script into the editor (paste with right-click menu) and save the file. Make it executable by typing this into a terminal:
sudo chmod a+x /usr/bin/gocompiz
Now you can start compiz by typing gocompiz into a terminal. Alternatively you can use Gandalfn's Gnome Compiz Manager, but that isn't covered in this guide.
NOTE: As of version 0.3.6 KDE users can now use kde-window-decorator instead of gtk-window-decorator to have KDE window decorations!
[edit] You're ready!
We hope you have liked this tutorial and don't feel treated like a total idiot. We tried to make it as understandable as possible for all audiences. If you have comments, questions, additions or corrections please post them in the forum. Hopefully, with everyone's help, this tutorial can be extended for ATI card users and more distributions. Thank you for your patience!
Cheers,
The Compiz Community Team!
