Skip to content
Latchkey

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

  1. Check the CPU flags with grep -o avx /proc/cpuinfo | head -1.
  2. Move the job to a runner model that exposes AVX/AVX2.
  3. 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 baseline

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →