Ubuntu上CUDA环境搭建
0.好像装CUDA会自动装nvidia驱动,所以可以尝试直接装CUDA
0.1 可以尝试通过sudo apt install nvidia-cuda-toolkit来安装CUDA
1.下载CUDA:https://developer.nvidia.com/cuda-toolkit-archive (如果已经安装了N卡驱动,最好用.deb,如果没有安装,可以用.run)
2.根据官网提示安装CUDA
添加配置:
export PATH=$PATH:/usr/local/cuda/bin export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH export CUDA_ROOT=/usr/local/cuda/ export LD_LIBRARY_PATH=/opt/cudnn/lib64:$LD_LIBRARY_PATH export LIBRARY_PATH=$LIBRARY_PATH:/opt/cudnn/lib64 export CPATH=$CPATH:/opt/cudnn/include
3.下载Cudnn: https://developer.nvidia.com/rdp/cudnn-download
4.执行sudo dpkg -i libcudnn7-dev_7.0.3.11-1+cuda9.0_amd64.deb (更多安装方法:https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/Doc/cuDNN-Developer-Guide)
安装Nvidia驱动:http://www.cnblogs.com/huangshiyu13/p/8970602.html
训练时设置GPU个数:https://www.cnblogs.com/huangshiyu13/p/6479916.html
黄世宇/Shiyu Huang's Personal Page:https://huangshiyu13.github.io/