How to uninstall CUDA Toolkit and cuDNN under Linux?

I have downloaded and installed the CUDA Toolkit 8 and cuDNN 5.1 for Ubuntu; now I would like to update to the latest release, and be sure the latest release is the only one installed on my system. How can I completely remove the currently installed CUDA Toolkit and cuDNN?

Thanks!

If you installed using the package manager method, instructions for uninstall are contained in the linux install guide. If you installed via package manager, you would use a remove call to your package manager.

[url]Installation Guide Linux :: CUDA Toolkit Documentation
[url]Installation Guide Linux :: CUDA Toolkit Documentation

cuDNN is just installed by dropping files onto your system. Study the install and delete those files.

4 Likes

Thank you for the link!

I have managed to uninstall CUDA with apt purge, and cuDNN just removing the directory where I had copied its libraries.

This might seem very trivial but I am very new to CUDA and stuuf. So I installed CUDA 9.0 and cudnn 7, but later I found out that I require CUDA 8 and cudnn 6 in my environment. So I would like to uninstall CUDA 9 and cudnn 7. I installed using the package manager. The installation document asks to use the following code to uninstall:

sudo apt-get --purge remove <package_name>

But what exactly is a ¨package_name¨, I dont know about that. May be a sample code will help.

Thanks a lot in advance.

<package_name> refers to the version of CUDA you installed. In your case, as you have installed CUDA 9.0 the command you should use is:

sudo apt-get --purge remove cuda-9.0

Hope it helps.

3 Likes

It worked, thanks a lot.

1 Like

@robert_crovella the file/script that’s supposed exist in the instructions you cite, doesn’t exist.
“sudo /usr/local/cuda-10.2/bin/cuda-uninstaller”

2 Likes

That file is only present if there was a runfile install. If it was a package manager install, that file won’t be present. If you read the cuda linux install guide, you can discover this as well.

1 Like

Hey,

I come to this to uninstall a cuda-11.3 install since I cannot figure out why nvcc -V does not work. I try the uninstallation commands, but I realised that there is no uninstallation script within the path: /usr/local/cuda-11.3/bin

Can you please help with the same?

Regards,
Harsh Songara

2 Likes

I had the same issue.

1 Like

same here

I install cuda11.5 with runfile. But there is NOT a cuda-uninstaller. cuda11.1 is also installed on my machine, I can find the cuda-uninstaller of it.

2 Likes

I just installed cuda 11.5 with runfile installer. The file /usr/local/cuda-11.5/bin/cuda-uninstaller is present on my machine. I can’t explain what may have happened on your machine. For others on this thread and future readers, the specific path will change depending on the actual cuda version you have installed. The cuda-11.5 portion of the path will be different depending on which version of CUDA you have. Again, this file will only be present if you used the runfile install method to install CUDA.

I had the same issue with CUDA 11.x on Ubuntu 22.04, there was not any ‘cuda-uninstaller’ in my bin dir! Maybe because I only installed the toolkit without the bundled driver and samples etc…! But here’s what worked for me:

  1. Run the .run file with the --extract=ANY_ABSOLUTE_PATH to extract the uninstaller
  2. Then you can find the cuda-uninstaller in the above given path inside the ‘bin’ dir, run it and select which cuda versions you’d like to uninstall
4 Likes

This worked for me, thanks! This should be an accepted answer.

1 Like

This worked for me, as I also didn’t install everything, only toolkit and cuda-uninstaller was not present.

1 Like

where is the .fun file?

works like a charm! thx a lot! save my day!

1 Like