Reputation: 31206
On the main TensorFlow website, you must specifically enable the gpu:
# Ubuntu/Linux 64-bit, GPU enabled:
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp34-none-linux_x86_64.whl
On the anaconda website, you only have to install tensor flow, but there is no indication whether this is the GPU or CPU version:
conda install -c https://conda.anaconda.org/jjhelmus tensorflow
After running the Anaconda command, I decided that I needed to make sure that it was the GPU version, so I tried to run the pip command inside the anaconda folder.
When I ran the pip command, I got the following error:
tensorflow-0.7.1-cp34-none-linux_x86_64.whl is not a supported wheel on this platform
I have no idea what a wheel is...but I have a newish laptop with a multicore i7 (July last year) and a laptop nvidia card with a compute rating of 5.2 and CUDA installed (Ubuntu 15.10).
There must be a version that is compatible with my specs.
How do I upgrade my tensor flow install to the GPU version?
Update
When I run: import pip; print(pip.pep425tags.get_supported())
, the supported wheels include
cp35
But the wheel that is available for TensorFlow is cp34...so does that mean TensorFlow on the GPU does not work for my computer?
Upvotes: 4
Views: 13650
Reputation: 231
Everything changed in Tensorflow V1.0 and This guide explains how to install TensorFlow on Ubuntu of Course with GPU supported.I have only tested these instructions on Ubuntu 14.04.
first of all you must check that nVidia installed for check this enter the command below:
nvidia-smi
and you should see somthing like this
if you see this your nvidia card is correctly installed.
go to https://developer.nvidia.com/cuda-downloads and download cuda toolkit for ubutu 14.04 (download .deb file) and install it with these commands
sudo dpkg -i cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
Be Careful tensorflow V1.0 is needed cuda-8.0 and is not worked with cuda-7.5 and if you have installed cuda-7.5 and lower , you got this error when import tensorflow in python
ImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory.
after install cuda-8.0 go to https://developer.nvidia.com/cudnn and download cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0 and install with commands below
tar -xzvf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp -P include/cudnn.h /usr/local/include
sudo cp -P lib64/libcudnn* /usr/local/lib64
sudo chmod a+r /usr/local/lib64/libcudnn*
at the end add these lines to your path file maybe add these lines to ~/.bashrc file for doing this use these commands below:
open ~/.bashrc
sudo nano ~/.bashrc
add these lines
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=/usr/local/cuda/lib64
for installing tensorflow with gpu supported you can install it with one command below
pip install tensorflow-gpu
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
after all if do everythings right when you import tensorflow in python console you can see these and this means your tensorflow with gpu supported
Upvotes: 1
Reputation: 17636
As dumb as it seems, just renaming the wheel from 3.4 to 3.5 is sufficient:
$ wget https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp34-none-linux_x86_64.whl
...
$ pip install tensorflow-0.7.1-cp34-none-linux_x86_64.whl
tensorflow-0.7.1-cp34-none-linux_x86_64.whl is not a supported wheel on this platform.
$ mv tensorflow-0.7.1-cp3{4,5}-none-linux_x86_64.whl
$ pip install tensorflow-0.7.1-cp35-none-linux_x86_64.whl
Processing ./tensorflow-0.7.1-cp35-none-linux_x86_64.whl
...
Installing collected packages: tensorflow
Successfully installed tensorflow-0.7.1
Upvotes: 5