参考地址:

英伟达官网文档:https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#removing-cuda-toolkit-and-driver

Ubuntu

卸载 CUDA Toolkit:

sudo apt --purge remove "*cuda*" "*cublas*" "*cufft*" "*cufile*" "*curand*" "*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*"

卸载 NVIDIA 驱动Drivers:

sudo apt-get --purge remove "*nvidia*" "libxnvctrl*"

卸载后的清理:

sudo apt-get autoremove