一、安裝nvidia顯卡驅動
去navidia官網查看最新的驅動版本號:navidia官網:http://www.geforce.cn/drivers

找到顯卡對應的驅動下載,例如下載的驅動為 NVIDIA-Linux-x86_64-375.82.run
ubuntu桌面環境下,按ctrl + alt +F1進入text mode 登錄賬戶,輸入下面命令,一路ok
sudo service lightdm stop sudo ./NVIDIA-Linux-x86_64-375.82.run sudo service lightdm start
會重新進入圖形桌面
點擊左邊的設置,點擊詳細信息,在圖形標簽欄是否有NVIDIA的標識,如有,則表示驅動安裝成功
二、安裝cuda-8.0
官方網站下載:CUDA Toolkit 8.0。下載網址為:https://developer.nvidia.com/cuda-80-ga2-download-archive

下載完后,執行下命令:
sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb sudo apt-get update sudo apt-get install cuda
sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-cublas-performance-update_8.0.61-1_amd64.deb sudo apt-get update sudo apt-get install cuda
這時在/usr/local目錄下產生一個cuda安裝的路徑叫"cuda-8.0"添加cuda到環境變量:
sudo vi /etc/profile
在profile的最后添加:
export CUDA_HOME=/usr/local/cuda-8.0 export PATH=$CUDA_HOME/bin:$PATH export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
使環境變量即時生效
source /etc/profile
驗證cuda是否安裝成功,輸入以下命令
nvcc --version
顯示如下表示cuda安裝成功
nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2016 NVIDIA Corporation Built on Tue_Jan_10_13:22:03_CST_2017 Cuda compilation tools, release 8.0, V8.0.61
嘗試編譯cuda提供的例子,下載cuda測試用例
sudo cuda-install-samples-8.0.sh ~/cuda_examples
cd ~/cuda_examples/NVIDIA_CUDA-8.0_Samples
sudo make -j7
cd ~/NVIDIA_CUDA-7.5_Samples/bin/x86_64/linux/release
./deviceQuery
看到類似如下圖片中的顯示,則代表CUDA安裝且配置成功
三、安裝cudnn6.0

sudo tar xvzf cudnn-8.0-linux-x64-v6.0.tgz 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* #分配包的權限
四、安裝tensorflow-gpu
sudo pip install tensorflow-gpu
五、安裝pycharm用於python開發
1、安裝pycharm
wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add - sudo sh -c 'echo "deb http://archive.getdeb.net/ubuntu trusty-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list' sudo apt-get update sudo apt-get install pycharm
2、安裝pycharm的jdk環境
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
六、參考鏈接
http://blog.csdn.net/u012969412/article/details/64502393
http://blog.csdn.net/masa_fish/article/details/51882183
http://blog.csdn.net/qingche456/article/details/65446661
