ziyong Installing CUDA 8.0 and cuDNN 5.1 on Ubuntu 16.04

Installing CUDA 8.0 and cuDNN 5.1 on Ubuntu 16.04

Begin by downloading CUDA (runfile(local) installer)from:

and download cuDNN (you’ll need to register for the Accelerated Computing Developer Program):

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

Installing CUDA

Before CUDA can be installed you, there are a few steps you need to do otherwise you will get an error telling you an X server is running and it won’t let you install.

Control + Alt + F1

Login in with your credentials

$ sudo lightdm stop

This will end your X server

$ sudo init 3

Enter run level 3

Now install CUDA:

cd into the location you have CUDA downloaded

$ sudo sh cuda_8.0.61_375.26_linux.run

Follow the prompts. Once it has completed:

$ sudo service lightdm start

This will restart the X server.

Installing cuDNN

Next you need to uncompress and copy cuDNN to the toolkit directory. The toolkit default install location is /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*

Now you need to update your bash file

$ gedit ~/.bashrc

With the text editor open, scroll to the bottom and put in these lines:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda

Save and close it.

Now CUDA and cuDNN are installed and ready to go. If you’d like to use it with tensorflow, do a quick and easy

$ pip install tensorflow-gpu
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值