tensorflow-build icon indicating copy to clipboard operation
tensorflow-build copied to clipboard

import tensorflow failed! -- Illegal instruction (core dumped)

Open vishalleo1 opened this issue 3 years ago • 3 comments

we use the user provide .whl file for build the tensor-flow on our system.

system details:

we use the Ubuntu 18.04 cpu : Intel(R) Celeron(R) CPU J1900 @ 1.99GHz ram: 8gb python : 3.7.5

we use the file "tensorflow-2.2.0-cp37-cp37m-linux_x86_64.whl" source link : https://github.com/lakshayg/tensorflow-build/releases/download/tf2.2.0-py3.7-ubuntu18.04/tensorflow-2.2.0-cp37-cp37m-linux_x86_64.whl

leotechsa@leotechsa-desktop:~$ pip3 show tensorflow Name: tensorflow Version: 2.2.0 Summary: TensorFlow is an open source machine learning framework for everyone. Home-page: https://www.tensorflow.org/ Author: Google Inc. Author-email: [email protected] License: Apache 2.0 Location: /home/leotechsa/.local/lib/python3.7/site-packages Requires: absl-py, astunparse, gast, google-pasta, grpcio, h5py, keras-preprocessing, numpy, opt-einsum, protobuf, scipy, six, tensorboard, tensorflow-estimator, termcolor, wheel, wrapt Required-by:

leotechsa@leotechsa-desktop:~$ python3 Python 3.7.5 (default, Feb 23 2021, 13:22:40) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import tensorflow Illegal instruction (core dumped)

leotechsa@leotechsa-desktop:~$ python3 -c 'import tensorflow as tf; print(tf.version)' Illegal instruction (core dumped) leotechsa@leotechsa-desktop:~$

vishalleo1 avatar Nov 17 '21 12:11 vishalleo1

This is probably because your machine does not support the instruction sets this binary was compiled with. Can you please post the output of cat /proc/cpuinfo | grep flags on your system?

lakshayg avatar Nov 20 '21 06:11 lakshayg

sorry for the late, this output of the

leotechsa@leotechsa-desktop:~$ cat /proc/cpuinfo | grep flags flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer rdrand lahf_lm 3dnowprefetch epb pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat md_clear flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer rdrand lahf_lm 3dnowprefetch epb pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat md_clear flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer rdrand lahf_lm 3dnowprefetch epb pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat md_clear flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer rdrand lahf_lm 3dnowprefetch epb pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat md_clear

vishalleo1 avatar Nov 24 '21 13:11 vishalleo1

The binary you are using was compiled with support for fma avx avx2 sse4_1 sse4_2. Your flags output does not contain fma avx avx2 which means that your machine is unable to execute those instructions. That's what generates the Illegal instruction error.

Unfortunately, I do not have binaries that don't use fma avx avx2. The best solution would be for you to build TF locally.

lakshayg avatar Nov 25 '21 00:11 lakshayg