Tesla

Subscribe
SPEED UP TRAINING WITH GPU-ACCELERATED TENSORFLOW
The fastest, easiest way to get started with deep learning on GPUs
Speed Up Training with GPU-Accelerated TensorFlow
System Requirements

The GPU-enabled version of TensorFlow has the following requirements:

  • 64-bit Linux
  • Python 2.7
  • NVIDIA CUDA® 7.5 (CUDA 8.0 required for Pascal GPUs)
  • NVIDIA cuDNN v4.0 (minimum) or v5.1 (recommended)

You will also need an NVIDIA GPU supporting compute capability 3.0 or higher.

Download and Installation Instructions

TensorFlow is now distributed under an Apache v2 open source license on GitHub.

 

Step 1. Install NVIDIA CUDA

To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit.

Step 2. Install NVIDIA cuDNN

Once the CUDA Toolkit is installed, download and install the cuDNN v5.1 Library for Linux (note that you will need to register for the Accelerated Computing Developer Program).

Step 3. Install and upgrade PIP

TensorFlow itself can be installed using the pip package manager. First, make sure that your system has pip installed and updated:

$ sudo apt-get install python-pip python-dev
$ pip install --upgrade pip

Step 4. Install TensorFlow Python Package

Run the following command to install the TensorFlow Python package using pip:

$ pip install --upgrade tensorflow-gpu

Step 5. Test your Installation

To test the installation, open an interactive Python shell and import the TensorFlow module:

$ python
...
>>> import tensorflow as tf I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally

With the TensorFlow module imported, the next step to test the installation is to create a TensorFlow Session, which will initialize the available computing devices and provide a means of executing computation graphs:

>>> sess = tf.Session()

To manually control which devices are visible to TensorFlow, set the CUDA_VISIBLE_DEVICES environment variable when launching Python. For example, to force the use of only GPU 0:

$ CUDA_VISIBLE_DEVICES=0 python

You should now be able to run a Hello World application:

>>> hello_world = tf.constant("Hello, TensorFlow!")
>>> print sess.run(hello_world)
Hello, TensorFlow!
>>> print sess.run(tf.constant(123)*tf.constant(456))
56088

GET IT UP AND RUNNING