Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JohnGiorgi/d3cf239fb59b5bc64dd09e51527a9eb0 to your computer and use it in GitHub Desktop.
Save JohnGiorgi/d3cf239fb59b5bc64dd09e51527a9eb0 to your computer and use it in GitHub Desktop.
Instructions for setting up a GPU-enabled Tensorflow Environment on Ubuntu 18.04

Setting up a GPU-enabled Tensorflow Enviorment

Setting up GPU support

Training Tensorflow models on a NVIDIA GPU requires NVIDIA drivers, CUDA, and cuDNN. See here for the instructions to install all of these components on Ubuntu 18.04.

Other resources

Building Tensorflow from source

Building from source should led to faster training times. The easiest way to do this is with Docker. First we have to install some prerequisites:

Finally, instructions for building Tensorflow with GPU-support from source using Docker can be found here.

Installing Tensorflow

Once you have built Tensorflow in the container, a Tensorflow package will be available in your home directory, for example: ~/tensorflow-version-cp35-cp35m-linux_x86_64.whl.

You can then pip install this version. For example, if you are using conda to manage your virtual enviornments

$ conda activate myenv
(myenv) $ pip install ~/tensorflow-version-cp35-cp35m-linux_x86_64.whl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment