Take cuda-9.0 as an example
sudo /usr/local/cuda-9.0/bin/uninstall_cuda_9.0.pl
This will not delete the manually added cudnn file, you need to delete it yourself
sudo rm -rf /usr/local/cuda-9.0
Take cuda-9.0 as an example
sudo /usr/local/cuda-9.0/bin/uninstall_cuda_9.0.pl
This will not delete the manually added cudnn file, you need to delete it yourself
sudo rm -rf /usr/local/cuda-9.0