想學深度學習,先會安裝cuda吧(ubuntu16.04+cuda8.0)
1. Download cuda包和cudnn包
# cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb cudnn-8.0-linux-x64-v5.1.tgz
# https://developer.nvidia.com/cuda-downloads
# https://developer.nvidia.com/cudnn
2. sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
# 解壓cuda包
3. sudo apt-get update
# 更新Apt倉庫
4. sudo apt-get install cuda
# 安裝cuda
sudo apt install nvidia-cuda-toolkit
#ubuntu16.04自帶的7.5版本,此時安裝好的是7.5,第七步再指定到8.0
5. nvcc --version
# 查看nvcc是否安裝
6. 安裝cudnn
# which nvcc,可以查看cuda的安裝路徑,本栗子中為/usr/local/cuda-8.0
# tar xvf cudnn-8.0-linux-x64-v5.1.tgz,解壓到當前目錄cuda/中
sudo cp cuda/include/cudnn.h /usr/local/cuda-8.0/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64
sudo chmod a+r /usr/local/cuda-8.0/include/cudnn.h /usr/local/cuda-8.0/lib64/libcudnn*
7. 環境設置,修改~/.bashrc
export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64:/usr/lib/nvidia
# /usr/lib/nvidia應該指定到你的顯卡驅動版本
export CUDA_HOME=/usr/local/cuda-8.0
推薦閱讀:
TAG:深度學習DeepLearning | CUDA | Ubuntu |