Ubuntu 17.10 Nvidia Drivers, black screen loop?

This sounds similar to an issue I was having, which I answered over in this thread

It seems that the Ubuntu update switched me to a low-latency kernel, which did not automatically update my kernel headers installation like other kernel upgrades have, and the nvidia binary packages require the kernel headers to be present. Try the following:

sudo apt purge 'nvidia-*'
sudo apt install linux-headers-$(uname -r)
sudo apt install nvidia-384

Note that I did prevent gdm from using Wayland prior to trying anything, and from what I understand Wayland won't currently work with the nvidia binaries, so I'd advise ensuring it's disabled in /etc/gdm3/custom.conf by uncommenting the line #WaylandEnable=false.


Thanks to Steven's answer it got me on the right track, and after some Googling, I've found the last piece of answer within (of course) Arch Linux vibrant community :-)

So what Steven has found is that the header files for the Low Latency Kernel are missing. So you need to do:

sudo apt install linux-headers-$(uname -r)

And a requirement for Wayland on NVidia (you need at least Gnome 3.23, but Ubuntu 17.10 ships with 3.26 so we are covered) is to activate KMS, this is done by editing your /etc/default/grub file and editing the following line to add nvidia-drm.modeset=1, see example:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"

Note: do not remove other parameters if you have/need them, just add the NVidia DRM mode setting one.

Then you need to regenerate the initramfs and the Kernel modules. The best is to do as Steven's suggesting, remove the nvidia package and reinstall it (potentially reinstalling could work, but I did not try, that would be sudo apt install --reinstall nvidia-xxx replace xxx with the driver version for your card, should be 384 for recent cards).

sudo apt remove --purge nvidia-xxx
sudo apt install nvidia-xxx

PS: I new there was a way for it to work, because it worked on my Fedora 25 (now 26) box with a NVidia card as well)

PS2: I wish the nouveau driver would perform better because I do not mind trading a bit of performance for an open source driver. But even in 2D scrolling through a page is awfully slow and not fluid with nouveau, and that's not yet OK for me. I really wish that either Nouveau gets better at 2D (and 3D) or that AMD gets better are creating low power and passive card. Anyway, they do an amazing job given the relationship with NVidia.


I have exactly the same issue with a GTX 1060, tried the suggested fixes (disabling Wayland in the config and fixing the broken driver) but it still doesn't work. However, I am strangely able to get in by going into recovery mode in grub (with the generic kernel) and selecting resume.

EDIT

I managed to get it to work! To do this, I went to grub, selected "c" for the command line, entered the command "videoinfo" - saw that my default video setting is 1024x768 .. went to /etc/default/grub and added the lines GRUB_GFXMODE=1024x760 GRUB_GFXPAYLOAD_LINUX=1024x768 and set GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" - then update-grub and reboot. However, this only worked when selecting the generic kernel in "advanced options" in grub, not the lowlatency one. I also saw a number of messages about "starting/stopping nvidia persistenced" which may be related or not.

2ND EDIT

@Huygens mentioned using the boot option of nvidia-drm.modeset=1 in /etc/default/grub which also worked rather than using nomodeset. However, I still can't use the low latency kernel to work, even after fixing up the missing header files. It also won't load Wayland. I've seen a number of posts around the place saying that my particular case may be related to having an onboard intel video and a dedicated nvidia card causing issues with nvidia-persistenced and gdm3 (https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1705369). Some people have also reported success by using lightdm (dpkg-reconfigure lightdm) but I couldn't get it to log in without it restarting lightdm each time.


I just had to disable Wayland : "WaylandEnable=false" in (/etc/gdm3/custom.conf) and now everyhting works fine !