fix: failed to initialize WebGPU

This commit is contained in:
Xiaohan-Tian
2026-05-11 22:40:13 -07:00
parent d32dc35b6d
commit f57dd7c1da
3 changed files with 30 additions and 7 deletions
+10 -3
View File
@@ -111,14 +111,21 @@ class BrowserMdxSeparator {
localSeparatorLog('GPU DSP initialized successfully.');
} catch (error) {
console.warn('[localSeparator] GPU DSP initialization failed, using CPU DSP.', error);
options.onProviderChange?.('cpu/wasm fallback');
localSeparatorLog('GPU DSP initialization failed. Falling back to CPU DSP.', error);
options.onProviderChange?.('webgpu + cpu dsp fallback');
localSeparatorLog(
'GPU DSP initialization failed. Inference session may still use WebGPU, but DSP will fall back to CPU.',
error,
);
}
}
if (!dsp) {
dsp = new LocalSeparatorCpuDsp(config);
localSeparatorLog('Using CPU DSP.');
if (runtimeProvider === 'webgpu') {
localSeparatorLog('Using CPU DSP while keeping the WebGPU inference provider.');
} else {
localSeparatorLog('Using CPU DSP because the active inference provider is CPU/wasm.');
}
}
return new BrowserMdxSeparator(session, runtimeProvider, config, {