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

IOS app crash 0.2.1 #637

Closed
AngeloMateus opened this issue Jul 21, 2024 · 1 comment · Fixed by #639
Closed

IOS app crash 0.2.1 #637

AngeloMateus opened this issue Jul 21, 2024 · 1 comment · Fixed by #639

Comments

@AngeloMateus
Copy link

IOS app crashes on launch with the following error:

-[MTLDebugComputeCommandEncoder dispatchThreadgroups:threadsPerThreadgroup:]:1054: failed assertion `(threadgroupsPerGrid.width(0) * threadgroupsPerGrid.y(1) * threadgroupsPerGrid.depth(1))(0) must not be 0.'

Previously tested working version: vello 0.1.0 (with bevy_vello 0.3.3)

Initially discussed here

Does anyone know how I can fix this?

@DJMcNab
Copy link
Member

DJMcNab commented Jul 22, 2024

Thanks for the report.

There are a few things going on here:

  1. We support iOS only on a best-effort basis.
  2. That error suggests that one of the CPU side workgroup sizes is zero. These are set in
    Self {
    use_large_path_scan,
    path_reduce: (path_tag_wgs, 1, 1),
    path_reduce2: (PATH_REDUCE_WG, 1, 1),
    path_scan1: (reduced_size / PATH_REDUCE_WG, 1, 1),
    path_scan: (path_tag_wgs, 1, 1),
    bbox_clear: (draw_object_wgs, 1, 1),
    flatten: (flatten_wgs, 1, 1),
    draw_reduce: (draw_monoid_wgs, 1, 1),
    draw_leaf: (draw_monoid_wgs, 1, 1),
    clip_reduce: (clip_reduce_wgs, 1, 1),
    clip_leaf: (clip_wgs, 1, 1),
    binning: (draw_object_wgs, 1, 1),
    tile_alloc: (path_wgs, 1, 1),
    path_count_setup: (1, 1, 1),
    backdrop: (path_wgs, 1, 1),
    coarse: (width_in_bins, height_in_bins, 1),
    path_tiling_setup: (1, 1, 1),
    fine: (width_in_tiles, height_in_tiles, 1),
    }
    . Can you please confirm which of those values has a first component of 0 for you?
  3. The WebGPU spec requires that this case be supported. It is a bug in wgpu that this doesn't work. Can you please submit a minimal reproduction to them? This case should also be covered in the cts
  4. We should be able to work around this ourselves, as dispatching a command doesn't have any observable side effects.
  5. We might run into the same issue with indirect buffers. That will likely require a more involved workaround, or changing the WebGPU spec to not support this case.

github-merge-queue bot pushed a commit that referenced this issue Jul 22, 2024
This should fix #637. Note this hack should be removed once the issue is
fixed in upstream wgpu.
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

Successfully merging a pull request may close this issue.

2 participants