lukeiwanski / tensorflow

OpenCL support for TensorFlow via SYCL
Apache License 2.0
65 stars 14 forks source link

[BUG] Can't build with SYCL from source #206

Closed nerd-lab closed 6 years ago

nerd-lab commented 6 years ago

Hi,

I tried for the last 2 days to get OpenCL TF to work, but everytime I try to compile with bazel build--config=sycl //tensorflow/tools/pip_package:build_pip_package --incompatible_load_argument_is_label=false--verbose_failures` it throws this error:

ERROR: /home/j/tensorflow/tensorflow/tools/proto_text/BUILD:33:1: Linking of rule '//tensorflow/tools/proto_text:gen_proto_text_functions' failed (Exit 1): computecpp failed: error executing command (cd /home/j/.cache/bazel/_bazel_j/2177d5db1f8ba69c0d4ddbcbd7223068/execroot/org_tensorflow && \ exec env - \ LD_LIBRARY_PATH=/usr/local/computecpp/lib \ PATH=/home/j/faceswap/faceswap_env/bin:/home/j/bin:/home/j/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \ PWD=/proc/self/cwd \ external/local_config_sycl/crosstool/computecpp -o bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions -Wl,-no-as-needed -B/usr/bin/ -no-canonical-prefixes -Wl,-no-as-needed '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,--gc-sections -Wl,-S -Wl,@bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions-2.params) bazel-out/host/bin/tensorflow/tools/proto_text/libgen_proto_text_functions_lib.a(gen_proto_text_functions_lib.o): In function std::string* tensorflow::internal::MakeCheckOpString<google::protobuf::FileDescriptor::Syntax, google::protobuf::FileDescriptor::Syntax>(google::protobuf::FileDescriptor::Syntax const&, google::protobuf::FileDescriptor::Syntax const&, char const*)': gen_proto_text_functions_lib.cc:(.text._ZN10tensorflow8internal17MakeCheckOpStringIN6google8protobuf14FileDescriptor6SyntaxES5_EEPSsRKT_RKT0_PKc[_ZN10tensorflow8internal17MakeCheckOpStringIN6google8protobuf14FileDescriptor6SyntaxES5_EEPSsRKT_RKT0_PKc]+0x47): undefined reference totensorflow::internal::CheckOpMessageBuilder::NewString()' collect2: error: ld returned 1 exit status Target //tensorflow/tools/pip_package:build_pip_package failed to build INFO: Elapsed time: 91.708s, Critical Path: 22.57s FAILED: Build did NOT complete successfully

Am I doing something wrong, or is it because the linux gpu build is currently failing?

System information

DuncanMcBain commented 6 years ago

Hi @nerd-lab, Thanks for your report. If you're on Ubuntu 16.04, why are you using GCC 4.8? The default that comes with 16.04 is GCC 5.4, and I know there have been ABI changes since then. I'd recommend using the compiler that comes with your system by default in this case - otherwise, you can try using ComputeCpp built for 14.04, since it was built with GCC 4.8.

Additionally, we have a branch that has some performance improvements for AMD GPUs, called dev/amd_gpu - you should try this out if you're wanting to run on an RX480 :)

nerd-lab commented 6 years ago

@DuncanMcBain, thank you very much, it now works with the gcc-5.4. The rationale behind 4.8 and eigen_mehdi was that on the ccpp guide they used this, they should probably update this :)

DuncanMcBain commented 6 years ago

Good to know. Is that the one from our website? I'll see if we can change it. Thanks!

nerd-lab commented 6 years ago

Yes, I followed the TF AMD Setup Guide, and there it says gcc v4 specifically (or clang 3.6). I just took this and gcc-4.8 was the v4 I had on hand.

Edit: eigen_mehdi wasn't mentioned in the guide, but it's what I found with googling

DuncanMcBain commented 6 years ago

OK thanks, we'll edit that and make it more clear what's needed. Thanks for your feedback!