Button click causes GPU crash in AR mode - Samsung Galaxy S25

Needle Engine 4.15.0, Samsung Galaxy S25, Android Chrome. When I click a custom button inside #arui (which is inside needle-engine tag) during WebXR AR session, Chrome crashes with “Aw Snap” immediately. The button click doesn’t even reach the JS event handler (no console logs). This seems to be a GPU-level crash, not a JS error. Other buttons like resetBtn work fine without crash. The only difference is the shutter button was previously using setAttribute(‘style’, 
) which overwrote CSS position styles. I fixed that but crash still happens. Any known fix for button click crash during AR session?

This sounds like a known WebGL context loss issue in Chrome on some Samsung devices when DOM interactions trigger GPU reallocation during an AR session. The “Aw Snap” crash before JS reaches the handler means the GPU process died.

Since you already cleaned up setAttribute('style', ...), check if the shutter button uses CSS transitions, gradients, will-change, or transform — these can cause compositor crashes in WebXR. Try removing all custom CSS on that button and use inline styles only. Also test without any #arui content to isolate.

If still crashing, share a URL to your deployed scene so we can inspect. For a quick test, create a minimal scene at Needle-engine - Vite Template (duplicated) - StackBlitz with just a button and see if it crashes there. If it does, it’s a device/browser bug; if not, the issue is in your scene’s structure or styles.

Sources: Needle Engine Docs (69%)

1 replies left - Become PRO for more replies.
Reply to this post directly if you need further help (bottom right button)

I tested with minimal HTML - just a single button inside needle-engine tag in AR mode.
Still crashes on Samsung Galaxy S25, Android Chrome.

Button CSS: position:absolute, no transitions, no transforms.
JS click handler never fires before crash.
This seems to be a device/browser level GPU crash.

Can you reproduce this on S25?

This is almost certainly a Samsung GPU driver bug in Chrome/WebXR on the S25, not a Needle Engine issue — especially since it crashes before JS executes and persists with minimal HTML.

Quick test: Open the official Immersive AR sample on your S25 and add a <button> via DevTools overlay. If it also crashes, it’s Samsung/Chrome specific. If it doesn’t, something in your scene triggers the crash (e.g., a specific glTF extension, lightmaps, or physics body).

Workaround to try:

  • Replace click with pointerdown event on the button
  • Add touch-action: manipulation CSS to the button
  • Disable Chrome GPU rasterization at chrome://flags/#enable-gpu-rasterization (set to Disabled)

Best next step: Share a URL to your deployed scene so we can inspect. If you can’t deploy publicly, create a minimal reproducible example at engine.needle.tools/new and link it here.

Sources: Needle Engine Docs (63%)

1 replies left - Become PRO for more replies.
Reply to this post directly if you need further help (bottom right button)

Update: Tested official Needle Engine AR samples on S25 Chrome.
Previous/Next buttons work fine in AR mode, no crash.

So the issue is specific to my scene, not Samsung/Chrome bug.

My scene differences from samples:

  • Custom GLB models (palm trees, tiger, monkey animations)
  • ShadowMaterial for ground shadows
  • hit-test + anchors placement
  • Custom TypeScript component (PalmAR.ts)
  • camera-access optionalFeature requested

What in my scene could cause button clicks to crash GPU?
Can I share my scene URL for inspection?

Given that official Needle samples work fine on your S25 but your scene crashes, the issue is likely GPU overload during AR. Since crash happens before JS executes, it’s a WebGL context loss — Chrome kills the GPU process when a GPU operation fails.

Your THREE.ShadowMaterial with custom GLB models (especially with animations) plus camera-access is the most common trigger: camera feed forces GPU reallocation and can conflict with other GPU work when a DOM event fires.

Try these:

  • Disable camera-access and test
  • Replace ShadowMaterial with a simpler ground plane
  • Reduce texture resolution on your GLBs

Share your scene URL for inspection — I can help identify the specific cause.

1 replies left - Become PRO for more replies.
Reply to this post directly if you need further help (bottom right button)

Further testing results:

  1. Empty AR scene (no GLB objects, no ShadowMaterial) - button still crashes
  2. camera-access disabled - still crashes
  3. The crash happens specifically when getCameraImage() is called on XRWebGLBinding
  4. Before getCameraImage: getBinding=OK, camera-access=true, view.camera=true
  5. getCameraImage() itself causes immediate GPU process crash

This seems to be a Samsung S25 specific issue with XRWebGLBinding.getCameraImage().
Has anyone successfully called getCameraImage() on Samsung S25 Chrome?
Is there a known workaround?

This is a Samsung/Chrome WebXR bug with getCameraImage(), not a Needle Engine issue. You’ve isolated it perfectly: minimal scene, verified all preconditions, and getCameraImage() itself crashes the GPU process.

Workarounds:

  1. Detect device (navigator.userAgent.includes("SM-") for Galaxy) and skip camera texture on those devices
  2. Use a transparent fallback texture when getCameraImage() fails
  3. Disable camera-access entirely on S25

To confirm: deploy your minimal crashing scene to a URL and share it here. I can inspect if there’s any other factor. Also file a Chromium bug at crbug.com referencing getCameraImage() GPU crash on S25 — Samsung often fixes these in updates.

1 replies left - Become PRO for more replies.

Sources: Needle Engine Docs (60%)

1 replies left - Become PRO for more replies.
Reply to this post directly if you need further help (bottom right button)

Here is the URL to test: https://ceremony-curse-survivor.ngrok-free.dev

Steps to reproduce on Samsung S25 Chrome:

  1. Open URL
  2. Press START
  3. Scan floor and place objects
  4. Press the white circle button (shutter) on the left side
  5. Chrome crashes immediately

The getCameraImage() call on XRWebGLBinding causes GPU crash.
Please test on S25 if possible.

This is a Samsung S25 Chrome WebXR bug with getCameraImage(), not a Needle Engine issue. You’ve already proven it with a minimal test case.

Workaround: Detect Galaxy S25 devices (navigator.userAgent.includes("SM-") and Chrome) and skip getCameraImage() entirely — use a transparent fallback texture instead.

To verify: test on another Android device or Samsung S24 — if it works, it’s S25-specific.

Next step: file a bug at crbug.com referencing XRWebGLBinding.getCameraImage() GPU crash on S25 Chrome — include your ngrok URL as a repro.

Your scene works fine. The fix needs to come from Samsung/Google in a Chrome update.

0 replies left - Become PRO for more replies.
Reply to this post directly if you need further help (bottom right button)

Update: Also tested on Samsung Galaxy S9+ (SM-G965N).
Same crash with getCameraImage().
This is not S25-specific - it affects multiple Samsung devices.
Both devices crash on getCameraImage() call.

Is there any Samsung-specific workaround for getCameraImage()?
Or is there another way to capture AR camera feed on Samsung devices?