illegal instruction error when building Tensorflow from source

前端 未结 1 1316
没有蜡笔的小新
没有蜡笔的小新 2021-01-19 14:50

I\'m building tensorflow from source with bazel, as described here: https://www.tensorflow.org/install/install_sources

Following the installation doc, I

相关标签:
1条回答
  • 2021-01-19 15:20

    The error message tells me your program was compiled with instructions your processor doesn't have and a look at your build string makes me suspect of -mavx2 and -mfma which AFAIK are implemented only in rather recent (and high-end) CPUs. Please note, gcc will compile just fine with flags for instructions your CPU doesn't support, but the program won't run on your machine.

    To make sure your CPU supports those flags, run in bash gcc -march=native -Q --help=target | grep enabled and check that the output contains all the build flags you want to use (with the exception of -mfpmath which doesn't show as enabled or disabled since it allows a list of output. For that you'll need to check the full gcc -march=... command output).

    To answer to your final comment, there is no way to "enable" these instructions, they are implemented in hardware and either they are available on your CPU, or they aren't.

    0 讨论(0)
提交回复
热议问题