HOWTO nVidia GL Desktop Effects
From Gentoo Linux Wiki
|
Contents |
[edit] Introduction
This short guide will describe how to use nVidia's drivers to create an OpenGL accelerated desktop environment similar to AIGLX. Currently, driver revision 9631 or higher is required for stable releases of Compiz and Beryl.
[edit] Requirements
- GeForce 2 MX or GeForce 3 and newer
- XOrg 7.1 or above
- proprietary Nvidia drivers
- Desktop Color Depth of 24 bits
[edit] Installation
[edit] Installing nVidia-drivers
See the HOWTO_nVidia_Drivers
[edit] Configuring nVidia-drivers and X
A few options will have to be inserted into your X configuration file. These will need to be added to your existing sections instead of creating new ones if they exist.
| File: /etc/X11/xorg.conf |
Section "Module"
...
# "dri" and "GLcore" should be commented out or absent
# Load "GLcore"
# Load "dri"
# The "glx" entry should exist as shown:
Load "glx"
...
EndSection
Section "Device"
Option "AddARGBGLXVisuals" "true"
# This option must be either undeclared or
# false, in order to avoid periodic short-term
# freezes on beryl and other OpenGL intensive
# programs
Option "UseEvents" "false"
EndSection
Section "Extensions"
Option "Composite" "enable"
EndSection
|
To ensure the compositing extension was loaded, run:
# xdpyinfo | grep Composite
and ensure it shows up.
Next, select nVidia's OpenGL implementation:
# eselect opengl set nvidia
At this point, the easiest way to set everything into place is to restart X. You can kill X (cntl-alt-backspc), then remove the nVidia module (modprobe -r nvidia), then restart X (startx / startkde / startxfce4 ...). If that's not possible, or you don't know how to then restart your computer (just like Windows huh?). Your configuration should now be complete. Alternatively, logout and switch to a command line terminal press Ctrl+Alt+F2 and login as root.
# /etc/init.d/xdm stop # rmmod nvidia && modprobe nvidia # /etc/init.d/xdm start
Take also care to add your user to video group, otherwise you may have a lot of troubles:
# usermod -aG video <username>
[edit] Additional Configuration
For some additional tuning of the nvidia-driver see the compiz-fusion HowTo.Nvidia-HowTo
[edit] Installing a Compositing Window Manager
GL compositing does absolutely nothing without a proper GL window manager to use its features such as compiz-fusion, or Metacity version 2.18 (for Gnome). Please see those pages for more information.
[edit] Troubleshooting
[edit] Problems not listed here
Note: problems not listed here may be found on the forums, if all else fails trying the latest driver from the Nvidia website (nvidia.com) is usually a good fix (although the whole point of gentoo is to use portage...)
[edit] Periodic short-term freeze
If you have set up UseEvents option on /etc/X11/xorg.conf file, and you are experiencing full-desktop short-term freezes on beryl, compiz or other OpenGL applications, then you should set the next option:
| File: /etc/X11/xorg.conf |
Section "Device"
# This option must be either undeclared or
# false, in order to avoid periodic short-term
# freezes on beryl and other OpenGL intensive
# programs
Option "UseEvents" "false"
EndSection
|
[edit] Black Window Bug
nVidia's current implementation of the GLX_EXT_texture_from_pixmap extension contains a bug up to driver revision 9755 which creates black windows after video memory has been exhausted. The best way to recreate it is to start a video memory intensive application such as Blender or World of Warcraft, then open a Firefox/Mozilla browser window. The stable 169-* series of nvidia-drivers should have this bug fixed. (note: as of 173.14.05 it is (again?) the same problem)
[edit] Temporary Fix
Setting the rendering path to copy will bypass the TFP features of the nVidia driver and bypass this problem. This comes at a considerable performance hit, however, and should only be used in extreme situations and where your current graphics card/driver does not support TFP operations.
Original post:
"This is a shortcoming of the current implementation of GLX_EXT_texture_from_pixmap in the drivers. When video RAM has been exhausted, the driver does not behave well (you get blank windows). TurboCache? memory is currently cannot be used with GLX_EXT_texture_from_pixmap, so these problems will be especially noticeable on these parts. We're working on improving these cases."
[edit] Quick way to temporary fix the black window bug
I found that a possible solution for this problem, is to add the argument --indirect-rendering to the compiz init command or script. I know it's not the best way to use Compiz, however it works, and it solves the awful black screen bug. A working Compiz init may be:
$ compiz --replace --indirect-rendering decoration wobbly fade minimize cube rotate zoom scale move resize place switcher &
[edit] White Screen Problem
Check that the following is set at the command line:
# eselect opengl set nvidia
This problem is user-centric, not system wide. Set up an admin user and use that only for administration. Then set up an ordinary user. If the ordinary user gets the white screen, back up any user data via terminal if needed. Then remove the user and recursively delete the users home directory. Then re-enter the user.
[edit] Running OpenGL Programs with CPU at 100% Usage
You should install nvidia-settings, then set SyncToVBlank=1 in the X-Win.
# emerge nvidia-settings
After start X-Win, open a terminal window and use the following command:
# nvidia-settings --assign="SyncToVBlank=1"
You may add this into /etc/X11/xinitrc.
[edit] Links and Acknowledgements
- Compiz-Fusion Homepage
- List of chips by the latest 171.* nvidia-driver series (GeForce 6, 7, 8)
- List of chips supported by the legacy 96.* nvidia-driver series (GeForce 2,3,4,5,6,7)

