HadrienG2 / grayscott

Rust version of the "Performance with stencil" course's examples
10 stars 1 forks source link

Set a limit on Vulkan command buffer size #67

Open HadrienG2 opened 5 months ago

HadrienG2 commented 5 months ago

Right now, the Vulkan versions can submit arbitrarily large command buffers to the GPU, because it just packs all simulation steps to be processed into a single command buffer.

However, it has been observed that the NVidia Linux driver encounters performance issues when processing very large command buffers, and that the AMD Linux driver can encounter correctness issues in the same scenario. Furthermore, too big a command buffer could potentially result in a desktop freeze or a system GPU watchdog kill, depending on if GPU preemption is implemented between command buffers or individual dispatches. For all these reasons, it would be a good idea to limit the size of command buffers to a certain amount of commands, and emit multiple command buffers after this limit is reached.

This will require modifying the abstract simulation trait to use impl GpuFuture instead of a concrete type in a strategic location.

HadrienG2 commented 4 months ago

Implemented in https://gitlab.in2p3.fr/grasland/grayscott-with-rust .