Cannot enable ForceCompositionPipeline (VNC X.org's extension conflict with NVIDIA drivers)

$ nvidia-settings --assign CurrentMetaMode="HDMI-0: 1920x1080 { ForceCompositionPipeline = On }"


ERROR: Error resolving target specification '' (No targets match target specification), specified in assignment 'CurrentMetaMode=HDMI-0: 1920x1080 { ForceCompositionPipeline = On }'.

$ xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
DVI-I-0 disconnected primary (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 290mm
   1920x1080      60.0*+   59.9     50.0     60.1     60.0     50.0
   1680x1050      60.0
   1600x900       60.0
   1440x900       59.9
   1400x1050      60.0
   1280x1024      60.0
   1280x800       59.8
   1280x720       60.0     59.9     50.0
   1152x864       60.0
   1024x768       60.0
   800x600        60.3
   720x576        50.0
   720x480        59.9
   640x480        59.9     59.9
DP-0 disconnected (normal left inverted right x axis y axis)
DVI-D-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)

NVIDIA drivers 346.47, GTX 660, FullHD monitor connected via HDMI.

Please generate and attach an nvidia-bug-report.log.gz file.

Here it is.

I guess it has something to do with my VNC screen, but then I’m confused as to how I can use VNC and NVIDIA simultaneously.
nvidia-bug-report.7z (171 KB)

Aha, here’s the problem:
[ 10.236] (EE) Not enabling extension NV-CONTROL: maximum number of events or errors exceeded.

The X11 protocol has a limit to the number of errors and events combined, and loading both the VNC module and the NV-CONTROL extension ends up trying to allocate too many. Without the NV-CONTROL extension, nvidia-settings can’t communicate with the X driver.

So, it’s actually a bug/limitation in the X.org server? Damn. :-(

I noticed this a long time ago, that VNC module + Nvidia driver exceed the X limit on extensions. That’s why I patch my X with this:

diff -ur xorg-server-1.15.0.orig/hw/xfree86/common/xf86Extensions.c xorg-server-1.15.0/hw/xfree86/common/xf86Extensions.c
--- xorg-server-1.15.0.orig/hw/xfree86/common/xf86Extensions.c	2013-12-27 18:38:52.000000000 +0100
+++ xorg-server-1.15.0/hw/xfree86/common/xf86Extensions.c	2013-12-29 14:27:01.165218871 +0100
@@ -61,13 +61,6 @@
 	&noXFree86VidModeExtension
     },
 #endif
-#ifdef XFreeXDGA
-    {
-	XFree86DGAExtensionInit,
-	XF86DGANAME,
-	&noXFree86DGAExtension
-    },
-#endif
 #ifdef XF86DRI
     {
         XFree86DRIExtensionInit,
diff -ur xorg-server-1.15.0.orig/mi/miinitext.c xorg-server-1.15.0/mi/miinitext.c
--- xorg-server-1.15.0.orig/mi/miinitext.c	2013-12-15 08:48:09.000000000 +0100
+++ xorg-server-1.15.0/mi/miinitext.c	2013-12-29 14:27:01.165218871 +0100
@@ -298,7 +298,6 @@
 #endif
 #ifdef XV
     {XvExtensionInit, XvName, &noXvExtension},
-    {XvMCExtensionInit, XvMCName, &noXvExtension},
 #endif
 #ifdef XSELINUX
     {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension},

XvMC and DGA are two extensions you will definitely not be missing ever, and disabling them frees up slots for all the Nvidia extensions. It used to be possible to disable XvMC and DGA in xorg.conf, but at some point they were made an integral part of X, so now patching is required.

Thanks a lot for this patch, but I guess I’ll just disable VNC, 'cause I enabled it just for fun.

I was able to disable the DGA extension with the following entry in /etc/X11/xorg.org:

Section “Extensions”
Option “XFree86-DGA” “Disable”
EndSection

That was enough to allow the VNC module and the NV-CONTROL extension to load properly.

Presumably, XVideo-MotionCompensation below is the “XvMC” referred to in Gusar’s post. I did not try to disable it.

From /var/log/Xorg.0.log:
.
.
.
[1985034.085] Initializing built-in extension XVideo-MotionCompensation
[1985034.085] Initializing built-in extension SELinux
[1985034.085] Initializing built-in extension XFree86-VidModeExtension
[1985034.085] Initializing built-in extension XFree86-DGA
.
.
.
[1985034.082] (**) Extension “XFree86-DGA” is disabled
.
.
.

For reference, I’m using CentOS 6.6

Xorg -version

X.Org X Server 1.15.0
Release Date: 2013-12-27
X Protocol Version 11, Revision 0
Build Operating System: c6b8 2.6.32-220.el6.x86_64
Current Operating System: Linux gw-sclhs-bypass 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue Jun 9 20:57:37 UTC 2015 x86_64
Kernel command line: ro root=/dev/mapper/vg_centos-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg_centos/lv_swap rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M rd_LVM_LV=vg_centos/lv_root KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet nouveau.modeset=0 rdblacklist=nouveau usbcore.autosuspend=-1 usbcore.initial_descriptor_timeout=10000
Build Date: 18 June 2015 11:45:14AM
Build ID: xorg-x11-server 1.15.0-26.el6.centos.0.1
Current version of pixman: 0.32.4