Skip to content

build: Default to -mavx instead of -march=native to fix Illegal Instruction crashes#466

Open
gijzelaerr wants to merge 1 commit intospotify:masterfrom
gijzelaerr:fix/ci-illegal-instruction-454
Open

build: Default to -mavx instead of -march=native to fix Illegal Instruction crashes#466
gijzelaerr wants to merge 1 commit intospotify:masterfrom
gijzelaerr:fix/ci-illegal-instruction-454

Conversation

@gijzelaerr
Copy link
Member

Summary

  • Changes the default SIMD compilation from -march=native to -mavx in both CMakeLists.txt and setup.py
  • -march=native is now opt-in via USE_MARCH_NATIVE=1 (for developers wanting max local performance)
  • Removes USE_PORTABLE_SIMD from CI workflow since portable SIMD is now the default
  • Fixes CI crashes where ccache restores objects built on runners with newer SIMD than the test runner
  • Fixes end-user crashes where PyPI wheels contain instructions not supported by the user's CPU

Closes #454

Root cause

The build used -march=native by default, which compiles for whatever CPU the builder has (potentially AVX-512). This causes SIGILL when:

  1. CI ccache restores objects from a runner with newer SIMD than the test runner
  2. Published wheels are built on a runner with AVX-512 but run on older CPUs

AVX has been baseline since Sandy Bridge (2011), so -mavx is safe for all modern x86_64 systems.

Test plan

  • CI tests should no longer crash with "Illegal instruction"
  • Local builds still work (verified on macOS arm64)
  • Developers can opt in to -march=native via USE_MARCH_NATIVE=1

🤖 Generated with Claude Code

…uction crashes

The build previously used -march=native by default, which compiles for
whatever CPU the builder has (potentially AVX-512). This causes "Illegal
instruction" crashes when:

1. CI ccache restores objects built on a runner with newer SIMD support
   than the test runner
2. Published PyPI wheels contain instructions not supported by the end
   user's CPU

The fix inverts the default: -mavx is now used by default (portable,
supported since Sandy Bridge 2011), and -march=native is opt-in via
USE_MARCH_NATIVE=1 for developers who want maximum local performance.

The old USE_PORTABLE_SIMD env var is removed from both build scripts
and CI, since portable SIMD is now the default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pedalboard 0.9.21 causes 'Illegal Instructions' on linux

1 participant