25

(I'm aware there are several questions with a similar title but they either don't have answers, are very old or don't apply to my situation.)

I'm using Ubuntu 18.04.2, my GPU is a GeForce 840M and the driver version is nvidia-driver-430 (installed from the Softwares and updates panel)

So I can't seem to use the nvidia gpu anymore. I have no idea what caused this.

sudo nvidia-settings

gives the following output:

ERROR: NVIDIA driver is not loaded ERROR: Unable to load info from any available system

It does open an Nvidia panel but without the usual settings and just the two PRIME profiles (Nvidia performance mode and intel power saving mode ).

sudo nvidia-smi

gives the following error :

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

I've tried a few things like purging and reinstalling the driver or using an older one , with no luck. I've also tried downloading and running the .run driver from the nvidia website but it failed to install.

I'm looking for advice on what to try next to have it working again. Thanks for your help :)

EDIT:

 uname -r

4.15.0-52-generic

 dkms status

nvidia, 430.26, 4.15.0-52-generic, x86_64: installed

 apt-cache policy nvidia-driver-430
nvidia-driver-430:
  Installed : 430.26-0ubuntu0~gpu18.04.1
  Candidate : 430.26-0ubuntu0~gpu18.04.1
 Version table :
 *** 430.26-0ubuntu0~gpu18.04.1 500
        500 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
2
  • dkms status and uname -r It seems to me the driver is from a external source. apt-cache policy nvidia-driver-430
    – nobody
    Jun 22, 2019 at 7:22
  • Thanks for your help ! I added the commands' results to the post.
    – user869841
    Jun 22, 2019 at 7:36

12 Answers 12

14

After checking:

  • BIOS
  • prime-select nvidia
  • nvidia-driver-XXXX package installed
  • uname -r header packages installed

and it was not working.

So the driver wasn't compiled for my kernel version. So I just did a

$ dpkg-reconfigure nvidia-dkms-4XX

and rebooted.

2
  • This works! Thanks. Apr 22, 2021 at 14:45
  • Thanks!! Worked for me too. Ubuntu 20.04 on mainline Kernel 5.11.16 and nvidia driver 460. May 2, 2021 at 22:32
8

Please try a simply reinstall sudo apt install --reinstall nvidia-driver-430 If you boot in uefi-mode deactivate secure-boot if it is set, before.

6
  • I reinstalled the driver and rebooted , but the driver isn't loaded :( I boot in legacy mode
    – user869841
    Jun 22, 2019 at 9:11
  • This should be worth candy at the local store. Oct 2, 2020 at 15:03
  • I would add that you should then reboot, even if secure boot is already off. :) Oct 2, 2020 at 15:04
  • Huh, this actually worked for me, although it did install v450 instead of v430 for some reason.
    – xjcl
    Mar 21, 2021 at 17:10
  • 2
    The reason this keeps happening, I found out today, is that Software Updater keeps bumping the kernel without reconfiguring the dependent packages. Jun 6, 2021 at 3:33
6

Been recently running into this problem, so it may be related to a recent update.

Give this a try:

sudo prime-select nvidia

sudo rm /lib/modprobe.d/blacklist-nvidia.conf /etc/modprobe.d/blacklist-nvidia.conf

sudo update-initramfs -u

Reference here

I'm able to boot with dual-monitors, indicating that the GPU ( GTX 970 in my case) is being utilized. However, running into other bugs.

3
  • 1
    Hey, thanks a lot for your help! Unfortunately I've already tried this before: prime is already set to NVIDIA and the blacklist.conf files don't even exist ...
    – user869841
    Jun 22, 2019 at 6:06
  • Did you ever get it working? I just realized that this may not be the best solution, given that yours is a laptop GPU. I've had trouble making my portable Ubuntu utilize my laptop's GPU too. Maybe you'll have better luck though. Look into Linux's Bumblebee project to utilize Nvidia Optimus
    – lafcadio
    Jul 9, 2019 at 22:42
  • nah, i gave up on the issue and did a fresh install. i'm using the default driver for now. thanks for caring though, and i'll look into Bumblebee
    – user869841
    Jul 14, 2019 at 22:56
3

I had this exact problem, tried every fix I could find but nothing worked. I tried turning off Secure Boot to configure something and it worked. Just turn off Secure Boot and see if that fixes it.

3
  • 1
    I've had the same trouble and what i did is simply disabled secure boot in BIOS settings. That was it, no driver reinstall or whatever was needed
    – ololo
    Jun 25, 2020 at 11:41
  • 1
    To everyone who got this far and still couldn't solve the issue after trying everything else here,turning off secure boot worked instantly for me (I have NVidia driver 450 on Ubuntu 20.04, HP workstation). Now both of my monitors are recognized and <b>sudo nvidia-settings works </b> as it should (as ololo suggested).
    – DKaukonen
    Oct 28, 2020 at 9:57
  • 1
    I've tried everything, including reinstalling graphics drivers and Nvidia drivers only loaded up after disabling Secure Boot. Dec 1, 2020 at 12:38
2

Upgrading from kernel 5.0 to 5.3 the driver nvidia 390 work not properly. Upgrade to nvidia 430 driver is not possible for dependencies not satisfied.

From terminal I use the command:

 sudo ubuntu-drivers autoinstall

and the shell lists all dependencies not satisfied. I take the first not satisfied dependence and use the command

 sudo apt-get install <first dependence>

(maybe that shell lists another dependencies not satisfied, so i take the first and repeat the command)

The shell now install the dependence 430 and uninstall the packages of 390. After installation I repeat the command

 sudo ubuntu-drivers autoinstall

and the shell provides to install all packages of 430 drivers.

Finally I reboot the system and the new drivers 430 works properly.

Probably until at least one 430 driver package is installed, the system is not able to start installation of new driver.

1

Had same problem. Run the following commands:

sudo prime-select intel
sudo reboot

sudo prime-select nvidia
sudo reboot
0

I experienced this error when trying to reduce the load on my Nvidia card by selecting my internal graphics within nvidia-settings -> PRIME Profiles -> Select GPU -> Intel (not NVIDIA). This did not have the desired effect as it's not possible to use CUDA on the NVIDIA card without the NVIDIA profile enabled.

It's not immediately obvious how to switch it back to the nvidia profile.

To ensure the NVIDIA profile is enabled:

sudo prime-select nvidia

nvidia-settings should now work

0

same problem as here it appears the headers for kernel 4.15.0-112-generic did not install/update. To fix this just run command:

sudo apt install linux-image-4.15.0-112-generic linux-headers-4.15.0-112-generic
And reboot

0

I too had this problem, nvidia driver was working until it wasn't for no apparent reason, and nvidia-settings gave the ERROR: NVIDIA driver is not loaded.

I tried to install a new driver manually, downloaded from nvidia website, and their installer gave me a valuable error: unable to find the kernel source tree.

running apt install linux-headers-xxx where xx is your kernel version, such as in my case apt install linux-headers-5.4.0-42-lowlatency, fixed the problem for me.

Same solution is suggested here: 20.04 Focal - Nvidia driver no longer loading with kernel 5.4.0-42

0

Same with me, another solution for those who already tried answers above:

sudo apt install --install-recommends linux-generic-hwe-20.04

Work for me, I think the problem is the compatibility between linux header and nvidia driver. For more detail, plz refer to:

https://forums.developer.nvidia.com/t/2nd-monitor-blank-x-cursor-ubuntu-20-04/156103

0

(Ubuntu 20.04) Fixed with this simple command.

Fix broken drivers and dependencies:

sudo apt --fix-broken install
prime-select nvidia
sudo reboot
0

I had the same issue and a combination of these posts worked for me:
How to inspect the currently used Nvidia driver version and switch it to another alternative?
How do I know which NVIDIA driver I need?

I did the following:
apt-cache search nvidia | grep -P '^nvidia-(driver-)?[0-9]+\s'
This gave me a list of several drivers, so I went installing one by one, until I got to the right one;
sudo apt-get install nvidia-driver-XXX

After that, I could see my nVidia GPU in both hardinfo, dkms status and ubuntu-drivers devices (something I couldn't before).
However, nvidia-settings and nvidia-smi didn't work (which meant that the driver wasn't properly loaded).

Finally, I did an ubuntu-drivers autoinstall and rebooted the system.
Now, everything works fine!

You must log in to answer this question.