从 Ubuntu 中彻底删除 CUDA 安装及 NVIDIA GPU 驱动

卸载通过 runfile 安装的程序和驱动

Use the following command to uninstall a Toolkit runfile installation:

sudo /usr/local/cuda-X.Y/bin/cuda-uninstaller

Use the following command to uninstall a Driver runfile installation:

sudo /usr/bin/nvidia-uninstall

卸载通过包管理器安装的程序和驱动

sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get remove --purge '^libnvidia-.*'
sudo apt-get remove --purge '^cuda-.*'