Problems loading nvidia drivers after cuda toolkit installation

hello

I have installed cuda toolkit following the installation guide. I choose deb installation. I have ubuntu 20.4 and nvidia Geforce 820m (drivers installed 340).
Before installing cuda, when I run nvidia-smi all things worked properly. Now after the installation I see these errors:

nvidia-settings

ERROR: NVIDIA driver is not loaded

ERROR: Unable to load info from any available system

(nvidia-settings:4467): GLib-GObject-CRITICAL **: 09:38:22.181: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
** Message: 09:38:22.187: PRIME: Requires offloading
** Message: 09:38:22.187: PRIME: is it supported? yes
** Message: 09:38:22.323: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 09:38:22.323: PRIME: on-demand mode: “1”
** Message: 09:38:22.323: PRIME: is “on-demand” mode supported? yes

and when I try 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.

What i can do?

You likely installed full ‘cuda’ meta package which also installs a (most likely) incompatible driver.
The 820M is fermi based, so is supported by the 390 driver and CUDA 8 maximum.
You’ll have to purge anything cuda/nvidia now and start anew. Install the 390 driver from Ubuntu repo, then download cuda 8 and install only the meta package “cuda-toolkit” instead of full “cuda”.

I’m in serious trouble now
I cant uninstall cuda toolkit and nvidia drivers, i received this error and I don’t know what to do:

sudo apt purge nvidia-340
Reading package list … Done
Dependency tree generation
Read status information … Done
It is useful to run “apt --fix-broken install” to correct this.
The following packages have unmet dependencies:
libcuinj64-10.1: It depends: libcuda1 (> = 418.39) or
libnvidia-tesla-cuda1 (> = 418.39) but is not installable or
libcuda.so.1 (> = 418.39) but is not installable or
libcuda-10.1-1
libnvidia-ml-dev: It depends: libnvidia-ml1 (> = 418.39) or
libnvidia-tesla-440-ml1 (> = 418.39) but it is not installable or
libnvidia-tesla-418-ml1 (> = 418.39) but it is not installable or
libnvidia-ml.so.1 (> = 418.39) but it is not installable
E: Dependencies not satisfied. Try “apt --fix-broken install” without packages (or specify a solution).

Yeah, getting rid of a broken cuda install is pesky, try

sudo apt remove "cuda*" "*nivdia*"

Thanks for your help, but i receive the same error:

It is useful to run "apt --fix-broken install" to correct this.
The following packages have unmet dependencies:
 libcuinj64-10.1: It depends: libcuda1 (> = 418.39) or
                            libnvidia-tesla-cuda1 (> = 418.39) but is not installable or
                            libcuda.so.1 (> = 418.39) but is not installable or
                            libcuda-10.1-1
 libnvidia-ml-dev: It depends: libnvidia-ml1 (> = 418.39) or
                             libnvidia-tesla-440-ml1 (> = 418.39) but it is not installable or
                             libnvidia-tesla-418-ml1 (> = 418.39) but it is not installable or
                             libnvidia-ml.so.1 (> = 418.39) but it is not installable
E: Dependencies not satisfied. Try "apt --fix-broken install" without packages (or specify a solution).

you’ll have to be a bit creative, try

sudo apt remove "cuda*" "nividia*" "libnvidia*" "libcuda*" "libcuinj*"

Tried this one, same error.

EDIT*
I solved, i found in another forum, the thing to do is

sudo dpkg -P nvidia-340

then use sudo apt --fix-broken install.

So now i have to reinstall cuda with your suggest?

With your gpu, you should install the 390 driver from Ubuntu repo, then you need to download and install cuda 8, but only the toolkit. Since Cuda 8 is quite old, I’d recommend to not use the deb package but download the .run installer and skip driver install when it asks for it.
When using the deb packages, you need to install “cuda-toolkit” instead of cuda.

To install from repository, I have to run
‘’’ sudo apt install nvidia-driver-390 ‘’’

and then how can I install cuda 8 ? I’m using ubuntu 20.04, i don’t see a version of cuda 8 with ubuntu 20.04

`

click on 16.04, then chose the runfile. Run that, skip driver install.

Hi, When I try to download with runfile, i receive this warning:

“You are attempting to install on an unsupported configuration. Do you wish to continue?”

I go ahead, but when I try to uninstall

Installing the NVIDIA display driver...
Error: unsupported compiler: 9.3.0. Use --override to override this check.
Missing recommended library: libXi.so
Missing recommended library: libXmu.so
Missing recommended library: libGL.so

Error: cannot find Toolkit in /usr/local/cuda-8.0

===========
= Summary =
===========

Driver:   Installed
Toolkit:  Installation Failed. Using unsupported Compiler.
Samples:  Cannot find Toolkit in /usr/local/cuda-8.0

To uninstall the NVIDIA Driver, run nvidia-uninstall

Logfile is /tmp/cuda_install_2546.log```

Sorry, forgot about the gcc restrictions, cuda 8 needs gcc 5, don’t know if a ppa for 20.04 exists.

At this point, I think that I should thinkabout different alternatives, like colab?

Yes, you should have thought about alternatives before even starting. Your gpu is simply too old to use it for cuda in a sensible way, all modern frameworks don’t support it. It’s only useful if you want to get a glance at cuda programming basics.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.