Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector graphics samples do not render but consume tons of memory #72

Open
bvisness opened this issue May 11, 2024 · 4 comments
Open

Vector graphics samples do not render but consume tons of memory #72

bvisness opened this issue May 11, 2024 · 4 comments

Comments

@bvisness
Copy link
Collaborator

On my M1 MacBook Air, the Breakout, Clock, and UI samples all present a blank screen and start using extreme amounts of real memory (growing to many gigabytes before my computer complains).

image

@martinfouilleul
Copy link
Collaborator

Fixed by ffc3c8a1.

Buffer size limits where using u32, but the webgpu implementation on M1 has a limit of 4GB (ie it overflows u32 size by one), and the oc_wgpu_canvas_encode_batch inner loop is done in such a way that we were looping indefinitely over the start of the buffer, allocating memory from the scratch arena at each iteration.

As a quick fix I changed the buffer max size computation to u64. But we should take better measures to prevent this kind of problem:

  • The encode batch loop should be restructured to prevent looping infinitely.
  • We should enable UB sanitizer to catch this kind of mistakes, and scrutinize the other places we do computations on wgpu limits.
  • We could reintroduce the hygienic versions of min/max macros, but enforce same type for both arguments

@Skytrias
Copy link
Collaborator

The C Clock sample memory still keeps on growing currently

@martinfouilleul
Copy link
Collaborator

martinfouilleul commented Dec 22, 2024

The C Clock sample memory still keeps on growing currently

Are you using a CI-built release, or did you build the runtime from latest main? (what's the output of orca version?)

You might be hitting another (untracked) issue that was fixed in 4547172

I triggered a test release with the latest fixes

@Skytrias
Copy link
Collaborator

The C Clock sample memory still keeps on growing currently

Are you using a CI-built release, or did you build the runtime from latest main? (what's the output of orca version?)

You might be hitting another (untracked) issue that was fixed in 4547172

I triggered a test release with the latest fixes

with the latest release it looks much better now, sticking around 220MB for the Clock Sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants