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)