title: How to build Tensorflow 1.4 with CUDNN 5.0?
body: <p>
  I'm trying to install Tensorflow 1.4 from sources with CUDA 8.0 and CUDNN 5.0.5, on Centos 7. It's indicated in the documentation that it should work with CUDNN 3 and higher. I'm working in a virtual env with Python 3.4.5, using Bazel 0.7.0, with GCC 4.9. During the configuration, I've set CUDNN version to 5.0.5 and the library has been found. </p>
  
  <p>Unfortunately, it doesn't work and ends up with an error that seems to indicate that CUDNN v6 is needed (I may be wrong on the cause of the error).</p>
  
  <p>Here is the command I'm using:</p>
  
  <pre class="lang-sh prettyprint-override"><code>bazel build --config=opt --config=cuda --config=mkl //tensorflow/tools/pip_package:build_pip_packag
  </code></pre>
  
  <p>Here is the error:</p>
  
  <pre class="lang-sh prettyprint-override"><code>ERROR: /home/localuser/tensorflow/tensorflow/stream_executor/BUILD:52:1: C++ compilation of rule '//tensorflow/stream_executor:cuda_platform' failed (Exit 1).
  tensorflow/stream_executor/cuda/cuda_dnn.cc: In member function 'cudnnStatus_t perftools::gputools::cuda::wrap::WrapperShim__cudnnSetRNNDescriptor_v6::operator()(perftools::gputools::cuda::CUDAExecutor*, Args ...)':
  tensorflow/stream_executor/cuda/cuda_dnn.cc:140:30: error: '::cudnnSetRNNDescriptor_v6' has not been declared
         cudnnStatus_t retval = ::__name(args...);                    \
                                ^
  tensorflow/stream_executor/cuda/cuda_dnn.cc:235:3: note: in expansion of macro 'PERFTOOLS_GPUTOOLS_CUDNN_WRAP'
     __macro(cudnnSetRNNDescriptor_v6)                           \
     ^
  tensorflow/stream_executor/cuda/cuda_dnn.cc:240:1: note: in expansion of macro 'CUDNN_DNN_ROUTINE_EACH_R5'
   CUDNN_DNN_ROUTINE_EACH_R5(PERFTOOLS_GPUTOOLS_CUDNN_WRAP)
  </code></pre>
  
  <p>Here is the result of the configure (.tf_configure.bazelrc): </p>
  
  <pre class="lang-sh prettyprint-override"><code>build --action_env PYTHON_BIN_PATH="/home/localuser/venvs/tensorflow14-opt/bin/python"
  build --action_env PYTHON_LIB_PATH="/home/localuser/venvs/tensorflow14-opt/lib/python3.4/site-packages"
  build --define PYTHON_BIN_PATH="/home/localuser/venvs/tensorflow14-opt/bin/python"
  build --define PYTHON_LIB_PATH="/home/localuser/venvs/tensorflow14-opt/lib/python3.4/site-packages"
  build --force_python=py3
  build --host_force_python=py3
  build --python_path="/home/localuser/venvs/tensorflow14-opt/bin/python"
  test --force_python=py3
  test --host_force_python=py3
  test --define PYTHON_BIN_PATH="/home/localuser/venvs/tensorflow14-opt/bin/python"
  test --define PYTHON_LIB_PATH="/home/localuser/venvs/tensorflow14-opt/lib/python3.4/site-packages"
  run --define PYTHON_BIN_PATH="/home/localuser/venvs/tensorflow14-opt/bin/python"
  run --define PYTHON_LIB_PATH="/home/localuser/venvs/tensorflow14-opt/lib/python3.4/site-packages"
  build:gcp --define with_gcp_support=true
  build:hdfs --define with_hdfs_support=true
  build:s3 --define with_s3_support=true
  build:xla --define with_xla_support=true
  build:gdr --define with_gdr_support=true
  build:verbs --define with_verbs_support=true
  build --action_env TF_NEED_OPENCL="0"
  build --action_env TF_NEED_CUDA="1"
  build --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda"
  build --action_env TF_CUDA_VERSION="8.0"
  build --action_env CUDNN_INSTALL_PATH="/usr/local/cuda-8.0"
  build --action_env TF_CUDNN_VERSION="5.0.5"
  build --action_env TF_CUDA_COMPUTE_CAPABILITIES="3.7,3.7,3.7,3.7"
  build --action_env TF_CUDA_CLANG="0"
  build --action_env GCC_HOST_COMPILER_PATH="/opt/rh/devtoolset-3/root/usr/bin/gcc"
  build --config=cuda
  test --config=cuda
  build:opt --cxxopt=-march=native --copt=-march=native
  build:mkl --define using_mkl=true
  build:mkl -c opt
  build:mkl --copt="-DEIGEN_USE_VML"
  build:monolithic --define framework_shared_object=false
  build --define framework_shared_object=true
  </code></pre>
  
  <p>Is there anything I can do to install TF 1.4 using CUDNN 5 ?</p>