From b123c1e5c07657ac63f564e03fde1dd257d87e9c Mon Sep 17 00:00:00 2001 From: CJ Pais Date: Thu, 2 Apr 2026 08:20:28 +0800 Subject: [PATCH] fix crash on old cpus (#1176) * fix crash on old cpu * fix * disable whisper extensions --- .github/workflows/build.yml | 11 +++++++++-- src-tauri/src/managers/transcription.rs | 10 ++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a46165f..530addf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -353,8 +353,15 @@ jobs: AZURE_TENANT_ID: ${{ inputs.sign-binaries && secrets.AZURE_TENANT_ID || '' }} TAURI_SIGNING_PRIVATE_KEY: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY || '' }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD || '' }} - WHISPER_NO_AVX: ${{ contains(inputs.platform, 'ubuntu') && !contains(inputs.platform, 'arm') && 'ON' || '' }} - WHISPER_NO_AVX2: ${{ contains(inputs.platform, 'ubuntu') && !contains(inputs.platform, 'arm') && 'ON' || '' }} + # Disable -march=native and all SIMD instruction sets above SSE4.2 for + # x86_64 builds. Without this, CPUs lacking AVX/FMA (e.g. Celeron N2920, + # FX-8350) crash with SIGILL. The Vulkan backend handles heavy compute + # so disabling these has negligible performance impact. + GGML_NATIVE: ${{ !contains(inputs.platform, 'macos') && !contains(inputs.platform, 'arm') && !contains(inputs.target, 'aarch64') && 'OFF' || '' }} + GGML_AVX: ${{ !contains(inputs.platform, 'macos') && !contains(inputs.platform, 'arm') && !contains(inputs.target, 'aarch64') && 'OFF' || '' }} + GGML_AVX2: ${{ !contains(inputs.platform, 'macos') && !contains(inputs.platform, 'arm') && !contains(inputs.target, 'aarch64') && 'OFF' || '' }} + GGML_FMA: ${{ !contains(inputs.platform, 'macos') && !contains(inputs.platform, 'arm') && !contains(inputs.target, 'aarch64') && 'OFF' || '' }} + GGML_F16C: ${{ !contains(inputs.platform, 'macos') && !contains(inputs.platform, 'arm') && !contains(inputs.target, 'aarch64') && 'OFF' || '' }} with: tagName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }} releaseName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }} diff --git a/src-tauri/src/managers/transcription.rs b/src-tauri/src/managers/transcription.rs index 0844b93..2ccd6af 100644 --- a/src-tauri/src/managers/transcription.rs +++ b/src-tauri/src/managers/transcription.rs @@ -781,6 +781,16 @@ fn cached_gpu_devices() -> &'static [GpuDeviceOption] { use transcribe_rs::whisper_cpp::gpu::list_gpu_devices; GPU_DEVICES.get_or_init(|| { + // ggml's Vulkan backend uses FMA3 instructions internally. + // On older CPUs without FMA3 (e.g. Sandy Bridge Xeons) this causes + // a SIGILL crash that cannot be caught. Skip enumeration entirely + // on those CPUs — GPU-accelerated whisper won't work there anyway. + #[cfg(target_arch = "x86_64")] + if !std::arch::is_x86_feature_detected!("fma") { + warn!("CPU lacks FMA3 support — skipping GPU device enumeration"); + return Vec::new(); + } + list_gpu_devices() .into_iter() .map(|d| GpuDeviceOption {