Ubuntu 18.04 LTS based machine doesn't detect external HDMI monitor after upgrading to nvidia-driver-440

Hello there,

I am a beginner.

I had a working system with Nvidia drivers installed until some recent driver nvidia-driver-440 messed up the system.
Unfortunately, the regular gdm stopped working and I had to install lightdm.
When I execute: nvidia-smi I get this:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

And for detecting the cards in the system, I ran this:

lspci | egrep 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation Device 3e9b
01:00.0 VGA compatible controller: NVIDIA Corporation GP107GLM [Quadro P600 Mobile] (rev a1)

I tried installing CUDA Toolkit hoping it might help to detect my external monitor. Unfortunately, that didn’t help.
Secure-boot has been disabled in BIOS.

Also, I tried to troubleshoot by myself in getting the external monitor to work and in the process, I believe the KDE related packages also got uninstalled. I can switch to the default login session but it goes into infinite login loop with this message: Failed to start session Also in the process of fixing the display manager, I lost Nautilus as the default file manager. I had to install a new file manager called Nemo. Other KDE based software (Kalc) have been missing from my system too. I want to avoid a clean install again, since I have a lot of data on the drive and taking backup will be a time consuming task.

I have attached the bug report with .log extension. This forum didn’t allow me to upload the original generated and gunzipped logfile named: nvidia-bug-report.log.gz
SO PLEASE RENAME BACK THE FILE WITH EXTENSION: .gz

Please let me know how I can use the external HDMInvidia-bug-report.log (100.3 KB) monitor and use Nautilus and KDE based software.

Thank you.

Looks like you booted into an older kernel which has no headers available to compile the module. Please hold down shift on boot and check if a newer kernel is available. Otherwise, please install the kernel headers

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

Hello Generix,

I tried that and this is what I get:

sudo apt update
sudo apt-get install linux-headers-$(uname -r)
[sudo] password for user2020:
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package linux-headers-5.3.0-28-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-5.3.0-28-generic' has no installation candidate

That’s rather odd, Ubuntu still has it available: https://packages.ubuntu.com/bionic/devel/linux-headers-5.3.0-28-generic
Maybe your package list are broken, did you already try updating your system?
Did you check if a newer kernel is available in the grub menu (hold down shift on boot).
Please post the output of
sudo dpkg -l linux-kernel* linux-headers* |grep ii

Hello Generix,
here is the output:

sudo dpkg -l linux-kernel* linux-headers* |grep ii
dpkg-query: no packages found matching linux-headers-5.3.0-28-generic_5.3.0-28.30~18.04.1_amd64.deb

And, I was trying to do a force-installation:

sudo dpkg -i --force-depends linux-headers-5.3.0-28-generic_5.3.0-28.30~18.04.1_amd64.deb

You ran that command in the same directory where the .deb is, so it used that as input and errored out. Please re-run the command in an empty directory.

I created one directory literally named empty_dir and ran the command:

~/empty_dir$ sudo dpkg -l linux-kernel* linux-headers* |grep ii
ii  linux-headers-4.15.0-76            4.15.0-76.86              all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-76-generic    4.15.0-76.86              amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-5.3.0-28-generic     5.3.0-28.30~18.04.1       amd64        Linux kernel headers for version 5.3.0 on 64 bit x86 SMP
ii  linux-headers-5.5.0-050500         5.5.0-050500.202001262030 all          Header files related to Linux kernel version 5.5.0
ii  linux-headers-generic              4.15.0.76.78              amd64        Generic Linux kernel headers

Oops, sorry, I had a typo there, should be

sudo dpkg -l linux-image* linux-headers* |grep ii

looks like manually installing the headers worked, though. Please check if the kernel modules are available now:
dkms status

output for:

~/empty_dir$ dkms status
nvidia, 440.64: added

Here is the new output for linux image and headers, please confirm:

~/empty_dir$ sudo dpkg -l linux-image* linux-headers* |grep ii
ii  linux-headers-4.15.0-76                   4.15.0-76.86              all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-76-generic           4.15.0-76.86              amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-5.3.0-28-generic            5.3.0-28.30~18.04.1       amd64        Linux kernel headers for version 5.3.0 on 64 bit x86 SMP
ii  linux-headers-5.5.0-050500                5.5.0-050500.202001262030 all          Header files related to Linux kernel version 5.5.0
ii  linux-headers-generic                     4.15.0.76.78              amd64        Generic Linux kernel headers
ii  linux-image-4.15.0-76-generic             4.15.0-76.86              amd64        Signed kernel image generic
ii  linux-image-5.0.0-37-generic              5.0.0-37.40~18.04.1       amd64        Signed kernel image generic
ii  linux-image-5.3.0-28-generic              5.3.0-28.30~18.04.1       amd64        Signed kernel image generic
ii  linux-image-generic                       4.15.0.76.78              amd64        Generic Linux kernel image

Please run
sudo dkms install nvidia/440.64
to check if the module builds now, post
dkms status
output afterwards.
In general, something seems broken in your system, it didn’t receive any updates for a long time, Please run
sudo apt update
sudo apt upgrade
to check if manually updating works.

Hello Generix,
Whenever the system boots up and I login, I always run this command:
sudo apt update; sudo apt upgrade

And I saw this similar output when I was force-installing the linux header 5.30.28…:

~/empty_dir$  sudo dkms install nvidia/440.64
[sudo] password for asif: 

Kernel preparation unnecessary for this kernel.  Skipping...
applying patch disable_fstack-clash-protection_fcf-protection.patch...patching file Kbuild
Hunk #1 succeeded at 79 (offset 8 lines).

applying patch buildfix_kernel_5.6.patch...patching file common/inc/nv-procfs.h
patching file common/inc/nv-time.h
patching file conftest.sh
Hunk #1 succeeded at 1267 (offset -3 lines).
Hunk #2 succeeded at 2936 (offset -3 lines).
patching file nvidia-modeset/nvidia-modeset.Kbuild
patching file nvidia-uvm/nvidia-uvm.Kbuild
patching file nvidia/linux_nvswitch.c
patching file nvidia/nv-procfs.c
patching file nvidia/nvidia.Kbuild
patching file nvidia/nvlink_linux.c


Building module:
cleaning build area...(bad exit status: 2)
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'make' -j12 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.3.0-28-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.3.0-28-generic/build LD=/usr/bin/ld.bfd modules...(bad exit status: 2)
ERROR (dkms apport): kernel package linux-headers-5.3.0-28-generic is not supported
Error! Bad return status for module build on kernel: 5.3.0-28-generic (x86_64)
Consult /var/lib/dkms/nvidia/440.64/build/make.log for more information.

Here is the output for updates/upgrade:

~/empty_dir$ sudo apt update; sudo apt upgrade
Get:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  InRelease
Ign:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  InRelease
Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  Release [574 B]
Get:2 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  Release [574 B]
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                             
Hit:5 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease                                                                                                                                                
Hit:6 https://updates.signal.org/desktop/apt xenial InRelease                                                                                                                                                     
Ign:7 http://www.scootersoftware.com bcompare4 InRelease                                                                                                                                                          
Hit:8 http://dl.google.com/linux/chrome/deb stable Release                                                                                                                                                        
Hit:9 https://brave-browser-apt-release.s3.brave.com stable InRelease                                                                                                                                             
Hit:10 http://cz.archive.ubuntu.com/ubuntu bionic InRelease                                                                                                                                                       
Get:11 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                                                                                                      
Hit:12 http://www.scootersoftware.com bcompare4 Release                                                                                                                                                           
Hit:13 http://us.archive.ubuntu.com/ubuntu bionic InRelease                                                                                                                                                       
Get:14 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                                                                                                                   
Hit:15 https://download.sublimetext.com apt/stable/ InRelease                                                                                                                                                     
Get:16 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                                                             
Hit:17 http://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04 ./ InRelease                                                                                          
Hit:18 https://repo.skype.com/deb stable InRelease                                                                    
Hit:19 http://deb.playonlinux.com bionic InRelease                     
Hit:22 http://ppa.launchpad.net/bluetooth/bluez/ubuntu bionic InRelease
Hit:23 http://ppa.launchpad.net/cybermax-dexter/sdl2-backport/ubuntu bionic InRelease
Hit:24 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease         
Hit:25 http://ppa.launchpad.net/giuspen/ppa/ubuntu bionic InRelease                                                                                                                                               
Hit:26 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease                                                                                                                                      
Hit:27 http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu bionic InRelease                                                                                                                        
Hit:28 http://ppa.launchpad.net/oibaf/graphics-drivers/ubuntu bionic InRelease                                                                                                                                    
Hit:29 http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu bionic InRelease                                                                                                                       
Hit:30 http://ppa.launchpad.net/ubuntuhandbook1/audacity/ubuntu bionic InRelease                                                                                                                                  
Hit:31 http://ppa.launchpad.net/webupd8team/atom/ubuntu bionic InRelease                                                                                                                                          
Hit:32 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease                                                                                                                                          
Hit:33 http://ppa.launchpad.net/wireguard/wireguard/ubuntu bionic InRelease                                                                                                                                       
Get:34 http://ftp.us.debian.org/debian buster InRelease [122 kB]                                                                                                                                                  
Err:34 http://ftp.us.debian.org/debian buster InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
Reading package lists... Done
W: GPG error: http://ftp.us.debian.org/debian buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
E: The repository 'http://ftp.us.debian.org/debian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 linux-headers-5.3.0-28-generic : Depends: linux-headers-5.3.0-28 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Ok, this package is also missing:
https://packages.ubuntu.com/bionic/linux-headers-5.3.0-28

I googled and found this site: https://launchpad.net/ubuntu/bionic/+package/linux-headers-5.3.0-28 Downloaded the package from the link that reads “proposed” and then I followed the link to here: http://launchpadlibrarian.net/460993257/linux-headers-5.3.0-28_5.3.0-28.30~18.04.1_all.deb

I could install it:

sudo dpkg --install linux-headers-5.3.0-28_5.3.0-28.30~18.04.1_all.deb 
[sudo] password for user2020: 
Selecting previously unselected package linux-headers-5.3.0-28.
(Reading database ... 239959 files and directories currently installed.)
Preparing to unpack linux-headers-5.3.0-28_5.3.0-28.30~18.04.1_all.deb ...
Unpacking linux-headers-5.3.0-28 (5.3.0-28.30~18.04.1) ...
Setting up linux-headers-5.3.0-28 (5.3.0-28.30~18.04.1) ...

The link that you suggested is dead. I cannot repeat the same link since I am a new user on the forum and new users are limited to post only 2 links in a post.

I did a sudo apt update; sudo apt upgrade and I need to restart the system or do something more. nvidia-smi still gives the same output:

NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

And to confirm, please note the output:

~/empty_dir$ sudo dpkg -l linux-image* linux-headers* |grep ii
ii  linux-headers-4.15.0-76                   4.15.0-76.86              all          Header files related to Linux kernel version 4.15.0
ii  linux-headers-4.15.0-76-generic           4.15.0-76.86              amd64        Linux kernel headers for version 4.15.0 on 64 bit x86 SMP
ii  linux-headers-5.3.0-28                    5.3.0-28.30~18.04.1       all          Header files related to Linux kernel version 5.3.0
ii  linux-headers-5.3.0-28-generic            5.3.0-28.30~18.04.1       amd64        Linux kernel headers for version 5.3.0 on 64 bit x86 SMP
ii  linux-headers-5.5.0-050500                5.5.0-050500.202001262030 all          Header files related to Linux kernel version 5.5.0
ii  linux-headers-generic                     4.15.0.76.78              amd64        Generic Linux kernel headers
ii  linux-image-4.15.0-76-generic             4.15.0-76.86              amd64        Signed kernel image generic
ii  linux-image-5.0.0-37-generic              5.0.0-37.40~18.04.1       amd64        Signed kernel image generic
ii  linux-image-5.3.0-28-generic              5.3.0-28.30~18.04.1       amd64        Signed kernel image generic
ii  linux-image-generic                       4.15.0.76.78              amd64        Generic Linux kernel image

Does

sudo dkms install nvidia/440.64

work now?

Hello Generix,

Yes, I could install the driver and nvidia-smi works! Thank you so much!

But for a moment it could detect the external monitor but then it just went blank.
I tried to uninstall and install gdm3, I got the login prompt on external monitor but when I entered the password and hit return it flickers and nothing happens. I can’t get in. I tried to google this issue and was trying to uncomment/comment this line in /etc/gdm3/custom.conf – 7 #WaylandEnable=false

I also uninstalled the gdm3 and after rebooting I believe it was lightdm based login. And I got the same error with infinite login loop: login session failed. So installed gdm3 and set it as default.

The output for HDMI detection and sudo dkms install nvidia/440.64

xrandr
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192
XWAYLAND0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 380mm x 210mm
1920x1080 59.96*+

sudo dkms install nvidia/440.64
[sudo] password for user2020: 

Kernel preparation unnecessary for this kernel.  Skipping...
applying patch disable_fstack-clash-protection_fcf-protection.patch...patching file Kbuild
Hunk #1 succeeded at 79 (offset 8 lines).

applying patch buildfix_kernel_5.6.patch...patching file common/inc/nv-procfs.h
patching file common/inc/nv-time.h
patching file conftest.sh
Hunk #1 succeeded at 1267 (offset -3 lines).
Hunk #2 succeeded at 2936 (offset -3 lines).
patching file nvidia-modeset/nvidia-modeset.Kbuild
patching file nvidia-uvm/nvidia-uvm.Kbuild
patching file nvidia/linux_nvswitch.c
patching file nvidia/nv-procfs.c
patching file nvidia/nvidia.Kbuild
patching file nvidia/nvlink_linux.c


Building module:
cleaning build area...
unset ARCH; [ ! -h /usr/bin/cc ] && export CC=/usr/bin/gcc; env NV_VERBOSE=1 'make' -j12 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.3.0-28-generic IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 SYSSRC=/lib/modules/5.3.0-28-generic/build LD=/usr/bin/ld.bfd modules........
cleaning build area...

DKMS: build completed.

nvidia.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.3.0-28-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/5.3.0-28-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/5.3.0-28-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/5.3.0-28-generic/updates/dkms/

depmod...

DKMS: install completed.

Please create a new nvidia-bug-report.log and attach.

Hello Generix,

sure, I have uploaded the latest bug logs. Please rename it back to nvidia-bug-report.log.gz

Thank younvidia-bug-report.log (269.6 KB)

The driver is correctly built and loaded, xorg configs look fine, yet it seems only Wayland starts. Please switch to lightdm and if it fails, create a new nvidia-bug-report.log with it.

Hello Generix,

I tried to switch to lightdm after installing it and rebooting. I could get the login screen which was different. After entering my password it gave this error: failed to start session and this was infinite.

I then proceeded with getting a terminal and setting gdm3 as the default and rebooted. I can login and get the DESKTOP-GUI. The latest bug-logs have been attached. Please let me know.

Thank you.nvidia-bug-report.log (260.7 KB)

“failed to start session” with lighdm sounds like it tries to start unity, which doesn’t exist anymore. Taking your other update problems with the kernel and your old xorg into account, there’s somthing broken in your package system.
Please try upgrading to the latest hwe:
[sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04 ](http://sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04 )
and try doing a full update.