I have succeeded to run TensorFlow on my desktop which runs Ubuntu 16.04 LTS with nVidia GeForce GTX 1050. I want to share the easy and fast way to install TensorFlow, so I write this down. This does NOT require to download and install CUDA toolkit nor cuDNN, but you can get GPU acceleration.
Prerequisite
- nVidia graphics card (CUDA Compute Capability >= 3.0)
- You can check at nVidia documentation.
- nVidia driver which supports your graphics card
- Ubuntu: ppa:graphics-drivers/ppa
- Docker engine
Quick start
- install nvidia-docker.
- run TensorFlow using nvidia-docker.
1 | sudo nvidia-docker run -it --rm -p 8888:8888 gcr.io/tensorflow/tensorflow:latest-gpu |
- <ctrl>-click or copy & paste the URI looks like
http://localhost:8888/?token=<hex_string>that appears on your terminal. Then you can get Jupyter notebook on your browser.
Why this works
nvidia-docker provides CUDA toolkit and cuDNN and tensorflow docker images utilizes it. All the installation procedures are abstracted by Docker images.
Troubleshooting in Ubuntu
- Identify your nVidia graphics card
1 | $ lspci | grep -i nvidia |
- Verify CUDA driver and its version
1 | $ cat /proc/driver/nvidia/version |
- Verify CUDA toolkit in
nvidia-docker
1 | $ sudo nvidia-docker run --rm nvidia/cuda nvidia-smi |