8

After each kernel upgrade, when I reboot I only get a blank screen

It looks like the proprietary nvidia kernel modules do not get auto recompiled

I have to boot into recovery mode and do

dpkg-reconfigure nvidia-dkms-415

and after that all good till the next upgrade.

I guess something get messed up in the system, originaly I tried to install the nvidia driver from nvidia, but ended up removing it and just used the ubuntu one.

Any tips how to sort out my system? i don't want to reinstall.

sudo dkms status:

Error! Could not locate dkms.conf file.  
File:  does not exist.

ls /var/lib/dkms

dkms_dbversion  nvidia

ls /var/lib/dkms/nvidia/

410.78  415.27  kernel-4.15.0-39-generic-x86_64  kernel-4.15.0-45-generic-x86_64

sudo ubuntu-drivers devices

== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==  
modalias : pci:v000010DEd00001B81sv00001028sd00003301bc03sc00i00  
vendor   : NVIDIA Corporation  
model    : GP104 [GeForce GTX 1070]  
driver   : nvidia-driver-390 - third-party free  
driver   : nvidia-driver-415 - third-party free recommended  
driver   : nvidia-driver-396 - third-party free  
driver   : nvidia-driver-410 - third-party free  
driver   : xserver-xorg-video-nouveau - distro free builtin

I am using this ppa:

deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main  

after

sudo apt purge 'nvidia.*'
sudo apt install nvidia-driver-415

output:   
...
Setting up nvidia-dkms-415 (415.27-0ubuntu0~gpu18.04.2) ...
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Loading new nvidia-415.27 DKMS files...
Building for 4.15.0-45-generic
Building for architecture x86_64
Building initial module for 4.15.0-45-generic
Secure Boot not enabled on this system.
Done.

nvidia:
Running module version sanity check.

Good news! Module version 415.27 for nvidia.ko
exactly matches what is already found in kernel 4.15.0-45-generic.
DKMS will not replace this module.
You may override by specifying --force.

nvidia-modeset.ko:
Running module version sanity check.

Good news! Module version 415.27 for nvidia-modeset.ko
exactly matches what is already found in kernel 4.15.0-45-generic.
DKMS will not replace this module.
You may override by specifying --force.

nvidia-drm.ko:
Running module version sanity check.

Good news! Module version 415.27 for nvidia-drm.ko
exactly matches what is already found in kernel 4.15.0-45-generic.
DKMS will not replace this module.
You may override by specifying --force.

nvidia-uvm.ko:
Running module version sanity check.

Good news! Module version  for nvidia-uvm.ko
exactly matches what is already found in kernel 4.15.0-45-generic.
DKMS will not replace this module.
You may override by specifying --force.

depmod...

DKMS: install completed.
Setting up nvidia-driver-415 (415.27-0ubuntu0~gpu18.04.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for initramfs-tools (0.130ubuntu3.6) ...
update-initramfs: Generating /boot/initrd.img-4.15.0-45-generic

Now:

dkms status

nvidia, 415.27, 4.15.0-45-generic, x86_64: installed
Pilot6
  • 92,041
s.illes79
  • 173

2 Answers2

9

Your dkms is broken. I suggest to fix it this way:

sudo rm -r /var/lib/dkms/nvidia
sudo apt install --reinstall dkms
sudo apt purge 'nvidia.*'
sudo apt install nvidia-driver-415

That will cleanup the dkms directory, create dkms.conf and install the driver properly.

Pilot6
  • 92,041
1

I think you might find that the solution here is nothing to do directly with the Nvidia driver,nor the kernel version nor DKMS.

The problem here is the GCC & G++ version your system has as its default.

On my system GCC was set to an old version 7.4 and I upgraded the compiler version to 8.0 & G++ also to version 8.

I then set GCC 8 as the default compiler and this finally fixed the problem. The latest mainstream kernel installed fine and the Nvidia modules (the x4 .ko files) also compiled without any glitches. System running nicely once again.

cyteck
  • 11