lukeiwanski / tensorflow

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

FAIL: building TensorFlow on Ubuntu 16.04 #200

Closed MathiasMagnus closed 6 years ago

MathiasMagnus commented 6 years ago

TensorFlow fails to build on Ubuntu 16.04 when doing things according to the wiki entry on Codeplays site.


System information

Describe the problem

Trying to build TF with OpenCL & SYCL support using ComputeCpp-CE 0.5.1.

Source code / logs

This is what's seen on console when build fails:

WARNING: Output base '/home/mnagy/.cache/bazel/_bazel_mnagy/b6c672ee274d6e3919f72d8fdb8667a3' is on NFS. This may lead to surprising failures and undetermined behavior.
WARNING: /home/mnagy/Source/Repos/tensorflow/tensorflow/core/BUILD:1832:1: in includes attribute of cc_library rule //tensorflow/core:framework_headers_lib: '../../external/nsync/public' resolves to 'external/nsync/public' not below the relative path of its package 'tensorflow/core'. This will be an error in the future. Since this rule was created by the macro 'cc_header_only_library', the error might have been caused by the macro implementation in /home/mnagy/Source/Repos/tensorflow/tensorflow/tensorflow.bzl:1150:30
WARNING: /home/mnagy/.cache/bazel/_bazel_mnagy/b6c672ee274d6e3919f72d8fdb8667a3/external/grpc/WORKSPACE:1: Workspace name in /home/mnagy/.cache/bazel/_bazel_mnagy/b6c672ee274d6e3919f72d8fdb8667a3/external/grpc/WORKSPACE (@com_github_grpc_grpc) does not match the name given in the repository's definition (@grpc); this will cause a build error in future versions
WARNING: /home/mnagy/Source/Repos/tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': No longer supported. Switch to SavedModel immediately.
WARNING: /home/mnagy/Source/Repos/tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:gc': No longer supported. Switch to SavedModel immediately.
INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (159 packages loaded).
INFO: Found 1 target...
ERROR: /home/mnagy/Source/Repos/tensorflow/tensorflow/core/BUILD:1529:1: undeclared inclusion(s) in rule '//tensorflow/core:lib_hash_crc32c_accelerate_internal':
this rule is missing dependency declarations for the following files included by 'tensorflow/core/lib/hash/crc32c_accelerate.cc':
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/stddef.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/__stddef_max_align_t.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/stdint.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/nmmintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/smmintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/tmmintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/pmmintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/emmintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/xmmintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/mmintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/mm_malloc.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/f16cintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/popcntintrin.h'
  '/opt/Codeplay/ComputeCpp/0.5.1/lib/clang/3.9.0/include/stdarg.h'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 86.109s, Critical Path: 13.77s
FAILED: Build did NOT complete successfully
lukeiwanski commented 6 years ago

hi @MathiasMagnus Thanks for the report.

I presume that you pointed ./config to /opt/Codeplay/ComputeCpp/ when it asked for ComputeCpp installation path.

Otherwise this https://github.com/lukeiwanski/tensorflow/issues/193#issuecomment-354729010 might be helpful.

The workaround on your system would be to add: cxx_builtin_include_directory: "'/opt/Codeplay/ComputeCpp" to third_party/sycl/crosstool/CROSSTOOL.tpl around line 52

MathiasMagnus commented 6 years ago

Thanks! Worked like a charm. Now comes usage. Should any issues arise, those will come as separate tickets.

Thanks again and keep up the good work! The more SYCL the merrier.