tensorflow的GPU配置

以Ubuntu系统为例:

1、首先安装Cuda Toolkit
下载地址:https://developer.nvidia.com/cuda-downloads
安装步骤:

# Install repository meta-data:
sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
# Update the Apt repository cache:
sudo apt-get update
# Install CUDA:
sudo apt-get install cuda

2、安装cuDNN
下载地址:https://developer.nvidia.com/cudnn
配置步骤(假设Cuda toolkit安装在/usr/local/cuda):

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*

3、安装其他依赖

sudo apt-get install libcupti-dev

4、安装支持gpu版本的tensorflow

pip install tensorflow-gpu

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注