Repository navigation
Description
I am unable to compile when passing avx or avx2 to bazel, even though I have an avx2-compatible CPU (Xeon E5-2643 v3). This is the command I'm using to compile:
bazel build -c opt --copt=-mavx2 //tensorflow/tools/pip_package:build_pip_package
Also I can compile just fine using the default CPU or GPU configurations, i.e. both of these commands work:
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
Here is the error message when turning on verbose_failures:
ERROR: /usr/local/tensorflow/tensorflow/core/BUILD:157:1: C++ compilation of rule '//tensorflow/core:framework' failed: gcc failed: error executing command
(cd /root/.cache/bazel/bazel_root/e86f6fce5559de9e3e13fb6adb66b858/tensorflow &&
exec env -
INTERCEPT_LOCALLY_EXECUTABLE=1
PATH=/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -mavx2 '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-ce5a455b34c0 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-ce5a455b34c0 -pthread -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE_="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/objs/framework/tensorflow/core/framework/kernel_def_builder.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/objs/framework/tensorflow/core/framework/kernel_def_builder.pic.d -fPIC -c tensorflow/core/framework/kernel_def_builder.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/objs/framework/tensorflow/core/framework/kernel_def_builder.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: gcc failed: error executing command
(cd /root/.cache/bazel/bazel_root/e86f6fce5559de9e3e13fb6adb66b858/tensorflow &&
exec env -
INTERCEPT_LOCALLY_EXECUTABLE=1
PATH=/usr/local/cuda/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
/usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -mavx2 '-std=c++0x' -iquote . -iquote bazel-out/local_linux-opt/genfiles -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem tools/cpp/gcc3 -isystem external/jpeg_archive/jpeg-9a -isystem bazel-out/local_linux-opt/genfiles/external/jpeg_archive/jpeg-9a -isystem external/png_archive/libpng-1.2.53 -isystem bazel-out/local_linux-opt/genfiles/external/png_archive/libpng-1.2.53 -isystem external/re2 -isystem bazel-out/local_linux-opt/genfiles/external/re2 -isystem third_party/eigen3 -isystem bazel-out/local_linux-opt/genfiles/third_party/eigen3 -isystem external/eigen_archive/eigen-eigen-ce5a455b34c0 -isystem bazel-out/local_linux-opt/genfiles/external/eigen_archive/eigen-eigen-ce5a455b34c0 -pthread -fno-exceptions -DEIGEN_AVOID_STL_ARRAY -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/tensorflow/core/_objs/framework/tensorflow/core/framework/kernel_def_builder.pic.o' -MD -MF bazel-out/local_linux-opt/bin/tensorflow/core/_objs/framework/tensorflow/core/framework/kernel_def_builder.pic.d -fPIC -c tensorflow/core/framework/kernel_def_builder.cc -o bazel-out/local_linux-opt/bin/tensorflow/core/_objs/framework/tensorflow/core/framework/kernel_def_builder.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Activity
benoitsteiner commentedon Dec 23, 2015
I have upstreamed a partial fix to Eigen (see https://bitbucket.org/eigen/eigen/commits/f6e3953e6b44a8a0bfde7186cc162a612a904e15 for details).
I'll work on the second half of the problem after the Christmas break.
alquraishi commentedon Jan 14, 2016
Any updates on this?
benoitsteiner commentedon Jan 23, 2016
This will be fixed with pull request #847
benoitsteiner commentedon Jan 24, 2016
The fix was merged. Closing this issue.
skearnes commentedon Jan 25, 2016
@benoitsteiner I'm still having problems at a27d844:
bazel build -c opt --copt=-mavx2 //tensorflow:tensorflow_py --verbose_failuresgokceneraslan commentedon Jan 26, 2016
Yes, I'm also getting the same error at b159e21.
vrv commentedon Jan 26, 2016
Reopening since we had to rollback the change.
benoitsteiner commentedon Feb 4, 2016
I have another set of fixes pending in pull request #991
benoitsteiner commentedon Feb 12, 2016
Pull request #991 is now merged in the codebase. I'm closing this issue.
caisq commentedon Apr 18, 2016
@benoitsteiner @wicke @vrv
Update: The build agents have Xeon CPUs, which don't support AVX2. Perhaps that's the cause of the failures below. If this is confirmed, there is no action required on this issue.
Not sure if a new issue should be created since it has been three months since this issue was closed. But today I noticed a large number of test errors while doing
bazel test -c opt --copt=-mavx2 //tensorflow/...on the master branch, as a part of the effort to add mavx/mavx2 build to Jenkins.
The logs from the individual failed test failures are not especially informative. For example:
Testing with --copt=-mavx or no AVX flag didn't see any failures.
vrv commentedon Apr 18, 2016
Do Jenkins machines have avx2 support?
caisq commentedon Apr 18, 2016
@vrv see updates above. They have Xeon CPUs, which aren't supposed to support either AVX or AVX2?But mavx build passes.
vrv commentedon Apr 18, 2016
Which Xeon? AVX is pretty old, avx2 is relatively new -- I'd expect avx support on many machines but not avx2.
caisq commentedon Apr 18, 2016
Just looked it up: The slaves we have in the particular GCE region have Ivy Bridge Xeon, which supports AVX but not AVX2. So this explains it.
Merge pull request tensorflow#580 from jeffdaily/develop-upstream-fix…