Cuda and Nvidia drivers failing to install on ubuntu

Ok, so I normally never post on these forums but after about a week of reading forums and attempting to fix the problem on my own I have to ask for external help. Just as a note, my laptop is dual boot to windows and ubuntu and the driver works fine on windows but I want to load it on ubuntu for computing projects for my classes.

Here is the current problem: the Nvidia driver on my ubuntu laptop is currently installed but not loading. Here are the current stats on my laptop.

Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

My graphics card on the laptop is GeForce RTX 2060. Here is some information about my graphics card after running the command “sudo lshw -c video”

*-display UNCLAIMED       
       description: VGA compatible controller
       product: NVIDIA Corporation
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list
       configuration: latency=0
       resources: memory:c3000000-c3ffffff memory:b0000000-bfffffff memory:c0000000-c1ffffff ioport:4000(size=128) memory:c2000000-c207ffff
       description: VGA compatible controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:158 memory:c5000000-c5ffffff memory:a0000000-afffffff ioport:5000(size=64) memory:c0000-dffff

I have attempted to install the latest graphics driver versions using the following commands

sudo apt-get install nvidia-driver-340 nvidia-cuda-toolkit

Although after installing the nvidia driver, I get an error after running the nvidia-smi command

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

Now, when I try to install the nvidia driver from the run file that I download from the nvidia website I get the error Unable to load the ‘nvidia-drm’ kernel module which seems odd to me because I have disabled secure boot.

I have run the debug repot and attached the results to this post

/usr/bin/ --safe-mode --extra-system-data

Here is a link to the bug report (not sure how to attach files but added a link to my google drive where I uploaded the file).

As an additional note, I added the commands nouveau.modeset=0 nvidia-drm.modeset=1 to my grub boot sequence as per what I had found worked for other people online. It may be that my ubuntu installation is corrupted and I need to reinstall but I would like to know if there is any way to address this problem. If you need any more information from my system or anything else I should do please respond with more information.

That isn’t the latest driver nor will that driver (nvidia-driver-340) work with a RTX2060.

These are ubuntu-provided install methods, not NVIDIA. If you want help with an ubuntu-provided install method, you may wish to ask on

Installing a nvidia-provided runfile installer after using a package manager method (sudo apt-get …) to install a driver is a no-no.

You may wish to read the linux install guide:

Hello, I attempted to follow the instructions to load the drivers via a run file and ran into the following error. This is using the installation script.

Unable to load the 'nvidia-drm' kernel module.


Yes, I forgot to mention, I completely purged the nvidia libraries on my computer with the command

apt-get --purge remove "*nvidia*"

And then rebooted, loaded the OS in text only mode and attempted to reinstall the graphics drivers with the run file and encountered the same error. It seems to be associated with secure boot but I have that disabled so I am not sure why it is causing problems here.

My general advice would be as follows:

  • disable secure boot
  • reload ubuntu 18.04 OS (alternative, study the linux install guide on “handle conflicting installs”)
  • choose a deb installer method from, use latest CUDA version
  • follow instructions carefully in linux install guide for ubuntu package manager install

This isn’t guaranteed to work in every case, but in my experience it has the highest probability of success.

Laptops occasionally present extra challenges because they employ (usually) an optimus GPU cooperation system between intel iGPU and NVIDIA dGPU. You can google for instructions about this, occasionally using something like nvidia-prime is useful. Different laptops have slightly different designs which may behave differently.

Ok, I’ll give this a try. I haven’t reloaded the OS yet but that seems like it would be the best option. Do I need to install the nvidia drivers before installing the cuda or does the cuda driver install the nvidia drivers as part of its setup? Thanks for all the help and I will post an update later on how it worked out for me.

The cuda installer will install the driver if you follow the instructions given in the linux install guide.

I reinstalled ubuntu and installed using the deb installer instructions and it works great. Thansk for all the help.