serving: no such target '@org_tensorflow//third_party/gpus/crosstool:crosstool'

I am trying to compile tensorflow_model_server from master.

Error:

ERROR: no such target '@org_tensorflow//third_party/gpus/crosstool:crosstool': target 'crosstool' not declared in package 'third_party/gpus/crosstool' defined by /home/username/.cache/bazel/_bazel_jorge/2fd988219920b10e9ede8d3b5720f3d2/external/org_tensorflow/third_party/gpus/crosstool/BUILD.

Steps to reproduce:

  1. Configure tensorflow with CUDA support
cd tensorflow
./configure
cd ..
  1. Build //tensorflow_serving/model_servers:tensorflow_model_server
bazel build -c opt --config=cuda --genrule_strategy=standalone --spawn_strategy=standalone --verbose_failures  //tensorflow_serving/model_servers:tensorflow_model_server

As a side note when I try to compile tensorflow_model_server from an external project it works but doesn’t have support for the GPU.

The solutions of https://github.com/tensorflow/serving/issues/225 don’t work

EDITED: finally I made this script in order to compile it with CUDA support: https://gist.github.com/jorgemf/0f2025a45e1568663f4c20551a5881f1

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

I was able to make it compile. Here is an script to do it so: https://gist.github.com/jorgemf/0f2025a45e1568663f4c20551a5881f1

You only need to modify the variables and the exports with the values you want and everything works.

It works because:

  1. TensorFlow Serving needs to see the values of the variables, which ./configure doesn’t export and they are not visible when compiling TensorFlow Serving
  2. in serving/tools/bazel.rc the you have to replace @org_tensorflow//third_party/gpus/crosstool with @local_config_cuda//crosstool:toolchain
  3. If your gcc version is >5 it wont work, so I set gcc-5 in serving/tensorflow/third_party/gpus/cuda_configure.bzl when it is available
  4. Finally I used -c opt --config=cuda --spawn_strategy=standalone as options to compile //tensorflow_serving/model_servers:tensorflow_model_server but it should work for other targets

@jorgemf Success - I now have a tf-model_server that does indeed use the GPU. To get there I used:

  • tag 0.5.1 for tf-serving,
  • tag v1.0.1 for the tensorflow sourcetree contained therein,
  • your compile script (slightly modified to use my local paths)

Thanks again for providing the script!