Skip to content

Private AI meeting notes that stay on your computer. No meeting bot. Free and open source for Mac, Windows and Linux. An alternative to Granola, Otter and Fireflies.

Transcripts: whisper-server that hangs twice on the graphics card (Windows/Linux) starts again on the processor with its relaunches back (#76: a GTX 1050 Ti left every transcript empty)

christianmatfe83650bb8ee
diff --git a/app/src/main/asr/server.ts b/app/src/main/asr/server.ts
index 599ad03c..63d4fa17 100644
--- a/app/src/main/asr/server.ts
+++ b/app/src/main/asr/server.ts
@@ -112,6 +112,10 @@ export function createWhisperServer(o: Opts) {
let died = false
/** a launch died before it answered, with gpuFallback: the graphics stay off from now on */
let cpuOnly = false
+ /** hangs on the graphics card (gpuFallback): the second one turns them off (#76) */
+ let gpuHangs = 0
+ /** a hang on the graphics card twice (#76: a GTX 1050 Ti under Vulkan never answered) turns them off for good */
+ const GPU_HANGS = 2
const launch = async (): Promise<string> => {
if (o.pidFile) { mkdirSync(dirname(o.pidFile), { recursive: true }); killStale(o.pidFile, o.lookup) }
@@ -190,13 +194,20 @@ export function createWhisperServer(o: Opts) {
resetBudget() { used = 0 },
/**
* It hangs or died: kill it and start another (the same relaunch as after a crash). `used` is the address the failed
- * request went to; if a newer launch exists or is starting, another request already did this, so just wait for that one.
+ * request went to (`at`); if a newer launch exists or is starting, another request already did this, so just wait for that one.
*/
- async wedged(used?: string): Promise<string> {
- if (used === undefined || starting || launchUrl !== used) return self.url()
+ async wedged(at?: string): Promise<string> {
+ if (at === undefined || starting || launchUrl !== at) return self.url()
const p = child
if (p) { child = null; address = null; p.kill('SIGKILL') }
died = true
+ if (o.gpuFallback && !cpuOnly && ++gpuHangs >= GPU_HANGS) {
+ cpuOnly = true
+ // a new way of running: the meeting's relaunches start over for it
+ used = 0
+ console.error('whisper-server hung twice on the graphics card; starting it again without it')
+ o.onGpuOff?.()
+ }
return self.url()
},
/** does the server at this address (default: the current one) answer? */
diff --git a/app/test/asrServer.test.ts b/app/test/asrServer.test.ts
index 85bc6c36..95951d74 100644
--- a/app/test/asrServer.test.ts
+++ b/app/test/asrServer.test.ts
@@ -114,6 +114,31 @@ describe.skipIf(process.platform === 'win32')('whisper server', () => {
expect(args()).toContain('-ng')
})
+ // #76: a GTX 1050 Ti under Vulkan loaded fine but never answered; three relaunches on the card, then empty transcripts
+ it('off a Mac, a server that hangs on the graphics card twice starts again without it, with its relaunches back', async () => {
+ const bin = fakeBinary(0, ['wedge', 'wedge', 'ok'])
+ const args = () => JSON.parse(readFileSync(join(bin, '../args'), 'utf8')) as string[]
+ const off = vi.fn()
+ const s = make(bin, { gpuFallback: true, onGpuOff: off, backoffMs: [0, 0] })
+ const first = await s.url()
+ expect(args()).not.toContain('-ng')
+ const second = await s.wedged(first)
+ expect(args()).not.toContain('-ng')
+ await s.wedged(second)
+ expect(args()).toContain('-ng')
+ expect(s.cpuOnly).toBe(true)
+ expect(off).toHaveBeenCalledTimes(1)
+ // the processor gets the meeting's relaunches afresh
+ const third = await s.url()
+ await expect(s.wedged(third)).resolves.toMatch(/^http/)
+ })
+ it('a Mac keeps its graphics however often it hangs (Metal)', async () => {
+ const bin = fakeBinary(0, ['wedge'])
+ const s = make(bin)
+ await s.wedged(await s.wedged(await s.url()))
+ expect(JSON.parse(readFileSync(join(bin, '../args'), 'utf8'))).not.toContain('-ng')
+ })
+
it('a Mac never turns the graphics off, and one that crashes after loading keeps them', async () => {
const mac = fakeBinary(0, ['die-loading', 'ok'])
const s = make(mac)