Flex error: in cudaEventSynchronize(lib->mMemoryFence)

Hi, I am loading 3 soft bodies in the simulation using create_tet_grid() function with the following argument

gym.create_tet_grid(sim, soft_material, 
                                2, 2, 2, 
                                0.1, 0.1, 0.1, 
                                100, 
                                False, False, False, False)

and an ANYmal robot urdf… but as soon as the robot makes contact with the soft bodies at high velocities (when dropped from a height, currently 2.0m) I get the below error

[Error] [carb.gym.plugin] Flex error: Cuda error: 77 in cudaEventSynchronize(lib->mMemoryFence) (in ../../../src/cuda/flex.cu:6686)

System Specs: i7 10th gen +1650Ti

Is this supposed to happen? I am not getting this error with the demo of the soft body or in situations when the robot is stationaries… Is the solver not able to track the contacts due to high-velocity motion, if yes do you guys know any fix to it?

Also I doubt its due to memory limitations because when running the nvidia-smi, I observed that only around 1300MiB/3911MiB is occupied. if it due to some default threshold of memory in Isaac gym, is there an API to allot memory?

Thanks

Update: If I turn off the self collide option, I don’t get this error, any reason why?

Hi @cosmosaditya02,

Did you switch off self-collisions for Anymal robot? In general, to improve stability with high-speed collisions larger number of substeps can be tried. Also, can you share all other solver parameters you used?

Yes, after switching off self-collisions I did not get that error.

sim_params.flex.solver_type = 5
sim_params.flex.num_outer_iterations = 4
sim_params.flex.num_inner_iterations = 15
sim_params.flex.relaxation = 0.75
sim_params.flex.warm_start = 0.4
sim_params.flex.deterministic_mode = 1

sim_params.dt = 1.0 / 60.0
sim_params.substeps = 5

For now the simulation seems stable…