nvidia-smi 查看当前驱动
https://developer.nvidia.com/cuda-toolkit-archive
选择匹配的驱动下载.run文件
sudo sh cuda****
如果已经安装过显卡驱动,就不要再重复安装驱动了,按enter取消driver
Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-12.4/
Please make sure that
- PATH includes /usr/local/cuda-12.4/bin
- LD_LIBRARY_PATH includes /usr/local/cuda-12.4/lib64, or, add /usr/local/cuda-12.4/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-12.4/bin
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 550.00 is required for CUDA 12.4 functionality to work.
To install the driver using this installer, run the following command, replacing
sudo
Logfile is /var/log/cuda-installer.log
vim ~/.bashrc
export PATH=$PATH:/usr/local/cuda-12.4/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.4/lib64
安装cuda就可以使用nvcc -V来查看了,就有了运行环境
安装cudnn,可以更加充分的利用显卡的能力