由于需要安装cuda8.0,,所以需要卸载cuda7.5:
在/usr/local/cuda/bin
目录下,有cuda
自带的卸载工具uninstall_cuda_7.5.pl
cd /usr/local/cuda/bin
sudo ./uninstall_cuda_7.5.pl
9.1卸载: 两种方法
1.
9.1 uninstall:
sudo /usr/local/cuda-9.1/bin/uninstall_cuda_9.1.pl
sudo /usr/bin/nvidia-uninstall
然后重启
$ sudo reboot
重新安装.run(安装时请留心,在提示是否安装OpenGL时,应该选no)
第2种方法,在命令行中输入
sudo apt-get remove cuda
sudo apt-get autoclean
sudo apt-get remove cuda*
然后在目录切换到/esr/local/下
cd /usr/local/
sudo rm -r cuda-9.1
搞定啦
cuda 8
卸载之后,还有一些残留的文件夹,之前安装的是CUDA 8.0。可以一并删除:
cd /usr/local/
rm -rf cuda-8.0/
卸载NVIDIA驱动方法:
关闭显卡驱动
sudo service lightdm stop
该命令会关闭lightdm。如果你使用 gdm或者其他的desktop manager, 请在安装NVIDIA驱动前关闭他。 使用如下命令卸载NVIDIA驱动:
sudo apt-get remove nvidia*
这条命令会卸载与NVIDIA相关的一切,注意如果此时重新启动电脑可能会导致无法进入系统。也有另一种卸载方式:
sudo apt-get remove --purge nvidia-*sudo apt-get install ubuntu-desktopsudo rm /etc/X11/xorg.confecho 'nouveau' | sudo tee -a /etc/modules
一定卸载干净才可以重装cuda。否则会报错,例如: