Skip to content

Notes and links to install TansorFlow GPU | Нотатки та посилання для компіляції і встановлення TensorFlow для графічного процесора

Notifications You must be signed in to change notification settings

maks-ym/tensorflow-gpu-installation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

README

Notes and links to install TensorFlow GPU

If pip 3 -U install tensorflow-gpu did not work and you need compile TensorFlow GPU.

I had this messege: The TensorFlow library was compiled to use AVX instructions, but these aren't available on your machine.

TL;DR

If just want to download compiled version, go to Compiled python wheels section

General steps

  1. Check versions of OS, CUDA capability of GPU, python
  2. Install nVidia driver
  3. Install CUDA
  4. Install cuDNN
  5. Compile TensorFlow GPU
  6. Install TensorFlow and some other useful packages
  7. Test installation
  8. Compiled python wheels
  9. Other useful links

Check versions of OS, CUDA capability of GPU, python

OS version (Ubuntu)

GUI: Settings > Details > Ubuntu 18.04LTS

Bash: $ lsb_release -a # See Description line

CUDA capability (version)

Find in table here: https://en.wikipedia.org/wiki/CUDA#GPUs_supported

python version

$ python3 --version # e.g. Python 3.6.8

Install nVidia driver

Check versions used for prebuilt packages: https://www.tensorflow.org/install/source#linux

For example, for TF 12

Version Python version Compiler Build tools cuDNN CUDA
tensorflow_gpu-1.12.0 2.7, 3.3-3.6 GCC 4.8 Bazel 0.15.0 7 9

nvidia-390 is OK for CUDA 9.

Google for instructions.

Install CUDA

CUDA Toolkit 9.0 for Ubuntu 18.04 is not available, but version for 17.04 should work fine.

Install cuDNN

cuDNN 7 (v7.0.5)

$ tar -xzvf cudnn-9.0-linux-x64-v7.tgz
$ 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*

installation instructions taken from here

  • after installing driver, CUDA and cuDNN, to check whether installation is good, run
$ nvidia-smi

Table with info about GPU usage should be shown.

Compile TensorFlow GPU

Install TensorFlow and some other useful packages

If done all above TensorFlow should have already been installed.

Additional packages you may like to install:

  • keras
  • numpy
  • scikit-learn
  • matplotlib

Test installation

To test whether TF uses GPU, run in Terminal:

$ watch -n1 nvidia-smi

And run any example for model training.

Compiled python wheels

TF Version Python version Compiler Build tools cuDNN CUDA Links
1.12.0 GPU 3.6.8 GCC 6.5 Bazel 0.19.2 7.0.5 9 download wheel

Other useful links (used while compiling wheels)


If you have any corrections, recommendations or editions, please create issues

About

Notes and links to install TansorFlow GPU | Нотатки та посилання для компіляції і встановлення TensorFlow для графічного процесора

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published