X.org 1.18/1.19 hang on start on Lenovo P70/Quadro M4000M with discrete graphics only enabled in BIOS

That’s no use, it’s a driver bug, it fails to set the mode on the display.
To get a useable system, you will have to switch to PRIME output to leave the modesetting to the intel driver. The intel GPU kernel driver has to be working.

  1. create a xorg.conf
# Server layout
Section "ServerLayout"
	Identifier "layout"
	Screen 0 "nvidia"
	Inactive "intel"
EndSection

# Intel
Section "Device"
	Identifier "Intel"
	Driver "modesetting"
	BusID "PCI:0@0:2:0"
	Option "AccelMethod" "none"
EndSection

Section "Screen"
	Identifier "intel"
	Device "intel"
EndSection

# Nvidia
Section "Device"
	Identifier "nvidia"
	Driver "nvidia"
	BusID "PCI:1@0:0:0"
	Option "ConstrainCursor" "off"
EndSection

Section "Screen"
	Identifier "nvidia"
	Device "nvidia"
	Option "AllowEmptyInitialConfiguration" "on"
	Option "IgnoreDisplayDevices" "CRT"
EndSection
  1. depending on your desktop environment and login manager, you have to run a script, see
    https://wiki.archlinux.org/index.php/NVIDIA_Optimus#Display_Managers

  2. switch bios to ‘hybrid’

I found this also: https://devtalk.nvidia.com/default/topic/935099/linux/-ee-nvidia-0-failed-to-enter-vt-mode-initialization-failed-with-quot-load-legacy-option-rom-qu/

The pinned post on this forum suggested that this is where to report problems…

I didn’t have any luck with this. For now, I’m going back to the primus/optimus stuff that was working (however slowly), pending a fix for the driver. If more information is needed (or there’s somewhere else I need to file a bug), I’ll provide what I can, but I do want to finish standing up this laptop.

Is anybody from nVidia looking into this driver issue? Or do I need to file a bug somewhere?

This bug is pretty strange. Some of the code related to this stuff was completely rewritten in 387.12, so can you please give that a try and attach an nvidia-bug-report.log.gz from that if it still doesn’t work?

With discrete-only graphics, black screen.
nvidia-bug-report.log.gz (245 KB)

I’ll need to back this out; I need to use the laptop.

So I have a progress update here.

I still haven’t tried discrete-only in the BIOS, but I have been able to get Prime running via the suse-prime packae (from home:bosim:suse-prime repo). There are still some problems; I haven’t yet been able to get external monitors working (but I haven’t with bumblebee using either optirun or primusrun), and glmark2 crashes on startup with what looks like a dynamic library problem of one kind or another.

glxspheres is much faster under suse-prime than under either optirun or primusrun, by a factor of 7-10.

But I’ve found I still need the bumblebee bits in order for OpenCL to work. And I still don’t have external monitors working. Fortunately, suse-prime is just a collection of simple shell scripts and an xorg.conf file.

OK, so I got glmark2 to run; the seg fault was due to a miscompile of glmark2 that looks to be a bug in glmark2’s build (other people have reported it. Running it with LD_PRELOAD=/lib64/libpthread.so.0 works, and I get performance more like what I’d expect (overall GLMark2 of 7069, vs. 1564 using Optimus, 2002 using Primus, 2581 with the Intel driver, 3592 on my old Dell M6500 with AMD HD5870, and 6546 on my server with an i7-5820K and AMD R7-360).

Most of the individual benchmarks are won either by the Prime configuration, or modestly by the server. However, in the terrain test, the Prime configuration comes in third; Primus actually beats it 853 to 748.

It hardly surprises me that a proper configuration with a native driver crushes VirtualGL, which is a really ugly hack.

The external monitor issue was simply pirate error in my xorg.conf bits; I’ll be filing an issue against suse-prime for this.

The only little glitch that’s left is that after suspend/hibernate/resume some things (like the icon/avatar on the KDE lock screen and the labels on my desktop icons) come back as solid white rather than white on background. I presume that’s some minor bug in one of the libraries. That should of course be fixed, but it’s a minor issue. Bottom line is that it looks like everything I really care about is now fixed.

Thanks for everyone’s time.