Repository navigation
feat(addon): point AVX2-less users to the legacy-cpu compat packs - #544
Merged
Merged
Conversation
The built-in addon packs need AVX2/FMA/F16C/BMI2. On an older CPU the app already warns about it, but gave no way forward. Compat packs built for an AVX-only baseline are published on buxuku/whisper.cpp (tag legacy-cpu); they are manual-import only, so users need to be told where to get them and how to import them. - CPU advisory notice: when the CPU has AVX but lacks AVX2 (Windows/Linux, not translated), add a "Download and import guide" button that opens the legacy-cpu release page. No button for CPUs without AVX, macOS, or translated environments, since no pack can run there. - Once a custom addon is already enabled, the notice switches to a neutral info state asking the user to confirm it is the legacy pack, and refreshes live when the custom addon changes (gpu-settings-changed). - Custom addon section: add a second "Legacy CPU pack" link next to the existing download link (the standard packs on the latest release require AVX2, so the two links must not be mixed up) plus a short tip. - zh/en strings and tests for the eligibility policy, the notice and the custom addon section.
On Windows/Linux, CPU Only returned just the built-in CPU pack, so a
custom addon the user had picked was silently ignored. Auto, GPU Only and
macOS already put the custom addon first, which made the CPU advisory
notice ("custom addon enabled") untrue in CPU Only and forced the legacy
CPU pack guidance to tell users to keep the mode on Auto.
- addonLoader: the custom addon is now first in every mode. CPU Only
resolves to custom -> built-in CPU, so a custom file that fails to load
still falls back to the built-in pack.
- addonLoader: in CPU Only on Windows/Linux, force use_gpu=false on every
native call. "Disable GPU acceleration entirely" and the CPU-only status
card stay true even when the custom pack is a GPU build. macOS is
unchanged, it never looked at the acceleration mode.
- Drop the "keep the acceleration mode on Auto" advice from the legacy
pack copy (advisory notice and custom addon tip, zh/en) and the test
assertions that required it.
- Add scripts/gpu/test-addon-candidates.ts (wired into
test:gpu-enumeration): candidate order per mode and platform, the
use_gpu override, and the fallback when the custom file fails to load.
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
Users whose CPU has AVX but not AVX2 (Sandy Bridge / Ivy Bridge, AMD Bulldozer era) already get a CPU advisory notice, but it only suggests cloud speech recognition or another engine. Compat packs built for an AVX-only baseline are published as the
legacy-cpupre-release onbuxuku/whisper.cpp. They are manual-import only, so nobody could find them from inside the app.This PR points eligible users to that release page, which carries the step-by-step download and import guide (Chinese first, then English). Nothing is downloaded or installed automatically.
What changed
renderer/lib/legacyCpuPack.ts):canUseLegacyCpuPack(advisory)is true only when the advisory is applicable and not translated, the platform is Windows or Linux, some feature is explicitly missing, and that feature is not AVX itself. A CPU without AVX cannot run the packs, and there are no macOS / ARM / translated variants.openUrlIPC.gpu-settings-changedwindow event).latestrelease, whose packs require AVX2, so the two links must not be mixed up.What does not change
.nodecheck.Verification
LegacyCpuPack.test.ts(6),CpuAdvisoryNotice.test.tsx(14),GpuCustomAddonSection.test.tsx(4). They were written test-first, and removing the AVX guard from the policy makes the negative cases fail.npm run typecheckexits 0,npm run check:i18npasses, and Prettier is clean on all changed files.EngineRuntimeImport,ProofreadImport) hit their default time budgets in separate runs; both pass in isolation and when only the time budgets are relaxed. This PR does not load either of them.Notes for reviewers