Environment
Target: Tensorflow 1.8
python3.6 (3.5)
cuda 10.0 (9.0)
cudnn 7.6 (7.5, 7.0)
bazel 0.15.0
1. install python3, pip
sudo apt install python-dev python-pip python3 python3-pip
2. install cudnn
Download cudnn
https://developer.nvidia.com/rdp/cudnn-download
sudo cp include/* /usr/local/cuda/include/If cannot find libcudnn.*sudo cp lib64/* /usr/local/cuda/lib64/sudo ln -s /usr/local/cuda/lib64/libcudnn.so.7.6.1 /usr/local/cuda/lib64/libcudnn.so.7sudo ln -s /usr/local/cuda/lib64/libcudnn.so.7 /usr/local/cuda/lib64/libcudnn.so
sudo ln -s /usr/local/cuda/lib64/libcudnn.so.7.6 /usr/local/cuda/lib64/libcudnn.so.7
sudo ldconfig /usr/local/cuda/lib64
3. install bazel
https://github.com/bazelbuild/bazel/releases/tag/0.15.0
https://github.com/bazelbuild/bazel/releases/tag/0.15.0
wget https://github.com/bazelbuild/bazel/releases/download/0.15.0/bazel-0.15.0-installer-linux-x86_64.shchmod +x bazel-0.15.0-installer-linux-x86_64.sh./bazel-0.15.0-installer-linux-x86_64.sh --user
pip3 install numpy
5. ./configure
set python path (whereis python3, which python3)
set cuda version & path (10.0, /usr/local/cuda)
set cudnn version & path (7.6, /usr/local/cuda)
6. build
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
7. install
bazel-bin/tensorflow/tools/pip_package/build_pip_package ~/tmp/tensorflow_pkgvirtualenv -p python3 tensorflow(tensorflow)$ source ~/tensorflow/bin/activate(tensorflow)$ pip install ~/tmp/tensorflow_pkg/tensorflow-1.8-cp36-cp36mu-linux_x86_64.whl
No comments:
Post a Comment