serving icon indicating copy to clipboard operation
serving copied to clipboard

Build from source with CUDA failed in CentOS 7

Open troycheng opened this issue 8 years ago • 7 comments

I know building from source in CentOS is not supported by official, however, our production env(no docker) is CentOS so I have to build tf-serving in it. I successfully built CPU version refer to the docker file, but the GPU version still can not be built correctly. I tried to get help from other issues and Stackoverflow but no related info. I would be grateful if someone could help.

System information

  • CentOS Linux release 7.5.1804:
  • TensorFlow Serving installed from source:
  • TensorFlow Serving version: master:
  • gcc version 4.8.5
  • CUDA version 8.0, CUDNN version 7.1
  • bazel version 0.18.0

Describe the problem

The problem is the compilation always end up with error "external/com_google_absl/absl/strings/str_cat.h(259): error: expression must have a constant value" . I know it's related about VLA(Variable Length Array). But I couldn't find the related code and have been stucked here for several days.

Exact Steps to Reproduce

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/bin:/root/bin
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
export TF_NEED_CUDA=1
export TF_NEED_TENSORRT=1
export TENSORRT_INSTALL_PATH=/usr/local/tensorRT/
export TF_CUDA_COMPUTE_CAPABILITIES=3.0,3.5,5.2
export TF_CUDA_VERSION=8.0
export TF_CUDNN_VERSION=7
export NCCL_VERSION=2.3.7
export TF_TENSORRT_VERSION=4.1.2
export TF_NCCL_VERSION=2
export NCCL_INSTALL_PATH=/usr/local/lib64
export NCCL_HDR_PATH=/usr/local/include
export TMP="/tmp"

bazel build --color=yes --curses=yes --cxxopt="-fPIC" --config=cuda --verbose_failures --config=nativeopt  tensorflow_serving/model_servers:tensorflow_model_server

Source code / logs

INFO: Build options have changed, discarding analysis cache.
INFO: Analysed target //tensorflow_serving/model_servers:tensorflow_model_server (71 packages loaded).
INFO: Found 1 target...
ERROR: /root/.cache/bazel/_bazel_root/c67c48bfadc24b66f2f2704b351385b4/external/org_tensorflow/tensorflow/core/kernels/BUILD:3903:1: output 'external/org_tensorflow/tensorflow/core/kernels/_objs/fused_batch_norm_util_gpu/fused_batch_norm_op.cu.o' was not created
ERROR: /root/.cache/bazel/_bazel_root/c67c48bfadc24b66f2f2704b351385b4/external/org_tensorflow/tensorflow/core/kernels/BUILD:3903:1: not all outputs were created or valid
external/com_google_absl/absl/strings/string_view.h(496): warning: expression has no effect

external/com_google_absl/absl/strings/str_cat.h(259): error: expression must have a constant value

external/com_google_absl/absl/strings/str_cat.h(259): error: expression must have a constant value

2 errors detected in the compilation of "/tmp/tmpxft_0001f47b_00000000-11_fused_batch_norm_op.cu.compute_52.cpp1.ii".
Target //tensorflow_serving/model_servers:tensorflow_model_server failed to build
INFO: Elapsed time: 306.984s, Critical Path: 171.69s
INFO: 857 processes: 857 local.
FAILED: Build did NOT complete successfully

troycheng avatar Nov 10 '18 09:11 troycheng

I believe this is a dup of https://github.com/tensorflow/tensorflow/issues/23127

gautamvasudevan avatar Nov 13 '18 20:11 gautamvasudevan

I believe this is a dup of tensorflow/tensorflow#23127

@troycheng - Any update ? Please correct us if this is not a duplicate issue.

Harshini-Gadige avatar Nov 13 '18 20:11 Harshini-Gadige

Still failed. I noticed that issue before. It seems these two issue are caused by the same reason. But that issue has not been updated for nearly a month. Could someone familiar with this take a look and fix it?

troycheng avatar Nov 14 '18 03:11 troycheng

I have exactly the same errors compiling in centos7 too. Is there somebody who can help to solve this? @nrobeR

jinze1994 avatar Nov 15 '18 05:11 jinze1994

Same error when upgrading to v1.12 with ubuntu14.04 gcc4.8.4 bazel0.15 (no error in v1.10)

@troycheng In fact you can find the code here, but I didn't see why this code had caused the error.

I also tried to bazel @com_google_absl//absl/strings, it completed with no error.

@jinze1994 happy to meet you here 2333333333

matanagasauce avatar Nov 15 '18 14:11 matanagasauce

@yangyangxcf I saw that code but obviously the problem is located in somewhere these functions are called, like in the compilation of "/tmp/tmpxft_0001f47b_00000000-11_fused_batch_norm_op.cu.compute_52.cpp1.ii", but seems in different versions it may occur in different place. I tried to trace but failed.

troycheng avatar Nov 16 '18 03:11 troycheng

Per comment above, marking this as a duplicate of tensorflow/tensorflow#23127. Please continue the discussion there so we have a centralized place tracking. Thanks.

nrobeR avatar Nov 16 '18 04:11 nrobeR