Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r1.4 build failed constexpr constructor calls non-constexpr function #14898

Closed
joa23 opened this issue Nov 27, 2017 · 12 comments
Closed

r1.4 build failed constexpr constructor calls non-constexpr function #14898

joa23 opened this issue Nov 27, 2017 · 12 comments
Labels
stat:community support Status - Community Support type:build/install Build and install issues

Comments

@joa23
Copy link

joa23 commented Nov 27, 2017

BLUF:
Build fails on OSX.
./tensorflow/core/framework/variant.h(343): error: constexpr constructor calls non-constexpr function "std::__1::unique_ptr<_Tp, _Dp>::unique_ptr() [with _Tp=tensorflow::Variant::ValueInterface, _Dp=std::__1::default_deletetensorflow::Variant::ValueInterface]"

1 error detected in the compilation of "/var/folders/96/nq247q_92n99r8hkfvlxg_6w0000gn/T//tmpxft_00004cf5_00000000-7_beam_search_ops_gpu.cu.cpp1.ii".
ERROR: /Users/joa23/projects/tensorflow/tensorflow/contrib/seq2seq/BUILD:51:1: output 'tensorflow/contrib/seq2seq/_objs/python/ops/_beam_search_ops_gpu/tensorflow/contrib/seq2seq/kernels/beam_search_ops_gpu.cu.pic.o' was not created.
ERROR: /Users/joa23/projects/tensorflow/tensorflow/contrib/seq2seq/BUILD:51:1: not all outputs were created or valid.

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
    No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    10.13.1 (17B48)
  • TensorFlow installed from (source or binary):
    Trying to compile with sources.
  • TensorFlow version (use command below):
    r1.4 branch
  • Python version:
    Python 3.6.3
  • Bazel version (if compiling from source):
    0.7.0
  • GCC/Compiler version (if compiling from source):
    Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 8.0.0 (clang-800.0.42.1)
    Target: x86_64-apple-darwin17.2.0
    Thread model: posix
  • CUDA/cuDNN version:
    CUDA Driver Version: 8.0.61
    cuDNN 6 April 2017
  • GPU model and memory:
    NVIDIA GTX TITAN X, 12 GB, DVI, HDMI, 3 DP (3072 CUDA cores)
  • Exact command to reproduce:
    bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --verbose_failures

Describe the problem

Failed to build with
./tensorflow/core/framework/variant.h(343): error: constexpr constructor calls non-constexpr function "std::__1::unique_ptr<_Tp, _Dp>::unique_ptr() [with _Tp=tensorflow::Variant::ValueInterface, _Dp=std::__1::default_deletetensorflow::Variant::ValueInterface]"

1 error detected in the compilation of "/var/folders/96/nq247q_92n99r8hkfvlxg_6w0000gn/T//tmpxft_00004cf5_00000000-7_beam_search_ops_gpu.cu.cpp1.ii".
ERROR: /Users/joa23/projects/tensorflow/tensorflow/contrib/seq2seq/BUILD:51:1: output 'tensorflow/contrib/seq2seq/_objs/python/ops/_beam_search_ops_gpu/tensorflow/contrib/seq2seq/kernels/beam_search_ops_gpu.cu.pic.o' was not created.
ERROR: /Users/joa23/projects/tensorflow/tensorflow/contrib/seq2seq/BUILD:51:1: not all outputs were created or valid.
Target //tensorflow/tools/pip_package:build_pip_package failed to build

@dbarnes
Copy link

dbarnes commented Nov 27, 2017

I can build the last commit before the last changes to variant.h which is 9380e3a832

The changes at the following commit break the build for me so is probably a good place to start 105dd2aa22c7aaac401d2d8ed3131b5d81fdc227 although I'm not familiar with the Tensorflow code.

Like you I'm on CUDA 8 cuDNN 6 and am using OSX with an eGPU (1080TI).

@joa23
Copy link
Author

joa23 commented Nov 27, 2017

@danbarnes333,
Thanks! Good to know someone else has the same setup. I was afraid it was hardware related.
Does the 9380e3a build than work for you? I managed to the build r1.3 branch but any Tensorflow hello world just hang. No stack trace. No Error message.

@dbarnes
Copy link

dbarnes commented Nov 28, 2017

Yes I can build and run 1.3, no hangs. 9380e3a will build into a wheel but throws some errors when trying to import it which maybe isnt suprising as its not a release version.

I can build r1.4 head with GPU support (see below) and use in OSX by changing tensorflow/core/framework/variant.h(343)
std::unique_ptr<ValueInterface> value_;
to
std::shared_ptr<ValueInterface> value_;
But I cant really advise this without spending time going through the code it affects.

@ebrevdo you made the 105dd2a commit. Do you have thoughts if the above change is ok?

Thanks for any thoughts / advice you have!

In [1]: import tensorflow as tf
In [2]: tf.__version__
Out[2]: '1.4.1'

In [3]: from mrg_beta.tf.utils import LocalDevices

In [4]: LocalDevices()
2017-11-28 10:59:31.406129: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:856] OS X does not support NUMA - returning NUMA node zero
2017-11-28 10:59:31.406316: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GTX 1080 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:4f:00.0
totalMemory: 11.00GiB freeMemory: 2.31GiB
2017-11-28 10:59:31.406346: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:4f:00.0, compute capability: 6.1)


In [5]: import platform
In [6]: platform.platform()
Out[6]: 'Darwin-16.6.0-x86_64-i386-64bit'

@ebrevdo
Copy link
Contributor

ebrevdo commented Nov 28, 2017 via email

@dbarnes
Copy link

dbarnes commented Nov 29, 2017

I cant seem to get any more verbose than the following

Thanks

./tensorflow/core/framework/variant.h(343): error: constexpr constructor calls non-constexpr function "std::__1::unique_ptr<_Tp, _Dp>::unique_ptr() [with _Tp=tensorflow::Variant::ValueInterface, _Dp=std::__1::default_delete<tensorflow::Variant::ValueInterface>]"

@ebrevdo
Copy link
Contributor

ebrevdo commented Nov 29, 2017

what version of clang are you using? are you using the cmake build?

@joa23
Copy link
Author

joa23 commented Nov 29, 2017

I used gcc and followed this tutorial step by step:
https://metakermit.com/2017/compiling-tensorflow-with-gpu-support-on-a-macbook-pro/

@dbarnes
Copy link

dbarnes commented Nov 29, 2017

Not using cmake build, using the normal configure script and clang (with nvcc as the CUDA compiler).

@joa23 I dont believe on OSX you can actually build with gcc without some changes to the build files. Despite the question on at the end of the configure pointing to gcc thats by default a symlink back to clang. I tried separately to build with a version of gcc from homebrew, but it threw up a lot of errors because it was expecting clang.

Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.6.0

xcode-select version 2347.

@aselle aselle added the stat:community support Status - Community Support label Nov 29, 2017
@aselle
Copy link
Contributor

aselle commented Nov 29, 2017

Unfortunately, Apple support for NVIDIA CUDA is not strong, so it is difficult for us to support TensorFlow CUDA on Mac OS X.

@aselle aselle added the type:build/install Build and install issues label Nov 29, 2017
@l33tdawg
Copy link

l33tdawg commented Dec 1, 2017

Confirmed that @danbarnes333 fix of changing line 343 of variant.h to
std::shared_ptr value_; works in getting TF 1.4 with cuDNN 6 and CUDA 8 installed and working using bazel 0.8 on OS X 10.12.6 however I also needed to comment out the line linkopts = [“-lgomp”] in tensorflow/third_party/gpus/cuda/BUILD.tpl

@dbarnes
Copy link

dbarnes commented Dec 1, 2017

Yes. I linked against libgomp, but your way probably makes more sense.

@ymodak
Copy link
Contributor

ymodak commented Oct 24, 2018

Closing this issue due to staleness. Please use the latest version of TensorFlow and build again.
Feel free to report any issues you encounter with latest TensorFlow. Thanks!

@ymodak ymodak closed this as completed Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:community support Status - Community Support type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

6 participants