1.下载CUDA Toolkit
https://developer.nvidia.com/cuda-toolkit-archive
2.按照命令下载,安装
3.环境变量
vim ~/.bashrc
最后面添加
export PATH="/usr/local/cuda-12.1/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda-12.1/lib64:$LD_LIBRARY_PATH"
退出,刷新
source ~/.bashrc
检查
nvcc -V
4.Removing CUDA Toolkit and Driver
Ubuntu and Debian
To remove CUDA Toolkit:
sudo apt-get --purge remove "*cuda*" "*cublas*" "*cufft*" "*cufile*" "*curand*" \
"*cusolver*" "*cusparse*" "*gds-tools*" "*npp*" "*nvjpeg*" "nsight*" "*nvvm*"
To remove NVIDIA Drivers:
sudo apt-get --purge remove "*nvidia*" "libxnvctrl*"
To clean up the uninstall:
sudo apt-get autoremove
5.官方文档
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/contents.html
6.安装cuddn
https://developer.nvidia.cn/rdp/cudnn-archive
标签:ubuntu,remove,apt,cuda,https,nvidia,PATH,安装 From: https://www.cnblogs.com/vicsee/p/18314750