Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions electron/stt/gpuDetector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ export interface ResolvedBinary {
}

/**
* Return the platform's default binary backend tag. This is only used for
* logging and as a fallback; the helper's response corrects it at runtime.
* Return the platform's default binary backend tag. The helper's response
* corrects it at runtime, with one exception: `whispercpp-cpu` makes
* `WhisperServerManager` launch the helper with `--cpu`, since the macOS x64
* build still carries ggml's default-on Metal backend (#1594).
*/
export async function detectGpuBackend(): Promise<GpuProbeResult> {
switch (process.platform) {
Expand Down
3 changes: 3 additions & 0 deletions electron/stt/whisperServer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ describe("WhisperServerManager", () => {
expect(args).not.toContain("--cuda");
expect(args).not.toContain("--int8");
expect(args).not.toContain("--vad");
// A CPU-labelled helper is CPU from the first launch: the macOS x64 build
// still carries ggml's default-on Metal backend (#1594).
expect(args).toContain("--cpu");
expect(args[args.indexOf("--threads") + 1]).toBe(String(inferenceThreads()));
const os = await import("node:os");
expect(vi.mocked(os.default.setPriority)).toHaveBeenCalledWith(1234, 10);
Expand Down
6 changes: 5 additions & 1 deletion electron/stt/whisperServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,12 @@ export class WhisperServerManager {
return { port, backend: activeBackend };
};

// A CPU-labelled helper runs with `--cpu` from its first launch. The label does
// not make the binary CPU-only: ggml turns Metal on by default for every Apple
// build, so the macOS x64 helper carries it, and without the flag whisper.cpp
// decodes on the Intel iGPU — which hung the UHD 630 render ring (#1594).
try {
return await launch(false);
return await launch(resolved.backend === "whispercpp-cpu");
Comment thread
EtienneLescot marked this conversation as resolved.
Resolved
} catch (err) {
const startupLog = `${err instanceof Error ? err.message : String(err)} ${this.stderrTail}`;
const startupLines = startupLog.split(/\r?\n/);
Expand Down
Loading