Ubuntu – Black screen after installing NVIDIA drivers 390, 410, 415 for GeForce 1050 TI

driversgraphicsnvidiaxorg

Problem

I cannot get my NVIDIA 1050 TI to work with Ubuntu 18.04 and 18.10 (I updated, same issues). Every time I switch from the built-in drivers to the ones from ppa:graphics-drivers, a reboot will lead to a black screen, from which I can't get anywhere.

I always have to boot into recovery mode, purge the nvidia packages, and try again. My monitor is connected to the DP port on the NVIDIA card; it's an AOC 4K 60Hz display.

I have tried the following versions of the NVIDIA drivers via apt:

  • 396
  • 410
  • 415

Update: The problem is not GDM3 or lightdm (I've tried both), it's actually that the screen where I get asked the LUKS password is not shown. When I type my password blindly, I can continue to the login screen!

Related questions / discussions

I have seen the following posts:

Some bug reports:

Any idea what I could look for? Where would I find logs that give me an indication of the error?

More info

Detailed info about the device:

➜ lspci | grep -i vga
01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050 Ti] (rev a1)

The problem is the same on both 4.15 and 4.18 kernels (18.04, 18.10). My current kernel:

Linux voltaire 4.18.0-13-generic #14-Ubuntu SMP Wed Dec 5 09:04:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

My apt-cache policy:

linux-headers-generic:
  Installed: 4.18.0.13.14
  Candidate: 4.18.0.13.14
  Version table:
 *** 4.18.0.13.14 500
        500 http://ubuntu.inode.at/ubuntu cosmic-updates/main amd64 Packages
        500 http://ubuntu.inode.at/ubuntu cosmic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     4.18.0.10.11 500
        500 http://ubuntu.inode.at/ubuntu cosmic/main amd64 Packages

Output I get when installing the latest nvidia-driver-415 package:

Loading new nvidia-415.25 DKMS files...
Building for 4.18.0-13-generic
Building for architecture x86_64
Building initial module for 4.18.0-13-generic
Secure Boot not enabled on this system.
Done.

nvidia:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.18.0-13-generic/updates/dkms/

nvidia-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.18.0-13-generic/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.18.0-13-generic/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.18.0-13-generic/updates/dkms/

depmod...

DKMS: install completed.
Setting up nvidia-driver-415 (415.25-0ubuntu0~gpu18.10.1) ...
Processing triggers for libc-bin (2.28-0ubuntu1) ...
Processing triggers for initramfs-tools (0.131ubuntu15) ...
update-initramfs: Generating /boot/initrd.img-4.18.0-13-generic

Best Answer

You have to load the proprietary Nvidia drivers from initramfs.

/etc/initramfs-tools/modules

# List of modules that you want to include in your initramfs.
# They will be loaded at boot time in the order below.
#
# Syntax:  module_name [args ...]
#
# You must run update-initramfs(8) to effect this change.
#
# Examples:
#
# raid1
# sd_mod
nvidia
nvidia-drm
nvidia-modeset
nvidia-uvm

You could also check the content of /etc/modprobe.d/nvidia-graphics-drivers.conf, should be something like this:

options nvidia-drm modeset=1
blacklist nouveau
blacklist lbm-nouveau
alias nouveau off
alias lbm-nouveau off

Make sure to update initramfs. sudo update-initramfs -u -k all

To work around bug with still black screen on typing password, try the following: edit /etc/default/grub change the two lines to be like this:

GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""

apply it with running sudo update-grub

Reboot, and hopefully enjoy!

Related Question