From ee6ee5142b4049e3a081257faad271fa958198ee Mon Sep 17 00:00:00 2001 From: Dharma Bellamkonda Date: Sat, 13 Jun 2026 13:05:30 -0600 Subject: [PATCH] Pin ggml CPU baseline to AVX2 instead of -march=native ggml's runtime ggml_cpu_has_*() helpers are compile-time macros, not CPUID probes, so a CI build with GGML_NATIVE=ON on a runner that happens to have AVX-512 embeds AVX-512 instructions in the static lib. Intel disabled AVX-512 on all consumer 12th-14th gen CPUs, so the resulting binaries crash with STATUS_ILLEGAL_INSTRUCTION during whisper_init on common user hardware (e.g. issue #701, Raptor Lake). Disable GGML_NATIVE and explicitly enable AVX, AVX2, F16C, FMA, BMI2, and SSE4.2 on amd64 builds (Windows and Linux). Matches the AVX2 guard already enforced in cmd/skyeye/main.go. macOS arm64 is unaffected. Co-Authored-By: Claude Opus 4.7 --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index decb109f..5a94c505 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ SKYEYE_SCALER_BIN = skyeye-scaler.exe GO = /ucrt64/bin/go GOBUILDVARS += GOROOT="/ucrt64/lib/go" GOPATH="/ucrt64" # Use MSYS Makefiles generator for cmake on MSYS2 -WHISPER_CPP_CMAKE_ARGS = -G "MSYS Makefiles" +WHISPER_CPP_CMAKE_ARGS += -G "MSYS Makefiles" # Static linking on Windows to avoid MSYS2 dependency at runtime LIBRARIES = opus soxr CFLAGS = $(shell pkg-config $(LIBRARIES) --cflags --static) @@ -78,6 +78,15 @@ EXTLDFLAGS = $(shell pkg-config $(LIBRARIES) --libs --static) LDFLAGS += -linkmode external -extldflags "$(EXTLDFLAGS) -lgomp -static" endif +# AMD64-specific settings (Windows and Linux) +ifeq ($(GOARCH),amd64) +# Pin CPU features explicitly instead of letting ggml auto-detect via +# -march=native. CI runners may have AVX-512, but Intel disabled it on +# consumer 12th-14th gen CPUs, causing STATUS_ILLEGAL_INSTRUCTION crashes. +WHISPER_CPP_CMAKE_ARGS += -DGGML_NATIVE=OFF -DGGML_AVX=ON -DGGML_AVX2=ON \ + -DGGML_F16C=ON -DGGML_FMA=ON -DGGML_BMI2=ON -DGGML_SSE42=ON +endif + BUILD_VARS += LDFLAGS='$(LDFLAGS)' BUILD_FLAGS += -ldflags '$(LDFLAGS)' GO := $(GOBUILDVARS) $(GO)