tensorflow: Building Java Tensorflow for GPU, from Source, Does not Work as Described.

First of all, I will not address this in Stackoverflow. This question belongs here. I tried going to Stackflow but nobody responded.

I need to build tensorflow for Java from source with GPU support in Windows. How can I do this successfully? I need to build the JNI DLLs. Please advise!

I get:

bazel build --config opt //tensorflow/java:tensorflow //tensorflow/java:libtensorflow_jni
ERROR: C:/development/projects/tensorflow/tensorflow/java/BUILD:142:1: error loading package 'tensorflow/java/src/main/native': Encountered error while reading extension file 'cuda/build_defs.bzl': no such package '@local_config_cuda//cuda': Traceback (most recent call last):
        File "C:/development/projects/tensorflow/third_party/gpus/cuda_configure.bzl", line 958
                _create_cuda_repository(repository_ctx)
        File "C:/development/projects/tensorflow/third_party/gpus/cuda_configure.bzl", line 846, in _create_cuda_repository
                _get_cuda_config(repository_ctx)
        File "C:/development/projects/tensorflow/third_party/gpus/cuda_configure.bzl", line 656, in _get_cuda_config
                _cudnn_install_basedir(repository_ctx)
        File "C:/development/projects/tensorflow/third_party/gpus/cuda_configure.bzl", line 211, in _cudnn_install_basedir
                auto_configure_fail("Cannot find cudnn install path....)
        File "C:/development/projects/tensorflow/third_party/gpus/cuda_configure.bzl", line 128, in auto_configure_fail
                fail("\n%sAuto-Configuration Error:%s...))

Auto-Configuration Error: Cannot find cudnn install path.
 and referenced by //tensorflow/java:libtensorflow_jni.so.
ERROR: Analysis of target '//tensorflow/java:tensorflow' failed; build aborted.
INFO: Elapsed time: 0.464s`

Please go to Stack Overflow for help and support:

http://stackoverflow.com/questions/tagged/tensorflow

If you open a GitHub issue, here is our policy:

  1. It must be a bug or a feature request.
  2. The form below must be filled out.

Here’s why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.


System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows
  • TensorFlow installed from (source or binary): r1.2
  • TensorFlow version (use command below):r1.2
  • Bazel version (if compiling from source): 0.5.0
  • CUDA/cuDNN version: 8.0/5.1
  • GPU model and memory: Nvidia Quadro - K5200
  • Exact command to reproduce:bazel build --config opt //tensorflow/java:tensorflow //tensorflow/java:libtensorflow_jni

You can collect some of this information using our environment capture script:

https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh

You can obtain the TensorFlow version with

python -c “import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)”

Describe the problem

Describe the problem clearly here. Be sure to convey here why it’s a bug in TensorFlow or a feature request.

Source code / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 43 (6 by maintainers)

Most upvoted comments

Thank you. I hope I find the solution, and certainly would share it with the community.