7

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
6
  • Where did you get nvidia-dkms-415. There is no such package in Ubuntu repos. It must be from some PPA.
    – Pilot6
    Mar 2, 2019 at 14:57
  • i'm using this ppa:graphics-drivers/ppa
    – s.illes79
    Mar 2, 2019 at 15:04
  • Please edit your question and add output of dkms status.
    – Pilot6
    Mar 2, 2019 at 15:04
  • And also ls /var/lib/dkms
    – Pilot6
    Mar 2, 2019 at 15:05
  • updated original post. dkms.conf is missing, how do i get it? I don't have it on my laptop either, but that has just intel gpu
    – s.illes79
    Mar 2, 2019 at 15:30

2 Answers 2

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.

8
  • thanks, i did that, now it'm getting: sudo dkms status no output and ls /var/lib/dkms dkms_dbversion
    – s.illes79
    Mar 2, 2019 at 15:42
  • 1
    You should have dkms.conf now and a module installed in dkms status.
    – Pilot6
    Mar 2, 2019 at 15:44
  • Please run sudo apt purge 'nvidia.*', then run sudo apt install nvidia-driver-415 and post the output of the second command TO YOUR QUESTION.
    – Pilot6
    Mar 2, 2019 at 15:47
  • i think this did it: sudo dkms status nvidia, 415.27, 4.15.0-45-generic, x86_64: installed
    – s.illes79
    Mar 2, 2019 at 17:57
  • That looks good. BTW you don't need sudo for dkms status.
    – Pilot6
    Mar 2, 2019 at 18:01
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.