X with nouveau driver, 2 nvidia cards, 4 monitors, does not use all monitors

Bug #1597437 reported by Martin on 2016-06-29
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
xserver-xorg-video-nouveau (Ubuntu)
Medium
Unassigned

Bug Description

Ubuntu 16.04 with two identical nvidia cards and four identical LG monitors. At the graphical login screen only the first 3 monitors appear alive (i.e. have backgrounds and the mouse can move to them). A pop-up appears:

"Could not switch the monitor configuration" (bold text with do-not-enter icon)
"could not set the configuration for CRTC 64" (normal text)

After logging in (gnome flashback Metacity session) the same 3 monitors are alive and the same pop-up appears.

Using Applications > System Tools > System Settings > Displays,
the 4th monitor is shown in grey and when clicking it, it shows that the slider is off. When turning it to On (leaving default resolution and rotation) and clicking Apply

"The selected configuration for displays could not be applied" (bold text with do-not-enter icon)
"could not set the configuration for CRTC 64" (normal text)

a few seconds later (if the first one is not closed) another pop up with do-not-enter icon:

"Failed to apply configuration: %s"
"Timeout was reached"

or trying again, if the first pop-up is closed within a few seconds, the second one is

"Failed to apply configuration: %s"
"GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._gsd_2drr_2derror_2dquark.Code2: could not set the configuration for CRTC 64"

...and the Displays GUI makes it look like the 4th monitor is enabled but it is still blank.

At the time of doing this, /var/log/Xorg.0.log shows:
[ 96283.251] resize called 7680 1080
[ 96283.299] Cannot do multiple crtcs without X server dirty tracking 2 interface
[ 96283.299] randr: failed to set shadow slave pixmap
[ 96283.300] (EE) NOUVEAU(G0): failed to set mode: No space left on device

I have also tried this with xrandr command line:

$ xrandr --output DVI-I-1-4 --right-of DVI-I-1-3 --auto
xrandr: Configure crtc 3 failed

...and the Xorg.0.log at this time is almost the same as above, plus the (I guess) fall back resizing to 3 monitors (5760x1080):

[ 96645.224] Cannot do multiple crtcs without X server dirty tracking 2 interface
[ 96645.224] randr: failed to set shadow slave pixmap
[ 96645.224] (EE) NOUVEAU(G0): failed to set mode: No space left on device
[ 96645.227] resize called 0 0
[ 96645.227] -22
[ 96645.228] resize called 0 0
[ 96645.228] -22
[ 96645.229] resize called 7680 1080
[ 96645.281] resize called 5760 1080

I have previously tried to get around this with /etc/X11/xorg.conf with various Xinerama or ZaphodHeads settings but at the moment (of starting this "ubuntu-bug xserver-xorg-core" report) I have no xorg.conf and no ~/.config/monitors.xml. Obviously monitors.xml has been re-created as I test the Displays GUI to describe the pop-ups above, but it was not there at login.

The 2-connector video cards to all four monitors are connected with DVI cables. The monitors are LG E2240TI, the video cards are (lspci):

01:00.0 VGA compatible controller: NVIDIA Corporation GF114 [GeForce GTX 560 Ti] (rev a1)
02:00.0 VGA compatible controller: NVIDIA Corporation GF114 [GeForce GTX 560 Ti] (rev a1)

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: xserver-xorg-core 2:1.18.3-1ubuntu2.2
ProcVersionSignature: Ubuntu 4.4.0-28.47-generic 4.4.13
Uname: Linux 4.4.0-28-generic x86_64
.tmp.unity_support_test.0:

ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
CurrentDesktop: GNOME-Flashback:Unity
Date: Wed Jun 29 12:21:13 2016
DistUpgraded: 2016-06-23 10:16:50,641 DEBUG Running PostInstallScript: './xorg_fix_proprietary.py'
DistroCodename: xenial
DistroVariant: ubuntu
DkmsStatus:
 virtualbox, 5.0.18, 4.4.0-24-generic, x86_64: installed
 virtualbox, 5.0.18, 4.4.0-28-generic, x86_64: installed
ExtraDebuggingInterest: Yes, including running git bisection searches
GraphicsCard:
 NVIDIA Corporation GF114 [GeForce GTX 560 Ti] [10de:1200] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: ZOTAC International (MCO) Ltd. GF114 [GeForce GTX 560 Ti] [19da:1665]
 NVIDIA Corporation GF114 [GeForce GTX 560 Ti] [10de:1200] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: ZOTAC International (MCO) Ltd. GF114 [GeForce GTX 560 Ti] [19da:1665]
InstallationDate: Installed on 2015-11-12 (229 days ago)
InstallationMedia: Ubuntu-Server 15.10 "Wily Werewolf" - Release amd64 (20151021)
MachineType: System manufacturer System Product Name
ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-4.4.0-28-generic root=UUID=1887ea54-959f-479e-9f3f-d1e5da317805 ro nomdmonddf nomdmonisw
SourcePackage: xorg-server
UpgradeStatus: Upgraded to xenial on 2016-06-23 (6 days ago)
dmi.bios.date: 02/11/2011
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1305
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: SABERTOOTH P67
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr1305:bd02/11/2011:svnSystemmanufacturer:pnSystemProductName:pvrSystemVersion:rvnASUSTeKComputerINC.:rnSABERTOOTHP67:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: System Product Name
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer
version.compiz: compiz 1:0.9.12.2+16.04.20160526-0ubuntu1
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.67-1ubuntu0.16.04.1
version.libgl1-mesa-dri: libgl1-mesa-dri 11.2.0-1ubuntu2
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 11.2.0-1ubuntu2
version.xserver-xorg-core: xserver-xorg-core 2:1.18.3-1ubuntu2.2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.10.1-1ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.7.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20160325-1ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.12-1build2
xserver.bootTime: Tue Jun 28 09:54:28 2016
xserver.configfile: default
xserver.logfile: /var/log/Xorg.0.log
xserver.version: 2:1.18.3-1ubuntu2.2
xserver.video_driver: nouveau

Martin (marthter) wrote :
Martin (marthter) wrote :

This Fedora bug https://bugzilla.redhat.com/show_bug.cgi?id=1307204 looks to me to be the same issue, and says that the cause is

'The problem is that xorg 1.17 or 1.18 replaced "HAS_DIRTYTRACKING2" with "HAS_DIRTYTRACKING_ROTATION" in pixmap.h and the old version of xf86-video-ati still looks for HAS_DIRTYTRACKING2. The newest version of xf86-video-ati looks for either:
#if !defined(HAS_DIRTYTRACKING_ROTATION) && !defined(HAS_DIRTYTRACKING2)'

and it appears to have patches for both ati and nouveau drivers. But I can't tell if that is a fedora-only patch or an upstream patch that can be brought to Ubuntu (or will eventually be brought in the normal course of version advances). Of course I am not an X expert so that fedora bug could be subtly different and thus not the same fix.

Martin (marthter) wrote :

Maybe duplicate? https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1381013

(While that bug is radeon driver, if the fix is the same in both drivers, this can still be considered duplicate maybe?)

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg-server (Ubuntu):
status: New → Confirmed
Oleg Moiseichuk (berroll) wrote :

I met with the same bug in Ubuntu 16.04.1 (amd64): 2 NVIDIA adapters with DVI and HDMI connectors on each of them, 4 identical Samsung monitors, 4th monitor is dead, 3rd is sometimes garbled, sometimes is OK. All the error messages described by Martin are the same.
Luckily in #2 he provided the method which cures the bug with ATI cards in Fedora. I decided to try it with Nouveau driver in Ubuntu and it worked!
I downloaded the sources using 'apt-get source xserver-xorg-video-nouveau', found the string in drmmode_display.c which checks whether HAS_DIRTYTRACKING2 is defined and fixed it. Then I compiled the driver and replaced '/usr/lib/xorg/modules/drivers/nouveau_drv.so' with the fixed version. After reboot all 4 monitors were working on login screen, '~/.config/monitors.xml' was created properly and all monitors were present when I logged in.
I'm attaching the patch. Maybe the developers will notice it and fix the Nouveau driver?
(BTW, ATI driver in Ubuntu 16.04 seems already fixed - I checked its sources and the mentioned string is already in place in drmmode_display.c)

affects: xorg-server (Ubuntu) → xserver-xorg-video-nouveau (Ubuntu)

The attachment "Fixes improper handling of 3rd and 4th monitors" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in xserver-xorg-video-nouveau (Ubuntu):
importance: Undecided → Medium
Martin (marthter) wrote :
Download full text (3.4 KiB)

I can confirm that the patch in #5 works. I've tested it on the same system (updated to 16.04.1 with all current updates), same video cards, same monitors, as described in the original bug description section above.

(long version:)

Re #5, thanks for trying this and updating with your result! You've now emboldened me to try this too, but you just say "I compiled the driver", you don't specifically say how :-(

So I've got the source folders with the apt source command you mentioned, applied the patch, and from the (patched) xserver-xorg-video-nouveau-1.0.12 folder, I've run .configure but I get the following:

[lots of "checking... yes" lines]
...
Package xorg-macros was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-macros.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-macros' found
...
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
checking if RANDR is defined... no
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
checking if RENDER is defined... no
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
checking if XV is defined... no
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
checking if DPMSExtension is defined... no
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
checking if DRI2 is defined... no
checking for LIBDRM... yes
checking for LIBDRM_NOUVEAU... yes
checking for XORG... no
configure: error: Package requirements (xorg-server >= 1.8 xproto fontsproto libdrm ) were not met:
No package 'xorg-server' found
No package 'fontsproto' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables XORG_CFLAGS
and XORG_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

Do you recall which -dev packages you had to install for this to work?
Okay google-answering my own question (for other readers)...
apt-get install xserver-xorg-dev x11proto-core-dev x11proto-fonts-dev

After this, ./configure and make worked, I moved the new src/.libs/nouveau_drv.so to replace the one in /usr/lib/xorg/modules/drivers/ as you said, and upon reboot, the 4th monitor works. Thanks! I've been sitting with it dark for months!!!

One concern though, is why is the new version 10x bigger than the old? Is the default ./configure settings set to leave debug flags on or something? and sh...

Read more...

Oleg Moiseichuk (berroll) wrote :

Martin, you've done everything well. Indeed, additional packages are needed for the successful compilation. They can be installed by the command 'sudo apt-get build-dep package_name' (there can be hefty pack, that's why I'm usually using virtual machine for the compilation and revert it to the last snapshot afterwards).
The size of the resulting library can be decreased by setting specific compiler options. If you examine Makefile which was created after './configure' has finished its work, you'll find CFLAGS string in it containing -g option (the level of debugging information) and -O2 option (optimization level). Disabling debugging information affects size of the resulting file but isn't advised (this may cause undesired results). Increasing optimization level will reduce the compiled file size (higher levels of optimisation also may cause undesired code behavior). Better leave it as it is. Those who perform packaging are better aware how this specific package should be compiled to ensure its minimal size for the distribution.

Oleg Moiseichuk (berroll) wrote :

If debugging symbols weren't disabled during compilation and the resulting file size looks intimidating you can decrease it. Run 'strip -s nouveau_drv.so' and debugging symbols will be purged completely.

Oleg Moiseichuk (berroll) wrote :

Almost 2 months have passed since I posted the patch. Martin, if you are still tracking this bug, does this patch work stable for you?

Martin (marthter) wrote :

I did not re-try with your suggestions of how to get the .so file smaller. But with the original large one I built with your patch, January 13, yes it has behaved fine and all four monitors continue to work.

Oleg Moiseichuk (berroll) wrote :

Then you are more lucky than I am. My system hangs from time to time with this patched driver - mouse and screen are frozen, only reboot cures that. It happens approximately once a week, and that doesn't suit me because my system should be up 24/7. Nothing can be found in /var/log/syslog, only Xorg log shows some info about "EQ overflowing" [https://nouveau.freedesktop.org/wiki/TroubleShooting/#index5h3]. So it seems that this patch needs proper testing and its stability depends on PC configuration. Good that it helped someone, but that's not my case.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.