PDA

View Full Version : Set up your nVidia card for a composited desktop


Jupiter
May 23rd, 2007, 08:42 PM
This information is contributed by Jupiter and djdoo

First, keep in mind that the best way to get a nice graphical experience is to use your monitors native resolution.
It is also recommended that you verify that you have direct rendering enabled before you start to setup composite
desktop. In a terminal you can type this.
glxinfo | grep direct
The response should look like this.
direct rendering: Yes
If the response is "No" then direct rendering is not enabled and this guide will try and get you on your way.
If you still experience problems with direct rendering after following this guide please keep in mind that
this is only a general guide. The best source to get anything setup properly in your particular distribution
of Linux is to go to the distributions documentation and/or that distributions forum.

With driver 9755 and older or 9631 legacy(no info about 7185) under the hood...
In your /etc/X11/xorg.conf you should have the following options in order to run composite desktop.
Lines in blue are optional but have been found to help either quality, performance or stability.

Under:
Section "ServerLayout"
Option "AIGLX" "False"

Under:
Section "Module"
Load "glx"
# Load "glcore" ## comment this line if it is there
# Load "dri" ## comment this line if it is there

Under:
Section "Device"
Option "AddARGBGLXVisuals" "True"
Option "AllowGLXWithComposite" "True"
Option "DisableGLXRootClipping" "True"
Option "RenderAccel" "True" ## not really needed with newer drivers as it is enabled by default in newer drivers
Option "DamageEvents" "True"
Option "UseEvents" "False"
Option "TripleBuffer" "True"
Option "BackingStore" "True" ## [Use this one with caution it may NOT work on all systems (freezes when load
beryl-manager) but give it a try because it helps performance] It can also break Xinerama

Under:
Section "Extensions"
Option "Composite" "Enable"

Under:
Section "Screen"
DefaultDepth 24
-----------------------------------------------------------------------------------------------------------------------------------------
Legend:
Option "AllowGLXWithComposite" "boolean"
Enables GLX even when the Composite X extension is loaded. ENABLE AT YOUR OWN RISK. OpenGL applications will not display correctly in many circumstances with this setting enabled.

This option is intended for use on X.Org X servers older than X11R6.9.0. On X11R6.9.0 or newer X servers, NVIDIA's OpenGL implementation interacts properly by default with the Composite X extension and this option should not be needed. However, on X11R6.9.0 or newer X servers, support for GLX with Composite can be disabled by setting this option to False.

Default: false (GLX is disabled when Composite is enabled on X servers older than X11R6.9.0).

Option "AddARGBGLXVisuals" "boolean"
Adds a 32-bit ARGB visual for each supported OpenGL configuration. This allows applications to use OpenGL to render with alpha transparency into 32-bit windows and pixmaps. This option requires the Composite extension. ENABLE AT YOUR OWN RISK. Some OpenGL applications may display incorrectly when this setting is enabled. Default: No visuals are added.

Option "DisableGLXRootClipping" "boolean"
If enabled, no clipping will be performed on rendering done by OpenGL in the root window. This option is deprecated. It is needed by older versions of OpenGL-based composite managers that draw the contents of redirected windows directly into the root window using OpenGL. Most OpenGL-based composite managers have been updated to support the Composite Overlay Window, a feature introduced in Xorg release 7.1. Using the Composite Overlay Window is the preferred method for performing OpenGL-based compositing.

Option "RenderAccel" "boolean"
Enable or disable hardware acceleration of the RENDER extension. Default: hardware acceleration of the RENDER extension is enabled. "this applies to newer driver only"

Option "DamageEvents" "boolean"
Use OS-level events to efficiently notify X when a client has performed direct rendering to a window that needs to be composited. This will significantly improve performance and interactivity when using GLX applications with a composite manager running. It will also affect applications using GLX when rotation is enabled. This option is currently incompatible with SLI and MultiGPU modes and will be disabled if either are used. Enabled by default.

Option "UseEvents" "boolean"
Enables the use of system events in some cases when the X driver is waiting for the hardware. The X driver can briefly spin through a tight loop when waiting for the hardware. With this option the X driver instead sets an event handler and waits for the hardware through the poll() system call. Default: the use of the events is disabled.

Option "TripleBuffer" "boolean"
Enable or disable the use of triple buffering. If this option is enabled, OpenGL windows that sync to vblank and are double-buffered will be given a third buffer. This decreases the time an application stalls while waiting for vblank events, but increases latency slightly (delay between user input and displayed result).

-----------------------------------------------------------------------------------------------------------------------------------------
That is what is recommended for using composite desktop. For further documentation on these settings please
refer to the readme file of the particular Nvidia driver you are using. Here is the readme for driver 9755
http://us.download.nvidia.com/XFree86/L ... dix-d.html (http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9755/README/appendix-d.html)

If you would like to make further changes to improve the graphics performance here is a few suggestions.

If you look in your computer bios and see a MTRR setting, make sure it is set to "DISCRETE"

If you have an AGP card add the following options in your modprobe.conf file or any name this file has in your distro:

options nvidia NVreg_EnableAGPSBA=1 NVreg_EnableAGPFW=1 NVreg_EnableBrightnessControl=1 NVreg_DevicesConnected=1 NVreg_VbiosFromROM=1 NVreg_SaveVBios=1 NVreg_SoftEDIDs=0 NVreg_VideoMemoryTypeOverride=0 NVreg_NvAGP=3 NVreg_ReqAGPRate=8->(8=for 8X AGP, 4=for 4X AGP)

Copy them as they are. They are typed correctly!

djdoo
August 23rd, 2007, 06:31 AM
This information is contributed by Jupiter

And me! ;)

Only a note:
Just do NOT use the Option "DisableGLXRootClipping" "True"
Unless you have an g86 GPU card(GF 8500-8600etc) and unfortunately have to use 100.14.11 driver...

Cause it produces blinking screen stuff, low performance, sluggish operation and sometimes lockups too.

MemoryDump
August 23rd, 2007, 03:41 PM
And me! ;)

Only a note:
Just do NOT use the Option "DisableGLXRootClipping" "True"
Unless you have an g86 GPU card(GF 8500-8600etc) and unfortunately have to use 100.14.11 driver...

Cause it produces blinking screen stuff, low performance, sluggish operation and sometimes lockups too.
would this affect me? I have a GeForce 7800 GS.. thxs

djdoo
August 24th, 2007, 01:13 AM
@MemoryDump:

If you use 100.14.11 driver just remove it and install the 9755 one.
Then remove that option from your xorg.conf.
And yes it affects all systems as far as I know...

billydv
August 25th, 2007, 05:07 AM
Jupiter, I am trying to understand your guide but Im a bit confused, Until now aiglx "true" was the way we setup for beryl or compiz, is it now that we need to set it to false? Also, I would like to know about the arbglxvisuals, is it better in or out? I am running amd64 gentoo and have an asus a8n32sli deluxe with an evga8800gts card.

MemoryDump
August 26th, 2007, 01:30 AM
@MemoryDump:

If you use 100.14.11 driver just remove it and install the 9755 one.
Then remove that option from your xorg.conf.
And yes it affects all systems as far as I know...
I guess my reply to this post got yanked or lost.. weird..

anyways.. are you suggesting I downgrade my drivers since I believe I have the latest released drivers.

pigeon
September 18th, 2007, 02:12 PM
I thought I'd share my working setup here.

My laptop has an nvidia 7400 Geforce Go, running compiz, with suspend/resume (suspend-to-ram S3) and changing tty working. I'm on Debian testing, using shame's packages, at the moment kernel 2.6.22 SMP, nvidia driver 100.14.11.

Firstly, my /etc/modprobe.d/nvidia:


options nvidia NVreg_SoftEDIDs=0 NVreg_SaveVBios=1



For xorg.conf, the significant part would be:


Section "Device"
Identifier "NVIDIA GeForce Go 7400"
Driver "nvidia"
Option "NvAGP" "1"
Option "AddARGBGLXVisuals" "true"
Option "AllowGLXWithComposite" "true"
Option "RenderAccel" "true"
Option "DamageEvents" "true"
Option "UseEvents" "false"
Option "BackingStore" "true"
EndSection


And perhaps also:

Section "Extensions"
Option "Composite" "true"
Option "RENDER" "true"
Option "DAMAGE" "true"
EndSection


In /etc/default/acpi-support (from the acpi-support package), I have these changes:

SAVE_VBE_STATE=false
POST_VIDEO=false

(These seem to get nvidia suspend/resume working in general as well, not just compiz)

For compiz's settings, I have sync to vblank disabled. I noticed if I have it enabled, compiz tends to get stuck trying to sync when I switch to a virtual tty and back, giving me a black screen. Instead, I only set sync to vblank in nvidia settings, which works well.

I notice using --indirect-rendering seems to also fix the black screen issue, but it causes Xorg to get stuck when I quit compiz. Thereforce I don't use it.

I also need to run compiz with --loose-binding. If not, some animations would become sluggish, especially when I have GL apps running at the same time.

Hope these are useful.

irfan
September 19th, 2007, 11:12 AM
Jupiter:
Is it still recommended to use 1.0-9755 driver, or 100.14.19 (http://www.nvidia.com/object/linux_display_ia32_100.14.19.html) is beter?

reez0105
September 19th, 2007, 01:28 PM
hm....100.14.19 version working great with my 7950gs

barcajunior
January 5th, 2008, 05:31 PM
100.14.19 version is awesome.