Ubuntu 18.04, GeForce GTX 1060 Mobile: Unable to load the 'nvidia-drm' kernel module

This is a Dell G7 laptop purchased about 6 months ago, with Ubuntu 18.04 dual-booting with Windows. I’ve never got the 1060 drivers to work. After installing drivers from Ubuntu software system:

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

Steps I’ve taken so far:

  1. Disabled Nouveau:
    $ lspci -nnk | grep -iA2 vga 
    00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:3e9b]
    	Subsystem: Dell Device [1028:0825]
    	Kernel driver in use: i915
    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] [10de:1c20] (rev a1)
    	Subsystem: Dell GP106M [GeForce GTX 1060 Mobile] [1028:0825]
    	Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
  2. Disabled Secure Boot (Bios says Booting in Insecure Mode)
  3. Tried different versions of the drivers, starting from 390 to 418, both from Ubuntu Software and the run files from the NVIDIA site.

The latest driver I’ve tried is NVIDIA-Linux-x86_64-418.56.run. Steps I’ve followed are similar to those here.

The installer invariably exits with this message:

Unable to load the 'nvidia-drm' kernel module

The last few lines of /var/log/nvidia-installer.log:

Found libglvnd libraries: libGL.so.1 libEGL.so.1 libGLX.so.0 libGLdispatch.so.0 
   Missing libglvnd libraries: libOpenGL.so.0 
-> An incomplete installation of libglvnd was found. All of the essential libglvnd libraries are present, but one or more optional components are missing. Do you want to install a full copy of libglvnd? This will overwrite any existing libglvnd libraries. (Answer: Install and overwrite existing files)
Will install libglvnd libraries.
Will install libEGL vendor library config file to /usr/share/glvnd/egl_vendor.d
-> Searching for conflicting files:
-> done.
-> Installing 'NVIDIA Accelerated Graphics Driver for Linux-x86_64' (418.56):
   executing: '/sbin/ldconfig'...
   executing: '/sbin/depmod -a '...
-> done.
-> Driver file installation is complete.
ERROR: Unable to load the 'nvidia-drm' kernel module.
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

As recommended by the sticky, I’ve generated the nvidia-bug-report.log.gz file, but I don’t see an option of including attachments in this topic. Hopefully, I’ll be able to edit it in. Please do let me know if I can provide any additional information.
Thanks in advance.

P.S. Some additional info:

$ uname -r
$ gcc --version
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

nvidia-bug-report.log.gz (98.9 KB)
nvidia-installer.log (28.2 KB)

Please follow this:

grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*

to check if a file exists containing

blacklist nvidia
  • remove that file, then run
sudo update-iniramfs -u
  • install the package nvidia-prime
sudo apt install nvidia-prime
  • then run
sudo prime-select nvidia
  • reboot
    If it still doesn’t work, please create a new nvidia-bug-report.log

@generix: Much gratitude for the prompt help. Following the steps you’ve mentioned worked perfectly. In particular, I think nvidia was blacklisted:

$grep nvidia /etc/modprobe.d/* /lib/modprobe.d/*
/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb
/etc/modprobe.d/disable-nouveau.conf:blacklist nvidiafb
/lib/modprobe.d/blacklist-nvidia.conf:# This file was generated by nvidia-prime
/lib/modprobe.d/blacklist-nvidia.conf:blacklist nvidia
/lib/modprobe.d/blacklist-nvidia.conf:blacklist nvidia-drm
/lib/modprobe.d/blacklist-nvidia.conf:blacklist nvidia-modeset
/lib/modprobe.d/blacklist-nvidia.conf:alias nvidia off
/lib/modprobe.d/blacklist-nvidia.conf:alias nvidia-drm off
/lib/modprobe.d/blacklist-nvidia.conf:alias nvidia-modeset off
/lib/modprobe.d/nvidia-kms.conf:# This file was generated by nvidia-prime
/lib/modprobe.d/nvidia-kms.conf:options nvidia-drm modeset=1

What I did:

$ sudo mv /etc/modprobe.d/blacklist-framebuffer.conf nvidia_blacklist_files/
$ sudo mv /etc/modprobe.d/disable-nouveau.conf nvidia_blacklist_files/
$ sudo mv /lib/modprobe.d/blacklist-nvidia.conf nvidia_blacklist_files/
$ sudo mv /lib/modprobe.d/nvidia-kms.conf^Cvidia_blacklist_files/

After following all the steps:

$ nvidia-smi
Mon Apr 15 11:32:17 2019       
| NVIDIA-SMI 418.56       Driver Version: 418.56       CUDA Version: 10.1     |
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|   0  GeForce GTX 106...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   58C    P0    24W /  N/A |    263MiB /  6078MiB |      6%      Default |
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|    0      5435      G   /usr/lib/xorg/Xorg                           107MiB |
|    0      6378      G   /usr/bin/gnome-shell                         100MiB |
|    0      7060      G   ...-token=5C283C7F8D2499E2F146F757A9311B91    41MiB |
|    0      8046      G   /usr/lib/firefox/firefox                       3MiB |

While this does make me happy indeed (now I can use the graphics card…!), the immediate trigger for this question remains unsolved: I still can’t connect to an external HDMI display. Perhaps it’s best that I create a new post for that, hoping that this is the right forum for it.

Please do let me know what diagnostics/output I can include to troubleshoot HDMI input issues.
Thanks once again.

The files
are needed, please put them back and run
sudo update-initramfs -u
afterwards. Regarding the HDMI issue, please create a new nvidia-bug-report.log and attach it.

Having moved /etc/modprobe.d/blacklist-framebuffer.conf and /etc/modprobe.d/disable-nouveau.conf back and run sudo update-initramfs -u, I can confirm that everything seems to be working as it should.

Regarding HDMI output, I came across this thread, which mentions that this is perhaps a gdm3 issue. The workaround described there makes the whole system slower and hangs as well. Switching to lightdm solved the issue for me.

Thanks once again, @generix