What is the correct way to uninstall old CUDA versions? (Ubuntu 16.04 LTS local)

Linux experts please advise.

Inside /usr/local I see cuda-8.0, cuda-9.1, and cuda-9.2. I want to get rid of them to free disk space, all without breaking cuda-10.0 which also resides in /usr/local.

  • Every time I google for solutions I find 25 different answers, each of which worked for some readers and failed for others.
  • There is no uninstall script in any of the bin sub-directories.
  • I do not recall how I originally installed them.
  • cuda 10 is listed in the conda environment I use for fastai, but not the other unused cuda’s. Nor are they listed in base.
  • I am a Linux ignoramus.

Thanks for any help!

I never got a reply, so stumbled ahead into the fog.

Synaptic Package Manager is a graphical front-end to apt, appropriate for us GUI dinosaurs. I used it to remove every package that mentioned CUDA 9.1 or CUDA 9.2. This was done by selecting each package (about 40 of them), hitting Delete, then Apply.

SPM never listed CUDA 8 as installed. I removed it by force with “sudo rm -rf CUDA-8.0”. (Maybe removing the other CUDAs by force would have worked; I don’t know)

All the obsolete CUDAs are now gone from usr/local, 10 GB freed up, and, miraculously, fastai still works. Miraculously, because I have no idea how all this fits together, and no recovery plan.

Conda list for fastai2 now shows
cudatoolkit 10.0.130 0
cudnn 7.6.0 cuda10.0_0

A few questions…

  1. Are these parts of CUDA stored in usr/local or in the Conda environment site packages?

  2. Suppose I want to update to CUDA 10.2 without breaking anything. anaconda.org suggests

conda install -c nvidia cudatoolkit (v10.2.89)

What do you think? Is it worth the risk?

  1. Will installing cudatoolkit as above also update cudnn? Or are they separate things?

Thanks for any help or advice.