How can I easily get tensorflow gpu running?
Nvidia Drivers – Install Nvidia Drivers, CUDA, CUDNN, and Tensorflow GPU on Ubuntu 18.04
18.04cudagpu
Related Solutions
I found the answer!
I need to create soft link:
sudo ln -s /usr/local/cuda-9.0/lib64/libcufft.so /usr/lib/libcufft.so.9.0
Then I re-configure with MPI support to false.
After that this command is success!
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-self-assign'
Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
bazel-bin/tensorflow/tools/pip_package/build_pip_package
INFO: Elapsed time: 275.306s, Critical Path: 36.05s
INFO: Build completed successfully, 602 total actions
sam@sam:~/code/download/CNN/tensorflow_1.4/tensorflow$
Then I run:
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
sam@sam:~/code/download/CNN/tensorflow_1.4/tensorflow$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
一 11月 20 09:53:08 CST 2017 : === Using tmpdir: /tmp/tmp.xpC8nRamZR
~/code/download/CNN/tensorflow_1.4/tensorflow/bazel-bin/tensorflow/tools/pip_package/build_pip_package.runfiles ~/code/download/CNN/tensorflow_1.4/tensorflow
~/code/download/CNN/tensorflow_1.4/tensorflow
/tmp/tmp.xpC8nRamZR ~/code/download/CNN/tensorflow_1.4/tensorflow
一 11月 20 09:53:10 CST 2017 : === Building wheel
warning: no files found matching '*.dll' under directory '*'
warning: no files found matching '*.lib' under directory '*'
warning: no files found matching '*.h' under directory 'tensorflow/include/tensorflow'
warning: no files found matching '*' under directory 'tensorflow/include/Eigen'
warning: no files found matching '*' under directory 'tensorflow/include/external'
warning: no files found matching '*.h' under directory 'tensorflow/include/google'
warning: no files found matching '*' under directory 'tensorflow/include/third_party'
warning: no files found matching '*' under directory 'tensorflow/include/unsupported'
~/code/download/CNN/tensorflow_1.4/tensorflow
一 11月 20 09:53:35 CST 2017 : === Output wheel file is in: /tmp/tensorflow_pkg
sam@sam:~/code/download/CNN/tensorflow_1.4/tensorflow$
Then I found that it create tensorflow whl file:
sam@sam:~/code/download/CNN/tensorflow_1.4/tensorflow$ ls /tmp/tensorflow_pkg
tensorflow-1.4.1-cp27-cp27mu-linux_x86_64.whl
sam@sam:~/code/download/CNN/tensorflow_1.4/tensorflow$
Then I remove old tensorflow:
sudo pip uninstall tensorflow-gpu
sudo pip uninstall tensorflow-tensorboard
I install new one that I compiled success!
sudo pip install --upgrade /tmp/tensorflow_pkg/tensorflow-1.4.1-cp27-cp27mu-linux_x86_64.whl
Then I create soft link of CUDA:
sudo ln -s /usr/local/cuda-9.0/lib64/libcusolver.so /usr/lib/libcusolver.so.9.0
Then I test tensorflow success!
sam@sam:~/code/download/lib/cudnn7$ python -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))'
/usr/local/lib/python2.7/dist-packages/tensorflow
sam@sam:~/code/download/lib/cudnn7$
Thanks~
OK, sorry for my absence. solved this, just one day after asked question. first of all i removed whole nvidia drivers (purge), then I made repository for graphics drivers and followed this code :
Add NVIDIA package repositories
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo apt-get update
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt install ./nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo apt-get update
# Install NVIDIA driver
sudo apt-get install --no-install-recommends nvidia-driver-410
# Reboot. Check that GPUs are visible using the command: nvidia-smi
# Install development and runtime libraries (~4GB)
sudo apt-get install --no-install-recommends \
cuda-10-0 \
libcudnn7=7.6.0.64-1+cuda10.0 \
libcudnn7-dev=7.6.0.64-1+cuda10.0
# Install TensorRT. Requires that libcudnn7 is installed above.
sudo apt-get update && \
&& sudo apt-get install -y --no-install-recommends libnvinfer-dev=5.1.5-1+cuda10.0
code from: https://www.tensorflow.org/install/gpu
when i check drivers nvidia-smi
, I still got CUDA 10.1, but tensorflow-gpu == 1.13 works well.
Best Answer
I just installed Tensorflow GPU on Ubuntu 18.04. There are a lot instructions for it, however I think the fastest and easiest way is usually not used and I want to share it:
NVIDIA DRIVER:
CUDA:
Normally: "sudo apt install nvidia-cuda-toolkit" However this installs version 9.1, too new at the moment and tensorflow will not run. Instead download CUDA 9.0: https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1704&target_type=runfilelocal Then run (Additional Details on the first line can be found at: How can I install CUDA 9 on Ubuntu 17.10):
CuDNN:
register at nvidia developers https://developer.nvidia.com/cudnn Download 9.1 runtime & developer library for 16.04 (Files cuDNN v7.1.3 Runtime Library for Ubuntu16.04 (Deb) & cuDNN v7.1.3 Developer Library for Ubuntu16.04 (Deb)) Open the files with software manager and install them. Check with:
Install libraries and tensorflow:
Check:
Note: Start tensorflow or your development environment from terminal, otherwise for me it does not load the PATH variables.