diff --git a/js/web/lib/wasm/jsep/init.ts b/js/web/lib/wasm/jsep/init.ts index d66357e729d5d..badfea76c6864 100644 --- a/js/web/lib/wasm/jsep/init.ts +++ b/js/web/lib/wasm/jsep/init.ts @@ -132,7 +132,8 @@ class ComputeContextImpl implements ComputeContext { export const init = async(module: OrtWasmModule, env: Env): Promise => { const init = module.jsepInit; - if (init && navigator.gpu) { + const hasGpu = !!(navigator.gpu && await navigator.gpu.requestAdapter()) + if (init && hasGpu) { if (!env.wasm.simd) { throw new Error( 'Not supported for WebGPU=ON and SIMD=OFF. Please set `env.wasm.simd` to true when using WebGPU EP');