TensorFlow "Illegal instruction (core dumped)" on import in CI
The process crashed with SIGILL on import tensorflow. The official wheels are compiled with AVX (and often AVX2) instructions; a runner CPU or VM that does not expose those instructions executes an illegal opcode and dies.
What this error means
Importing tensorflow immediately prints "Illegal instruction (core dumped)" and the process exits with no Python traceback.
python
$ python -c "import tensorflow"
Illegal instruction (core dumped)Common causes
The CPU lacks AVX instructions the wheel requires
TF wheels assume AVX. An older CPU model, or a VM that masks AVX, hits an instruction the wheel uses and crashes at import.
A wheel built for a newer instruction set than the host
A build expecting AVX2/AVX-512 running on a host without it fails the same way with SIGILL.
How to fix it
Run on a runner whose CPU supports AVX
- Check the CPU flags with
grep -o avx /proc/cpuinfo | head -1. - Move the job to a runner model that exposes AVX/AVX2.
- Re-run the import to confirm it no longer crashes.
Terminal
grep -o -m1 'avx2\|avx' /proc/cpuinfo || echo "no AVX on this runner"Use a build without AVX requirements
Install a TF version or community wheel compiled without AVX for CPUs that lack it.
Terminal
pip install tensorflow-cpu==2.11.0 # older wheels target a lower instruction baselineHow to prevent it
- Pin GPU/CPU jobs to runner models that expose AVX.
- Check /proc/cpuinfo flags when adding new runner hardware.
- Use a TF build matched to the runner instruction baseline.
Related guides
PyTorch "version `GLIBCXX_3.4.x' not found" in CIFix "ImportError: version `GLIBCXX_3.4.30' not found" in CI - the C++ standard library (libstdc++) on the run…
TensorFlow protobuf version conflict in CIFix the TensorFlow protobuf incompatibility in CI - a protobuf version outside TensorFlow's supported range r…
ML job "Killed" (host OOM) during training in CIFix an ML training step that prints only "Killed" in CI - the Linux OOM killer terminated the process for exc…