GeForce 940MX external screen not detected on Ubuntu 17.10

Worked great on Ubuntu 17.04 (I don’t think I installed any special drivers at all). When upgraded to 17.10 one of my displays is black.

Setup:
ASUS Zenbook built in display: Detected and works.
USB-C connected external monitor: Detected and works.
HDMI connected external monitor: Not working.

In the normal Ubuntu Devices → Displays settings only the 2 monitors are detected and I can swap them around and change primary screen (fairly good - only crashed once with flashing monitors and had to force computer off).

I then tried installing Nvidia drivers but no change whatsoever:
$ sudo apt-get purge nvidia*
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
$ sudo apt-get install nvidia-384 nvidia-settings
$ sudo reboot

Checking the Nvidia X Server Settings application says:
NVIDIA Driver Version: 384.90
Clicking “Detect displays”: Nothing happens
Clicking “Advanced…”: Switches button to “Basic…” but nothing happens.
PRIME profiles: NVIDIA selected

Switching PRIME between NVIDIA and Intel changes nothing.

Please help!

Am I installing drivers the wrong way? Logs are showing “nvidia: module verification failed: signature and/or required key missing - tainting kernel” but it is still loading: “NVRM: loading NVIDIA UNIX x86_64 Kernel Module 384.90 Tue Sep 19 19:17:35 PDT 2017”.
nvidia-bug-report.log.gz (152 KB)

Did you try to disable wayland in /etc/gdm3/custom.conf ?
Please run nvidia-bug-report.sh as root and attach the tar.gz file it creates to your post.

Response super appreciated!

Hmm, GDM. Tried the “WaylandEnable=false” switch with no change. Also tried to logon with the “Ubuntu (on Xorg)” option. No change.

Could this have something to do with having the “gnome-session-flashback” installed/preferred. I’m also not seeing the new logon screen that should come with 17.10. Just the old one with the new Aardvark background.

Will try to attach file to the post.

Will very soon revert back to 17.04 (and gnome-session-flashback) - Appart from OP, Alt-tabbing still not workning in GDM from the mess with Unity and quick file keyboard search now gone from File manager.

This has nothing to do with the nvidia driver or gdm/gnome. All your outputs are connected to the intel gpu which is driven by the modesetting driver. The monitor on hdmi is simply not detected. Please check cable/monitor first. Else, this might be a kernel/X bug.

Ok, now it’s working. Booted Windows 10 (same problem there). Updated both Intel and Nvidia drivers without any luck. Replaced the HDMI cable. No luck.

As I was booting back in Ubuntu to tell you guys, there it was: 3 Aardvarks blowing bubbles in front of me (i.e. all monitors working again).

Now using the old cable again and I was booting back between Windows and Ubuntu before without any luck so updating the drivers on Windows and then booting back into Ubuntu was the solution for me (or just rebooting many many times). ASUS support also told me that the system can get confused whether cable is connected or not when inserting and removing a lot (which I do every day).

Thanks for all efforts. Hopefully this will stick!

Edit: Second boot - still working! :)