Closed Bug 1914934 Opened 9 months ago Closed 2 months ago

[WebGPU] 6GB memory spike followed by OOM crash on https://threejs.org/examples/?q=webgpu#webgpu_cubemap_adjustments

Categories

(Core :: Graphics: WebGPU, defect, P1)

defect

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- disabled
firefox136 --- disabled
firefox137 --- disabled
firefox138 --- fixed

People

(Reporter: mayankleoboy1, Assigned: teoxoy)

References

(Blocks 1 open bug, )

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

Go to https://threejs.org/examples/?q=webgpu#webgpu_cubemap_adjustments

AR: immediate 6GB spike in memory use, folowed by tab crash. Sometimes the whole system may become unstable.

Crash: https://crash-stats.mozilla.org/report/index/396ef55b-fcee-4f82-b9ba-84b840240826#tab-bugzilla

Attached file about:support

Chrome runs the demo just fine.
I can repro the OOM+Crash on a build from Feb2024. So this is not a recent regression.

Keywords: crash

This has the same underlying cause as Bug 1911540.

See Also: → 1911540

FWIW, memory use on Chrome doesnt exceed ~500MB and the demo loads and runs smoothly.

Do we want to keep this open to track the issue of us using too much memory or should we open a new bug?

Severity: -- → S3
Priority: -- → P1
See Also: → 1922702

Mayank could you try to repro it on a recent nightly? I have a hunch that this might be resolved. I think Bug 1887287 was a related issue and it was resolved.

Assignee: nobody → ttanasoaia
Status: NEW → ASSIGNED
Flags: needinfo?(mayankleoboy1)
See Also: → 1887287

It still repros.

Flags: needinfo?(mayankleoboy1) → needinfo?(ttanasoaia)
Flags: needinfo?(ttanasoaia)

The underlying cause here was us not implementing Bug 1922097. The console was full of:

Uncaught TypeError: GPUQueue.copyExternalImageToTexture: 'source' member of GPUCopyExternalImageSourceInfo could not be converted to any of: ImageBitmap, HTMLCanvasElement, OffscreenCanvas.

The three.js library was trying to load an asset by creating a texture and then copying via copyExternalImageToTexture. The app was trying to do so every frame because from its perspective the asset didn't load yet. So every frame, there was a texture being created after which JS execution stopped at copyExternalImageToTexture due to the TypeError, causing memory usage to balloon.

Depends on: 1922097
See Also: → 1954570

This specific page no longer encounters an issue on my M1 MacBook Pro and my Windows 11 workstation.

Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED

I opened https://github.com/gfx-rs/wgpu/issues/7460 to track the wgpu-core implementation of OOM detection & mitigation.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: