build: Default to -mavx instead of -march=native to fix Illegal Instruction crashes#466
Open
gijzelaerr wants to merge 1 commit intospotify:masterfrom
Open
build: Default to -mavx instead of -march=native to fix Illegal Instruction crashes#466gijzelaerr wants to merge 1 commit intospotify:masterfrom
gijzelaerr wants to merge 1 commit intospotify:masterfrom
Conversation
…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>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-march=nativeto-mavxin bothCMakeLists.txtandsetup.py-march=nativeis now opt-in viaUSE_MARCH_NATIVE=1(for developers wanting max local performance)USE_PORTABLE_SIMDfrom CI workflow since portable SIMD is now the defaultCloses #454
Root cause
The build used
-march=nativeby default, which compiles for whatever CPU the builder has (potentially AVX-512). This causes SIGILL when:AVX has been baseline since Sandy Bridge (2011), so
-mavxis safe for all modern x86_64 systems.Test plan
-march=nativeviaUSE_MARCH_NATIVE=1🤖 Generated with Claude Code