370.28 and 367.44 with Optimus return info missing a screen via XineramaQueryScreens

I have an HP ZBook 15 G3 with a Quadro M1000 running Ubuntu 16.04. I have tried the nvidia 367.44 and 370.28 drivers from the standard graphics drivers PPA (https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa). In both cases, when I check the layout via the XineramaQueryScreens X11 call, I get inaccurate information. Only the two external monitors are reported; the internal laptop screen is ignored.

ghc -e “Graphics.X11.openDisplay >>= Graphics.X11.Xinerama.getScreenInfo”
[Rectangle {rect_x = 1920, rect_y = 0, rect_width = 1920, rect_height = 1080},Rectangle {rect_x = 3840, rect_y = 0, rect_width = 1080, rect_height = 1920}]

Graphics.X11.Xinerama.getScreenInfo is a pretty raw wrapper around XineramaQueryScreens. As you can see, only two screens are shown there. However, I have three screens, as is accurately represented in xrandr. The screen which is not included in the primary one.

Additionally, the monitor does not show up at all in nvidia-settings. It’s not listed in any drop-down and does not show up in the graphical display of monitor layout.

Optimus setup seems to have been configured by the installer script as my /etc/X11/xorg.conf looks like the version described “for older X servers” given here: http://us.download.nvidia.com/XFree86/Linux-x86/370.28/README/randr14.html

I tried issuing the xrandr commands there with --setprovideroutputsource, but it did nothing. I note that xrandr --listproviders has a somewhat different output that I expected, with three shown:
Providers: number : 3
Provider 0: id: 0x269 cap: 0x1, Source Output crtcs: 4 outputs: 8 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x49 cap: 0x2, Sink Output crtcs: 3 outputs: 7 associated providers: 1 name:modesetting
Provider 2: id: 0x49 cap: 0x2, Sink Output crtcs: 3 outputs: 7 associated providers: 1 name:modesetting

I’m kind of stuck here. What should be my next step in debugging this? This is pretty out-of-the-box at the moment. I have not edited an Xorg confs, just installed packages. I tried disabling hybrid entirely but I got no display during boot and blind typing my disk encryption key didn’t get me an X login screen, so that route seems fraught. I’d be fine with giving up the battery life of sometimes using the Intel GPU though - this system doesn’t move around much.
nvidia-bug-report.log.gz (172 KB)

This is expected, for now. PRIME / optimus displays aren’t included in the driver’s MetaMode, which is what also drives the Xinerama info. If you don’t mind hard-coding it, you can work around it by specifying layouts in the nvidiaXineramaInfoOverride option.

Bug 1780889 tracks improving the behavior of Xinerama info with PRIME configurations.

Unless there’s some way to set that option dynamically, I don’t think that will work. I unplug my laptop from the external monitors pretty often. Thanks for pointing out the possible workaround, though.

Looks like there’s no public access to the bug tracker, is that right?

Thanks for the info. I shall hope to see it in some future version. Until then I think I’ll turn hybrid graphics off and live with worse battery life and the bad support that Grub + Plymouth have for NVIDIA graphics.