fix crash on old cpus (#1176)
* fix crash on old cpu * fix * disable whisper extensions
This commit is contained in:
parent
743d8a54a7
commit
b123c1e5c0
2 changed files with 19 additions and 2 deletions
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
|
|
@ -353,8 +353,15 @@ jobs:
|
||||||
AZURE_TENANT_ID: ${{ inputs.sign-binaries && secrets.AZURE_TENANT_ID || '' }}
|
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: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY || '' }}
|
||||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ inputs.sign-binaries && secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD || '' }}
|
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' || '' }}
|
# Disable -march=native and all SIMD instruction sets above SSE4.2 for
|
||||||
WHISPER_NO_AVX2: ${{ contains(inputs.platform, 'ubuntu') && !contains(inputs.platform, 'arm') && 'ON' || '' }}
|
# 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:
|
with:
|
||||||
tagName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }}
|
tagName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }}
|
||||||
releaseName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }}
|
releaseName: ${{ inputs.release-id && format('v{0}', steps.get-version.outputs.version) || '' }}
|
||||||
|
|
|
||||||
|
|
@ -781,6 +781,16 @@ fn cached_gpu_devices() -> &'static [GpuDeviceOption] {
|
||||||
use transcribe_rs::whisper_cpp::gpu::list_gpu_devices;
|
use transcribe_rs::whisper_cpp::gpu::list_gpu_devices;
|
||||||
|
|
||||||
GPU_DEVICES.get_or_init(|| {
|
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()
|
list_gpu_devices()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|d| GpuDeviceOption {
|
.map(|d| GpuDeviceOption {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue