欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

ubuntu16.04LTS安装cuda9.0、cudnn7和tensorflow1.5

程序员文章站 2022-05-27 14:41:00
...

1.安装GeForce驱动程序

All Settings Software & Update Additional Drivers 
2.安装cuda8.0
下载cuda安装包 .runfile
sudo sh .runfile
由于之前设置好了显卡驱动,因此在Install NVIDIA Accelerated Graphics Drivers for Linux-x86_64时选择No
安装完成后,键入nvcc -V查询cuda版本号,如果nvcc还没装,键入sudo apt install nvidia-cuda-toolkit
3.安装cuDNN
下载cuDNN安装包,解压,键入:
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
4.配置环境变量
sudo gedit ~/.bash_profile
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
source ~/.bash_profile

5.安装pip

sudo apt-get install python-pip python-dev

6.安装tensorflow

sudo pip install tensorflow