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

Failed to build with optimization flag AVX2 #7660

Closed
hannan-sultan opened this issue Feb 19, 2017 · 8 comments
Closed

Failed to build with optimization flag AVX2 #7660

hannan-sultan opened this issue Feb 19, 2017 · 8 comments
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues

Comments

@hannan-sultan
Copy link

hannan-sultan commented Feb 19, 2017

OS : Ubuntu 16.041
CPU : Intel i7 6700k

Which supports avx2.0.

I am trying to install Tensorflow from sources.
What I am doing
`./configure
Please specify the location of python. [Default is /usr/bin/python]:
Please specify optimization flags to use during compilation [Default is -march=native]: AVX2
Do you wish to use jemalloc as the malloc implementation? (Linux only) [Y/n] y
jemalloc enabled on Linux
Do you wish to build TensorFlow with Google Cloud Platform support? [y/N] n
No Google Cloud Platform support will be enabled for TensorFlow
Do you wish to build TensorFlow with Hadoop File System support? [y/N] n
No Hadoop File System support will be enabled for TensorFlow
Do you wish to build TensorFlow with the XLA just-in-time compiler (experimental)? [y/N] n
No XLA JIT support will be enabled for TensorFlow
Found possible Python library paths:
/usr/local/lib/python2.7/dist-packages
/usr/lib/python2.7/dist-packages
Please input the desired Python library path to use. Default is [/usr/local/lib/python2.7/dist-packages]

Using python library path: /usr/local/lib/python2.7/dist-packages
Do you wish to build TensorFlow with OpenCL support? [y/N] n
No OpenCL support will be enabled for TensorFlow
Do you wish to build TensorFlow with CUDA support? [y/N] y
CUDA support will be enabled for TensorFlow
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:
Please specify the CUDA SDK version you want to use, e.g. 7.0. [Leave empty to use system default]: 8.0
Please specify the location where CUDA 8.0 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify the Cudnn version you want to use. [Leave empty to use system default]: 5.1.5
Please specify the location where cuDNN 5.1.5 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify a list of comma-separated Cuda compute capabilities you want to build with.
You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus.
Please note that each additional compute capability significantly increases your build time and binary size.
[Default is: "3.5,5.2"]: 6.1
Extracting Bazel installation...
.....
INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
.....
INFO: All external dependencies fetched successfully.
Configuration finished
`

Now when I try to build got error,

bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package INFO: Found 1 target... ERROR: /home/hannan/.cache/bazel/_bazel_hannan/45070a52d8b4aeac18b16b18e9aeca76/external/nanopb_git/BUILD.bazel:8:1: C++ compilation of rule '@nanopb_git//:nanopb' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command external/local_config_cuda/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter ... (remaining 36 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. gcc: error: AVX2: No such file or directory 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: 5.002s, Critical Path: 2.46s

If I go with out providing optimization flag its work fine.

@aselle
Copy link
Contributor

aselle commented Feb 19, 2017

AVX2 is not an optimization flag. Use -mavx2

@aselle aselle added the stat:awaiting response Status - Awaiting response from author label Feb 19, 2017
@aselle
Copy link
Contributor

aselle commented Feb 19, 2017

MAVX2 is not an optimization flag. You need to make sure what you are passing there works on your compiler. Try man gcc to see valid flags. For MAVX2 you need -mavx2. Thanks!

@aselle aselle added the type:build/install Build and install issues label Feb 19, 2017
@hannan-sultan
Copy link
Author

Thanks, solved the problem. Can you confirm for multiple flags parameters should be -mavx2, -mavx, msse4.1

@aselle aselle removed the stat:awaiting response Status - Awaiting response from author label Feb 20, 2017
@aselle
Copy link
Contributor

aselle commented Feb 21, 2017

I believe you only need -mavx2 to get all previous sse extensions (check the man page or gcc documentation for more details). If you really want to use multiple, you'd probably just separate them with spaces i.e. "-mavx2 -msse4.2" etc.

@aselle aselle added the stat:awaiting response Status - Awaiting response from author label Feb 21, 2017
@aselle
Copy link
Contributor

aselle commented Mar 3, 2017

Automatically closing due to lack of recent activity. Please update the issue when new information becomes available, and we will reopen the issue. Thanks!

@aselle aselle closed this as completed Mar 3, 2017
@n1kt0
Copy link

n1kt0 commented May 9, 2017

i think when you keep the default "-march=native"-flag it will detect all your available hardware instructions.

@hannan-sultan
Copy link
Author

@n1kt0 I left this default, cause no issue but when I am working it gives me a warning. When I tried to configure it ran into issues.

@n1kt0
Copy link

n1kt0 commented Aug 10, 2017

@CodeLoverr gives it you a warning that it wasn't compiled with the flags set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response Status - Awaiting response from author type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

3 participants