tensorflow+cuda+cudnn配置

一、tensorflow

通过虚拟环境安装tensorflow,官网

二、cuda

官网下载 CUDA Toolkit Archive,选择 CUDA Toolkit 8.0 GA1 (Sept 2016),下载 runfile 文件 cuda_8.0.44_linux.run。

cuda

runfile 安装
sudo chmod a+x cuda_8.0.44_linux.run
sudo ./cuda_8.0.44_linux.run
 

Description

This package includes over 100+ CUDA examples that demonstrate
various CUDA programming principles, and efficient CUDA
implementation of algorithms in specific application domains.
The NVIDIA CUDA Samples License Agreement is available in
Do you accept the previously read EULA?
accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 367.48?
(y)es/(n)o/(q)uit: n

Install the CUDA 8.0 Toolkit?
(y)es/(n)o/(q)uit: y

Enter Toolkit Location
 [ default is /usr/local/cuda-8.0 ]:

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y

Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
 [ default is /home/c302 ]:

Installing the CUDA Toolkit in /usr/local/cuda-8.0 ...
Installing the CUDA Samples in /home/c302 ...
Copying samples to /home/c302/NVIDIA_CUDA-8.0_Samples now...
Finished copying samples.

三、添加环境变量

打开 ~/.bashrc 添加

export PATH=/usr/local/cuda-8.0/bin:$PATH
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda

四、安装 cuDNN

官网下载 NVIDIA cuDNN

解压并放到相应位置

tar xvzf cudnn-8.0-linux-x64-v5.1-ga.tgz
sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

 

你可能感兴趣的:(人工智能,机器学习)