Ubuntu 安装 GPU Caffe2
If you plan to use GPU instead of CPU only, then you should install NVIDIA CUDA 8 and cuDNN v5.1 or v6.0, a GPU-accelerated library of primitives for deep neural networks. NVIDIA’s detailed instructions or if you’re feeling lucky try the quick install set of commands below.
Update your graphics card drivers first! Otherwise you may suffer from a wide range of difficult to diagnose errors.
For Ubuntu 14.04
1. sudo apt-get update && sudo apt-get install wget -y –no-install-recommends
2. wget “http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.61-1_amd64.deb”
3. sudo apt-get update
4. sudo apt-get install cuda
For Ubuntu 16.04
1. sudo apt-get update && sudo apt-get install wget -y –no-install-recommends
2. wget “http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb”
3. sudo apt-get update
4. sudo apt-get install cuda
Install cuDNN (all Ubuntu versions)
Version 5.1
- CUDNN_URL=”http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-x64-v5.1.tgz”
- wget ${CUDNN_URL}
- sudo tar -xzf cudnn-8.0-linux-x64-v5.1.tgz -C/usr/local
- rm cudnn-8.0-linux-x64-v5.1.tgz && sudo ldconfig
Version 6.0 Visit NVIDIA’s cuDNN download to register and download the archive. Follow the same instructions above switching out for the updated library.
Be warned that installing CUDA and CuDNN will increase the size of your build by about 4GB, so plan to have at least 12GB for your Ubuntu disk size.