Impossible to use HDMI output as bumblebee is crashing (segfault) on OsLookupColor

Hello everyone,

I bought almost one year ago a quite recet laptop (MSI P65 Creator) with both an intel chipset and a NVIDIA discrete card:

00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 630 (Mobile)
01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1050 Ti Mobile] (rev a1)

It’s driving me quite crazy as I haven’t yet managed to be able to use the NVIDIA card to simply output something on a secondary screen because of the Bumblebee/Optimus/whatever hell it implies.

I’m on debian sid (Linux 5.2.0-3-amd64 #1 SMP Debian 5.2.17-1 (2019-09-26) x86_64 GNU/Linux), I have the NVidia drivers installed (version 430.50 from the package manager) together with Bumblebee. I’m trying to make

optirun intel-virtual-output

work and to be able to connect a second screen.

I had various problems, and after following all I could found on the subject on the internet, the bumblebee optirun command is failing with the Xorg server segfaulting on OsLookupColor:

[ 13272.340] (EE) Backtrace:
[ 13272.343] (EE) 0: /usr/lib/xorg/Xorg (OsLookupColor+0x139) [0x559eb23df2c9]
[ 13272.343] (EE) 1: /lib/x86_64-linux-gnu/libpthread.so.0 (funlockfile+0x50) [0x7f2199c8755f]
[ 13272.343] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (memcpy+0x1f) [0x7f2199b55c9f]
[ 13272.345] (EE) 3: /lib/x86_64-linux-gnu/libnvidia-glcore.so.430.50 (_nv043glcore+0x27ff09) [0x7f2198784809]
[ 13272.345] (EE) 4: /lib/x86_64-linux-gnu/libnvidia-glcore.so.430.50 (_nv043glcore+0x28006d) [0x7f2198784b2d]
[ 13272.346] (EE) 5: /lib/x86_64-linux-gnu/libnvidia-glcore.so.430.50 (_nv015glcore+0x49ab8) [0x7f2198236fd8]
[ 13272.346] (EE) unw_get_proc_name failed: no unwind info found [-10]
[ 13272.346] (EE) 6: /usr/lib/nvidia/nvidia/libglxserver_nvidia.so (?+0x0) [0x7f2196164d32]
[ 13272.346] (EE) 
[ 13272.346] (EE) Segmentation fault at address 0x7f219625e000

Here is the content of various configuration and log files:

/etc/bumblebee/xorg.conf.nvidia

Section "ServerLayout"
    Identifier  "Layout0"
    Option      "AutoAddDevices" "false"
    Option      "AutoAddGPU" "false"
EndSection

Section "Device"
    Identifier  "DiscreteNvidia"
    Driver      "nvidia"
    VendorName  "NVIDIA Corporation"
    BusID       "PCI:01:00:0"

#   If the X server does not automatically detect your VGA device,
#   you can manually set it here.
#   To get the BusID prop, run `lspci | egrep 'VGA|3D'` and input the data
#   as you see in the commented example.
#   This Setting may be needed in some platforms with more than one
#   nvidia card, which may confuse the proprietary driver (e.g.,
#   trying to take ownership of the wrong device). Also needed on Ubuntu 13.04.
#   BusID "PCI:01:00:0"

#   Setting ProbeAllGpus to false prevents the new proprietary driver
#   instance spawned to try to control the integrated graphics card,
#   which is already being managed outside bumblebee.
#   This option doesn't hurt and it is required on platforms running
#   more than one nvidia graphics card with the proprietary driver.
#   (E.g. Macbook Pro pre-2010 with nVidia 9400M + 9600M GT).
#   If this option is not set, the new Xorg may blacken the screen and
#   render it unusable (unless you have some way to run killall Xorg).
    Option "ProbeAllGpus" "false"

    Option "NoLogo" "true"
    Option "UseEDID" "false"
    Option "UseDisplayDevice" "none"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Screen"
    Identifier "Default Screen"
    Device "DiscreteNVidia"
EndSection

/usr/share/X11/xorg.conf.d/20-intel.conf

Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection

/var/log/Xorg.8.log

[ 13272.150] 
X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
[ 13272.150] Build Operating System: Linux 4.9.0-8-amd64 x86_64 Debian
[ 13272.150] Current Operating System: Linux darkmoule 5.2.0-3-amd64 #1 SMP Debian 5.2.17-1 (2019-09-26) x86_64
[ 13272.150] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.2.0-3-amd64 root=UUID=42ee6c48-84d1-487d-9db1-00d1ff24f3ff ro quiet
[ 13272.150] Build Date: 05 March 2019  08:11:12PM
[ 13272.150] xorg-server 2:1.20.4-1 (https://www.debian.org/support) 
[ 13272.150] Current version of pixman: 0.36.0
[ 13272.150] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[ 13272.150] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[ 13272.150] (==) Log file: "/var/log/Xorg.8.log", Time: Mon Oct  7 18:27:46 2019
[ 13272.150] (++) Using config file: "/etc/bumblebee/xorg.conf.nvidia"
[ 13272.150] (++) Using config directory: "/etc/bumblebee/xorg.conf.d"
[ 13272.150] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[ 13272.152] (==) ServerLayout "Layout0"
[ 13272.152] (**) |-->Screen "Default Screen" (0)
[ 13272.152] (**) |   |-->Monitor "<default monitor>"
[ 13272.152] (**) |   |-->Device "DiscreteNvidia"
[ 13272.152] (**) |   |-->GPUDevice "DiscreteNvidia"
[ 13272.152] (==) No monitor specified for screen "Default Screen".
	Using a default monitor configuration.
[ 13272.152] (**) Option "AutoAddDevices" "false"
[ 13272.152] (**) Option "AutoAddGPU" "false"
[ 13272.152] (**) Not automatically adding devices
[ 13272.152] (==) Automatically enabling devices
[ 13272.152] (**) Not automatically adding GPU devices
[ 13272.152] (==) Max clients allowed: 256, resource mask: 0x1fffff
[ 13272.152] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[ 13272.152] 	Entry deleted from font path.
[ 13272.152] (==) FontPath set to:
	/usr/share/fonts/X11/misc,
	/usr/share/fonts/X11/100dpi/:unscaled,
	/usr/share/fonts/X11/75dpi/:unscaled,
	/usr/share/fonts/X11/Type1,
	/usr/share/fonts/X11/100dpi,
	/usr/share/fonts/X11/75dpi,
	built-ins
[ 13272.152] (++) ModulePath set to "/usr/lib/nvidia/nvidia,/usr/lib/xorg/modules"
[ 13272.152] (==) |-->Input Device "<default pointer>"
[ 13272.152] (==) |-->Input Device "<default keyboard>"
[ 13272.152] (==) The core pointer device wasn't specified explicitly in the layout.
	Using the default mouse configuration.
[ 13272.152] (==) The core keyboard device wasn't specified explicitly in the layout.
	Using the default keyboard configuration.
[ 13272.152] (II) Loader magic: 0x559eb246ce20
[ 13272.152] (II) Module ABI versions:
[ 13272.152] 	X.Org ANSI C Emulation: 0.4
[ 13272.152] 	X.Org Video Driver: 24.0
[ 13272.152] 	X.Org XInput driver : 24.1
[ 13272.152] 	X.Org Server Extension : 10.0
[ 13272.153] (--) using VT number 2

[ 13272.153] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[ 13272.153] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 13272.153] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[ 13272.155] (--) PCI:*(1@0:0:0) 10de:1c21:1462:1244 rev 161, Mem @ 0xa3000000/16777216, 0x90000000/268435456, 0xa0000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/524288
[ 13272.155] (II) LoadModule: "glx"
[ 13272.158] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[ 13272.222] (II) Module glx: vendor="X.Org Foundation"
[ 13272.222] 	compiled for 1.20.4, module version = 1.0.0
[ 13272.222] 	ABI class: X.Org Server Extension, version 10.0
[ 13272.223] (II) LoadModule: "nvidia"
[ 13272.223] (II) Loading /usr/lib/nvidia/nvidia/nvidia_drv.so
[ 13272.233] (II) Module nvidia: vendor="NVIDIA Corporation"
[ 13272.233] 	compiled for 1.6.99.901, module version = 1.0.0
[ 13272.233] 	Module class: X.Org Video Driver
[ 13272.233] (II) LoadModule: "mouse"
[ 13272.235] (II) Loading /usr/lib/xorg/modules/input/mouse_drv.so
[ 13272.237] (II) Module mouse: vendor="X.Org Foundation"
[ 13272.237] 	compiled for 1.20.0, module version = 1.9.3
[ 13272.237] 	Module class: X.Org XInput Driver
[ 13272.237] 	ABI class: X.Org XInput driver, version 24.1
[ 13272.237] (II) LoadModule: "kbd"
[ 13272.238] (WW) Warning, couldn't open module kbd
[ 13272.238] (EE) Failed to load module "kbd" (module does not exist, 0)
[ 13272.238] (II) NVIDIA dlloader X Driver  430.50  Thu Sep  5 22:43:53 CDT 2019
[ 13272.238] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
[ 13272.240] (II) Loading sub module "fb"
[ 13272.240] (II) LoadModule: "fb"
[ 13272.240] (II) Loading /usr/lib/xorg/modules/libfb.so
[ 13272.242] (II) Module fb: vendor="X.Org Foundation"
[ 13272.242] 	compiled for 1.20.4, module version = 1.0.0
[ 13272.242] 	ABI class: X.Org ANSI C Emulation, version 0.4
[ 13272.242] (II) Loading sub module "wfb"
[ 13272.242] (II) LoadModule: "wfb"
[ 13272.242] (II) Loading /usr/lib/xorg/modules/libwfb.so
[ 13272.245] (II) Module wfb: vendor="X.Org Foundation"
[ 13272.245] 	compiled for 1.20.4, module version = 1.0.0
[ 13272.245] 	ABI class: X.Org ANSI C Emulation, version 0.4
[ 13272.245] (II) Loading sub module "ramdac"
[ 13272.245] (II) LoadModule: "ramdac"
[ 13272.245] (II) Module "ramdac" already built-in
[ 13272.247] (II) NVIDIA(0): Creating default Display subsection in Screen section
	"Default Screen" for depth/fbbpp 24/32
[ 13272.247] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32
[ 13272.247] (==) NVIDIA(0): RGB weight 888
[ 13272.247] (==) NVIDIA(0): Default visual is TrueColor
[ 13272.247] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[ 13272.247] (**) NVIDIA(0): Option "ProbeAllGpus" "false"
[ 13272.247] (**) NVIDIA(0): Option "AllowEmptyInitialConfiguration"
[ 13272.247] (**) NVIDIA(0): Option "UseEDID" "false"
[ 13272.247] (**) NVIDIA(0): Option "UseDisplayDevice" "none"
[ 13272.248] (**) NVIDIA(0): Enabling 2D acceleration
[ 13272.248] (**) NVIDIA(0): Ignoring EDIDs
[ 13272.248] (**) NVIDIA(0): Option "UseDisplayDevice" set to "none"; enabling NoScanout
[ 13272.248] (**) NVIDIA(0):     mode
[ 13272.248] (II) Loading sub module "glxserver_nvidia"
[ 13272.248] (II) LoadModule: "glxserver_nvidia"
[ 13272.248] (II) Loading /usr/lib/nvidia/nvidia/libglxserver_nvidia.so
[ 13272.288] (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"
[ 13272.288] 	compiled for 1.6.99.901, module version = 1.0.0
[ 13272.288] 	Module class: X.Org Server Extension
[ 13272.289] (II) NVIDIA GLX Module  430.50  Thu Sep  5 22:41:46 CDT 2019
[ 13272.292] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 1050 Ti (GP106-A) at PCI:1:0:0 (GPU-0)
[ 13272.292] (--) NVIDIA(0): Memory: 4194304 kBytes
[ 13272.292] (--) NVIDIA(0): VideoBIOS: 86.06.6f.00.2b
[ 13272.292] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[ 13272.292] (II) NVIDIA(0): Validated MetaModes:
[ 13272.292] (II) NVIDIA(0):     "NULL"
[ 13272.292] (II) NVIDIA(0): Virtual screen size determined to be 640 x 480
[ 13272.292] (WW) NVIDIA(0): Unable to get display device for DPI computation.
[ 13272.292] (==) NVIDIA(0): DPI set to (75, 75); computed from built-in default
[ 13272.292] (II) NVIDIA: Using 24576.00 MB of virtual memory for indirect memory
[ 13272.292] (II) NVIDIA:     access.
[ 13272.309] (II) NVIDIA(0): ACPI: failed to connect to the ACPI event daemon; the daemon
[ 13272.309] (II) NVIDIA(0):     may not be running or the "AcpidSocketPath" X
[ 13272.309] (II) NVIDIA(0):     configuration option may not be set correctly.  When the
[ 13272.309] (II) NVIDIA(0):     ACPI event daemon is available, the NVIDIA X driver will
[ 13272.309] (II) NVIDIA(0):     try to use it to receive ACPI event notifications.  For
[ 13272.309] (II) NVIDIA(0):     details, please see the "ConnectToAcpid" and
[ 13272.309] (II) NVIDIA(0):     "AcpidSocketPath" X configuration options in Appendix B: X
[ 13272.309] (II) NVIDIA(0):     Config Options in the README.
[ 13272.324] (II) NVIDIA(0): Setting mode "NULL"
[ 13272.330] (==) NVIDIA(0): Disabling shared memory pixmaps
[ 13272.330] (==) NVIDIA(0): Backing store enabled
[ 13272.330] (==) NVIDIA(0): Silken mouse enabled
[ 13272.331] (==) NVIDIA(0): DPMS enabled
[ 13272.331] (WW) NVIDIA(0): Option "NoLogo" is not used
[ 13272.331] (II) Loading sub module "dri2"
[ 13272.331] (II) LoadModule: "dri2"
[ 13272.331] (II) Module "dri2" already built-in
[ 13272.331] (II) NVIDIA(0): [DRI2] Setup complete
[ 13272.331] (II) NVIDIA(0): [DRI2]   VDPAU driver: nvidia
[ 13272.332] (II) Initializing extension Generic Event Extension
[ 13272.332] (II) Initializing extension SHAPE
[ 13272.332] (II) Initializing extension MIT-SHM
[ 13272.332] (II) Initializing extension XInputExtension
[ 13272.332] (II) Initializing extension XTEST
[ 13272.332] (II) Initializing extension BIG-REQUESTS
[ 13272.332] (II) Initializing extension SYNC
[ 13272.332] (II) Initializing extension XKEYBOARD
[ 13272.333] (II) Initializing extension XC-MISC
[ 13272.333] (II) Initializing extension SECURITY
[ 13272.333] (II) Initializing extension XFIXES
[ 13272.333] (II) Initializing extension RENDER
[ 13272.333] (II) Initializing extension RANDR
[ 13272.333] (II) Initializing extension COMPOSITE
[ 13272.333] (II) Initializing extension DAMAGE
[ 13272.333] (II) Initializing extension MIT-SCREEN-SAVER
[ 13272.333] (II) Initializing extension DOUBLE-BUFFER
[ 13272.333] (II) Initializing extension RECORD
[ 13272.333] (II) Initializing extension DPMS
[ 13272.333] (II) Initializing extension Present
[ 13272.333] (II) Initializing extension DRI3
[ 13272.333] (II) Initializing extension X-Resource
[ 13272.334] (II) Initializing extension XVideo
[ 13272.334] (II) Initializing extension XVideo-MotionCompensation
[ 13272.334] (II) Initializing extension SELinux
[ 13272.334] (II) SELinux: Disabled on system
[ 13272.334] (II) Initializing extension GLX
[ 13272.334] (II) Initializing extension GLX
[ 13272.334] (II) Indirect GLX disabled.
[ 13272.334] (II) GLX: Another vendor is already registered for screen 0
[ 13272.334] (II) Initializing extension XFree86-VidModeExtension
[ 13272.334] (II) Initializing extension XFree86-DGA
[ 13272.334] (II) Initializing extension XFree86-DRI
[ 13272.334] (II) Initializing extension DRI2
[ 13272.334] (II) Initializing extension NV-GLX
[ 13272.334] (II) Initializing extension NV-CONTROL
[ 13272.340] (EE) 
[ 13272.340] (EE) Backtrace:
[ 13272.343] (EE) 0: /usr/lib/xorg/Xorg (OsLookupColor+0x139) [0x559eb23df2c9]
[ 13272.343] (EE) 1: /lib/x86_64-linux-gnu/libpthread.so.0 (funlockfile+0x50) [0x7f2199c8755f]
[ 13272.343] (EE) 2: /lib/x86_64-linux-gnu/libc.so.6 (memcpy+0x1f) [0x7f2199b55c9f]
[ 13272.345] (EE) 3: /lib/x86_64-linux-gnu/libnvidia-glcore.so.430.50 (_nv043glcore+0x27ff09) [0x7f2198784809]
[ 13272.345] (EE) 4: /lib/x86_64-linux-gnu/libnvidia-glcore.so.430.50 (_nv043glcore+0x28006d) [0x7f2198784b2d]
[ 13272.346] (EE) 5: /lib/x86_64-linux-gnu/libnvidia-glcore.so.430.50 (_nv015glcore+0x49ab8) [0x7f2198236fd8]
[ 13272.346] (EE) unw_get_proc_name failed: no unwind info found [-10]
[ 13272.346] (EE) 6: /usr/lib/nvidia/nvidia/libglxserver_nvidia.so (?+0x0) [0x7f2196164d32]
[ 13272.346] (EE) 
[ 13272.346] (EE) Segmentation fault at address 0x7f219625e000
[ 13272.346] (EE) 
Fatal server error:
[ 13272.346] (EE) Caught signal 11 (Segmentation fault). Server aborting
[ 13272.346] (EE) 
[ 13272.346] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[ 13272.346] (EE) Please also check the log file at "/var/log/Xorg.8.log" for additional information.
[ 13272.346] (EE) 
[ 13272.350] (EE) Server terminated with error (1). Closing log file.

Do anyone has any idea on this ?
nvidia-bug-report.log.gz (1.1 MB)

You chose to install the non-glvnd compat libs on driver install and those are broken in 430 (and completely removed in 435+). Don’t install the compat libs.
Instead of bumblebee, you can also use prime:
https://devtalk.nvidia.com/default/topic/1022670/linux/official-driver-384-59-with-geforce-1050m-doesn-t-work-on-opensuse-tumbleweed-kde/post/5203910/#5203910

Hi, thank you for your answer and for pointing out the issue. Actually Debian made the choice for me, as the primus/bumblebee packages seem to be intentionally flagged as incompatible with glvnd:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=888020

So one can’t install primus with glvnd libraries together using the package manager. What would you recommend to do then ? Try to install either the nvidia drivers or primus from an external source ? Does the procedure you gave in your other answer requires primus/bumblebee or does it work out of the box ?

Thanks

The primus bridge is broken, will not work anymore. You can still use bumblebee with the virtualgl bridge, which is glvnd capable.
I’d rather recommend using PRIME output, this only needs the xorg.conf and the two xrandr commands, no other software needed. You should uninstall bumblebee for that.

I was finally able to make it work by following your procedure ! Thank you so much for your help.