Using Debian 10 Buster, Python v2.7. I try to build specific tensorflow v1.14.0 without avx2 support, because I get following error:
Nov 4 17:12:32 moodle37 kernel: [9773297.574293] traps: python2.7[4570] trap invalid opcode ip:7fb9b74bca59 sp:7ffdb7605e10 error:0 in libtensorflow_framework.so.1[7fb9b6d97000+18f8000]
1) I cloned tensorflow with git
2) checked out v1.14.0.
>git status
HEAD detached at v1.14.0
3)
gcc -Q -march=native --help=target | grep march
-march= nehalem
So CPU codename is nehalem.
4) I used ./configure
with build options:
-march=nehalem mavx -msse4.1 -msse4.2 -mpclmul -mpopcnt -maes -mno-avx2
5) Executed
bazel build //tensorflow/tools/pip_package:build_pip_package
but I got build error:
ERROR: /root/inst/tensorflow_src/tensorflow/core/kernels/BUILD:3255:1: C++ compilation of rule '//tensorflow/core/kernels:matrix_square_root_op' failed (Exit 1)
gcc: fatal error: Killed signal terminated program cc1plus
compilation terminated.
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: 18990.253s, Critical Path: 381.93s
INFO: 2372 processes: 2372 local.
FAILED: Build did NOT complete successfully
6) Executed
bazel build --verbose_failures //tensorflow/tools/pip_package:build_pip_package
with following error:
ERROR: /root/inst/tensorflow_src/tensorflow/core/kernels/BUILD:3255:1: C++ compilation of rule '//tensorflow/core/kernels:matrix_square_root_op' failed (Exit 1): gcc failed: error executing command
(cd /root/.cache/bazel/_bazel_root/d7c6443e63bbc3c61de28c70992e7b9c/execroot/org_tensorflow && \
exec env - \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PWD=/proc/self/cwd \
PYTHON_BIN_PATH=/usr/bin/python \
PYTHON_LIB_PATH=/usr/local/lib/python2.7/dist-packages \
TF_CONFIGURE_IOS=0 \
TF_DOWNLOAD_CLANG=0 \
TF_NEED_CUDA=0 \
TF_NEED_OPENCL_SYCL=0 \
TF_NEED_ROCM=0 \
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/k8-py2-opt/bin/tensorflow/core/kernels/_objs/matrix_square_root_op/matrix_square_root_op.pic.d '-frandom-seed=bazel-out/k8-py2-opt/bin/tensorflow/core/kernels/_objs/matrix_square_root_op/matrix_square_root_op.pic.o' -fPIC -D__CLANG_SUPPORT_DYN_ANNOTATION__ -DEIGEN_MPL2_ONLY '-DEIGEN_MAX_ALIGN_BYTES=64''-DEIGEN_HAS_TYPE_TRAITS=0' -DTF_USE_SNAPPY -iquote . -iquote bazel-out/k8-py2-opt/bin -iquote external/com_google_absl -iquote bazel-out/k8-py2-opt/bin/external/com_google_absl -iquote external/eigen_archive -iquote bazel-out/k8-py2-opt/bin/external/eigen_archive -iquote external/local_config_sycl -iquote bazel-out/k8-py2-opt/bin/external/local_config_sycl -iquote external/nsync -iquote bazel-out/k8-py2-opt/bin/external/nsync -iquote external/gif_archive -iquote bazel-out/k8-py2-opt/bin/external/gif_archive -iquote external/jpeg -iquote bazel-out/k8-py2-opt/bin/external/jpeg -iquote external/protobuf_archive -iquote bazel-out/k8-py2-opt/bin/external/protobuf_archive -iquote external/com_googlesource_code_re2 -iquote bazel-out/k8-py2-opt/bin/external/com_googlesource_code_re2 -iquote external/farmhash_archive -iquote bazel-out/k8-py2-opt/bin/external/farmhash_archive -iquote external/fft2d -iquote bazel-out/k8-py2-opt/bin/external/fft2d -iquote external/highwayhash -iquote bazel-out/k8-py2-opt/bin/external/highwayhash -iquote external/zlib_archive -iquote bazel-out/k8-py2-opt/bin/external/zlib_archive -isystem external/eigen_archive -isystem bazel-out/k8-py2-opt/bin/external/eigen_archive -isystem external/nsync/public -isystem bazel-out/k8-py2-opt/bin/external/nsync/public -isystem external/gif_archive/lib -isystem bazel-out/k8-py2-opt/bin/external/gif_archive/lib -isystem external/protobuf_archive/src -isystem bazel-out/k8-py2-opt/bin/external/protobuf_archive/src -isystem external/farmhash_archive/src -isystem bazel-out/k8-py2-opt/bin/external/farmhash_archive/src -isystem external/zlib_archive -isystem bazel-out/k8-py2-opt/bin/external/zlib_archive -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare -fno-exceptions '-ftemplate-depth=900' -msse3 -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"''-D__TIMESTAMP__="redacted"''-D__TIME__="redacted"' -c tensorflow/core/kernels/matrix_square_root_op.cc -o bazel-out/k8-py2-opt/bin/tensorflow/core/kernels/_objs/matrix_square_root_op/matrix_square_root_op.pic.o)
Execution platform: @bazel_tools//platforms:host_platform
gcc: fatal error: Killed signal terminated program cc1plus
compilation terminated.
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 3559.068s, Critical Path: 448.60s
INFO: 397 processes: 397 local.
FAILED: Build did NOT complete successfully
How can I fix this?