Skip to content

[WebGPU] Real-ESRGAN Clip node fails with "Failed to run JSEP kernel" — Pro mode silently falls back to WASM #4

Description

@weichin77

When running Video Upscale 4K in Pro mode (this also affects the Quick/Enhance image modes, which share the same worker), the ONNX Runtime Web session is created successfully with the webgpu execution provider and a real GPU adapter is confirmed available — but inference throws on a Clip node during the actual run:

[E:onnxruntime:, sequential_executor.cc:572 ExecuteKernel] Non-zero status code returned while running Clip node. Name:'/Clip' Status Message: Failed to run JSEP kernel

pro-worker.js's per-strategy try/catch swallows this exception and silently retries with wasm, so the app reports [WASM] as the active backend with no visible indication that WebGPU was attempted and failed. The "WebGPU ready" badge in the top-right corner is unaffected by this — it only reflects a one-time navigator.gpu.requestAdapter() check on the main thread at page load and never reflects what actually happens inside the worker on a given run.

To reproduce

  1. Confirm await navigator.gpu.requestAdapter() resolves to a real GPUAdapter in DevTools console (i.e. WebGPU genuinely works in this browser).
  2. Start a Pro mode video upscale (or Quick/Enhance image upscale).
  3. Open DevTools Console — the ORT warning/error above appears.
  4. Check the progress label — it shows [WASM], never [WEBGPU].

Expected behavior

Either WebGPU inference succeeds, or — if a fallback is genuinely necessary — the fallback and its cause are surfaced somewhere visible (at minimum a console.warn) instead of being caught and hidden silently.

Environment

  • OS: Windows 10/11 (desktop build)
  • NextGenUp version: 1.2.0
  • Browser/webview: WebView2, [your Chrome/Edge version here]
  • GPU: [your GPU model here]
  • Pinned onnxruntime-web version (in pro-worker.js): 1.21.0, loaded from jsDelivr

Likely cause

This matches a known category of upstream ONNX Runtime Web WebGPU/JSEP bugs, where specific operators fail at runtime on certain model graphs even though session creation succeeds. A near-identical Clip/JSEP failure was reported against a different super-resolution model on onnxruntime-web 1.17.0 (microsoft/onnxruntime#19402) — the same model ran fine on wasm but never worked on webgpu. It's likely the Clip node in realesr-general-x4v3.onnx (probably the final 0–1 pixel clamp) combined with the pinned onnxruntime-web release.

Suggested fixes

  • Try bumping the pinned onnxruntime-web version in pro-worker.js to a newer release to see if this specific Clip/JSEP kernel issue has been fixed upstream.
  • Alternatively, re-export the ONNX model with the final clamp done as Min+Max instead of Clip, or move the clamp into JS after session.run() rather than inside the graph.
  • At minimum, add console.warn(err) in the strategy-loop catch block in pro-worker.js so this failure is visible in the console instead of only showing up as an unexplained [WASM] label.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions