Open zhouxian opened 1 year ago
It's not recommended to add a sync every substep. You can sync every 50 substeps or something similar. Because GPU is async to CPU, the Vulkan backend is batching commands (however we do have some issues with batching too many...). For the simulation speed drop, are you comapring Vulkan with ti.sync() to CUDA with or without?
@bobcao3 Thanks for replying! Yes that's what i observed. after some crazy batching it crashes.
I was comparing ti.vulkan with ti.cuda. For ti.cuda, with or without ti.sync does not have any effect on the simulation speed. So in the 3D mpm case, ti.vulkan runs ~3x faster. But when i switch to another 2D example, ti.cuda is faster than vulkan. I was wondering, is there any best practice or guideline in choosing a proper backend?
Hmmm that's interesting. It shouldn't have so much of a difference
Hi, I am playing around with this mpm example (https://github.com/taichi-dev/taichi/blob/master/python/taichi/examples/ggui_examples/mpm3d_ggui.py) , and i noticed that, if i disable all code related to the ggui visualization, i have to manual add
ti.sync()
after eachsubstep()
, otherwise the simulation will run superfast (which is probably not really doing anything) and then crash.If i switch backend from vulkan to cuda, it works fine. But the simulation speed dropx 3x.
Is this expected?