How do i completly remove an Nvidia driver by hand?

I use a GF108M [GeForce GT 620M/630M/635M/640M LE] and (want to) use the nvidia-driver-390. However if i install this driver (via package manager) i get an error from nvidia-smi, complaining about a version missmatch (API mismatch: the client has the version 470.86, but this kernel module has the version 390.157.). This is the version from a nvidia driver thats seems to be partly somehow installed.

If i use the installer from nvidia (NVIDIA-Linux-x86_64-390.157.run) i do not get this problem, but i would prefer to use the package manager version. If i uninstall this driver and reinstall the package manager version, then the problem reappears.

I also tried to install and uninstall the expected version (NVIDIA-Linux-x86_64-470.86.run), but this one ofcourse does not support my graphics card, so the installation does not complete and i cant uninstall whatever is causing this version missmatch.

My current best lead: How/Where can i find the file that the NVRM API gets its client version? Or better: how can i clean these remains of the wrong driver?

What i have tried:

  • Restart
  • purge and reinstall packages (390 and 470) (also checked dpkg)
  • install and uninstall 390 (the correct one) and 470 (the problem one) Nvidia drivers from runfiles
  • Regenerate Kernel images
  • Reinstall Kernels

What i have
Ubuntu 22.04 5.15.0-56-generic #62-Ubuntu
GeForce GT 630M
With the package manager driver:
NVIDIA System Management Interface – v390.157
$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module 390.157 Wed Oct 12 09:19:07 UTC 2022
GCC version:
$ cat /sys/module/nvidia/version
390.157
$ modinfo nvidia | grep version
version: 390.157
srcversion: 969136205C7AF53C6F7D4AE
vermagic: 5.15.0-56-generic SMP mod_unload modversions
$ sudo dmesg
[ 348.574962] NVRM: API mismatch: the client has the version 470.86, but
NVRM: this kernel module has the version 390.157. Please
NVRM: make sure that this kernel module and all NVIDIA driver
NVRM: components have the same version.

If you used the .run file installer, you need to run it again with the --uninstall option.
Then purge the driver with apt.
Make sure you don’t have any remnants left: dpkg -l |grep nvidia
Purge those, if any.
Then use apt to install the 390 driver.

I do not know how that driver got here, but suspect it was with a .run file.
I already ran the runfile with the uninstall, but it complains it cant uninstall what isnt there. I also purged everything and checked all dpkgs

Try searching for leftovers with something like this

find /usr/lib -iname "*nvidia*"

and manually delete the libs.

1 Like

Thank you, that did it!
after a purge i used this and found a bunch of files with 470.86 in their name.
I used sudo find /usr/lib -iname "*nvidia*470\.86" -delete to delete them and sudo find /usr/lib -iname "*nvidia*\.ko" -delete to delete other nvidia files that sould not be there, leaving only things like NvidiaDetector.
Reinstall the correct driver & reboot and not it works
Thanks again!

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