nannou-org / nannou

A Creative Coding Framework for Rust.
https://nannou.cc/
6.04k stars 305 forks source link

Compute shader freezing system #972

Closed somecho closed 5 months ago

somecho commented 5 months ago
nannou: 0.19.0
OS: linux
GPU: Nvidia gtx1650
CPU: AMD Ryzen 7

Hello! I've been trying to create a particle simulation with computer shaders. After running my simulation for a while (ca. 5 minutes) my whole system freezes and becomes unresponsive. I cannot even switch to TTY. The code in question is here: https://gist.github.com/somecho/0ce97a911dad2e6141daa0003730ea08.

Here are a few things that I am doing that I suspect causes this:

  1. Copying the a [f32; 1000] buffer to another buffer every update count
  2. Creating a particle system with a number of particles that is greater than the default invocation size limit (256)

Does anyone knows why this might be happening?

somecho commented 5 months ago

Ah turns out it is a noob mistake on how I understood what dispatch_workgroups, @workgroup_size and global_invocation_id means.