Ubuntu Server Installation Tensorflow-gpu

Source: Internet
Author: User

Catalogue
    • Graphics driver Installation
    • Cuda Installation
    • CUDNN Installation
    • TENSORFLOW-GPU Installation
this time using the host configuration:

CPU:i7-8700k graphics :gtx-1080ti

First, install the video driver

Open a Command Window (ctrl+alt+t)

sudo apt-get purge nvidia*sudo add-apt-repository ppa:graphics-drivers/ppasudo apt-sudoinstall nvidia-384 nvidia-settings

if the error Add-apt-repository does not exist, run the following code to resolve it:

sudo Install Software-properties-common python-software-properties

Verify that the installation is successful

Nvidia-smi

The following results show that the installation was successful

second, the installation of Cuda

As the cuda9.0+ version of the NVIDIA official website is defective, the installation option CUDA8.0

To Download the installation package:

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

After entering the download page, download CUDA8.0 (cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb) installation packages and

An upgrade package (CUDA-REPO-UBUNTU1604-8-0-LOCAL-CUBLAS-PERFORMANCE-UPDATE_8.0.61-1_AMD64.DEB)

Installation Steps :

1. Install the base package

sudo dpkg-i cuda-repo-ubuntu1604-8-0-local-ga2_8. 0.61-1_amd64.debsudo apt-get updatesudoinstall Cuda

2. Install the upgrade package

sudo dpkg-i cuda-repo-ubuntu1604-8-0-local-cublas-performance-update_8. 0.61-1_amd64.debsudo apt-get update  sudo apt-get upgrade Cuda
Set Environment variables:

Add in. 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

View the installation version

Cat /usr/local/cuda/version.txt

Output

8.0.  A
third, installation Cudnn

cuDNN6.0 and CUDA8.0 are the best partners, so this time choose cuDNN6.0

To Download the installation package :

Address: Https://developer.nvidia.com/rdp/cudnn-download

Installation:

1. Copy the downloaded compressed package to the Cuda directory

sudo CP cudnn-8.0-linux-x64-v6. 0. Tgz/usr/local/cuda

2. Enter/usr/local/cuda to unzip the file and establish the connection

tar -zxvf cudnn-8.0-linux-x64-v6. 0  sudocp cuda/include/cudnn.h/usr/local/cuda/include/sudoCP cuda/lib64/libcudnn*/usr/local/cuda/lib64/-D
View CUDNN version information:
Cat grep 2

Output

#define Cudnn_major      6#define cudnn_minor      0#define cudnn_patchlevel 21--#define cudnn_ VERSION    (cudnn_major * + Cudnn_minor * + cudnn_patchlevel)"driver_types.h "
detects if Cuda and CUDNN are installed successfully:

Go to test Catalog

// go to test Catalog:cd/usr/local/cuda-8.0/samples/1_utilities/devicequery// compilation environment   Make-J4// run:./devicequery

result = PASS indicates successful installation

iv. installation of Tensorflow-gpu
// Install the command, to install which version of TENSORFLOW-GPU, use ' tensorflow-gpu==xx ' on the line Install tensorflow-gpu==1.4// Uninstall command pip uninstall Tensorflow-gpu

Test if the GPU is installed successfully

= TF. Session (CONFIG=TF. Configproto (Log_device_placement=true))

The output has the name of the GPU, memory and other information, indicating that TensorFlow can use the GPU

Ubuntu Server Installation Tensorflow-gpu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.