Ubuntu 16 server ?????? tensorflow-GPU

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu 16 server ?????? tensorflow-GPU相关的知识,希望对你有一定的参考价值。

?????????blank   tensor   log   pkg   pass   strong   graph   img   ??????   

??????

???????????????????????????

cpu???i7-8700K     ?????????GTX-1080Ti

????????????????????????

?????????????????????ctrl+Alt+T???

sudo apt-get purge nvidia*

sudo add-apt-repository ppa:graphics-drivers/ppa

sudo apt-get update 

sudo apt-get install nvidia-384 nvidia-settings

????????????add-apt-repository???????????????????????????????????????

 

sudo apt-get install software-properties-common python-software-properties

 

????????????????????????

nvidia-smi

????????????????????????????????????

??????????????????

????????????CUDA

????????????NVIDIA????????????CUDA9.0+?????? ?????????????????????????????????CUDA8.0

??????????????????

?????????https://developer.nvidia.com/cuda-80-ga2-download-archive

??????????????????

??????????????????

??????????????????????????????CUDA8.0???cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb???????????????

??????????????????cuda-repo-ubuntu1604-8-0-local-cublas-performance-update_8.0.61-1_amd64.deb???

???????????????

1??????????????????

sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda

 

2??????????????????

sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-cublas-performance-update_8.0.61-1_amd64.deb
sudo apt-get update  
sudo apt-get upgrade cuda

?????????????????????

???.bashrc?????????

export PATH=/usr/local/cuda/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export CUDA_HOME=/usr/local/cuda

??????????????????

cat /usr/local/cuda/version.txt

??????

CUDA Version 8.0.61

????????????cuDNN

cuDNN6.0???CUDA8.0?????????????????????????????????cuDNN6.0

??????????????????

?????????https://developer.nvidia.com/rdp/cudnn-download

??????????????????

?????????

1?????????????????????????????????CUDA??????

sudo cp cudnn-8.0-linux-x64-v6.0.tgz /usr/local/cuda

 

2?????????/usr/local/cuda?????????????????????????????????

tar -zxvf cudnn-8.0-linux-x64-v6.0.tgz 
sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/ -d

??????cuDNN???????????????

cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

??????

#define CUDNN_MAJOR      6
#define CUDNN_MINOR      0
#define CUDNN_PATCHLEVEL 21
--
#define CUDNN_VERSION    (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

#include "driver_types.h"

??????CUDA???cuDNN?????????????????????

??????????????????

//?????????????????????
cd /usr/local/cuda-8.0/samples/1_Utilities/deviceQuery

//????????????
make -j4

//?????????
./deviceQuery

????????????Result = PASS ??????????????????

??????????????????

????????????tensorflow-gpu

//???????????????????????????????????????tensorflow-gpu????????? ???tensorflow-gpu==xx????????????
pip install tensorflow-gpu==1.4

//????????????
pip uninstall tensorflow-gpu

??????gpu??????????????????

import tensorflow as tf
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))

???????????? GPU????????????????????????????????????tensorflow????????????GPU???

??????????????????

 

以上是关于Ubuntu 16 server ?????? tensorflow-GPU的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu Server 14.04升级Ubuntu Server 16.04

VMware安装Ubuntu 16.4.6 Server

在Ubuntu 16.10 Server 上部署 Moodle

ubuntu-server16.04.6安装完成后开机黑屏只有光标闪烁

ubuntu16.04 server(amd 64) 下载

安装ubuntu-server16.0,设置WiFi