From 0bb258c594276c941e203964e7021c97f4707028 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Thu, 9 Jan 2025 15:33:48 -0800 Subject: [PATCH] Confirm success of reinitialization after a device loss. I wish iOS would just play nice but oh well for now. Get rid of useless logging and redundant reset call. --- src/lib/nano-pow/classes/gpu.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/nano-pow/classes/gpu.ts b/src/lib/nano-pow/classes/gpu.ts index 36df721..89cb9a0 100644 --- a/src/lib/nano-pow/classes/gpu.ts +++ b/src/lib/nano-pow/classes/gpu.ts @@ -93,8 +93,7 @@ export class NanoPowGpu { }) } - static reset (loss?: GPUDeviceLostInfo): void { - if (loss) console.dir(loss) + static reset (): void { console.warn(`GPU device lost. Reinitializing...`) NanoPowGpu.#cpuBuffer?.destroy() NanoPowGpu.#gpuBuffer?.destroy() @@ -192,7 +191,6 @@ export class NanoPowGpu { this.#cpuBuffer.unmap() } catch (err) { console.warn(`Error getting data from GPU. ${err}`) - this.reset() return this.search(hash, threshold) } if (data == null) throw new Error(`Failed to get data from buffer.`) -- 2.34.1