Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mujoco_warp/_src/collision_convex.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@ def ccd_kernel(
epa_horizon = epa_horizon_in[tid]

collision_pairid = collision_pairid_in[tid]

# Fix OOM #926: Preallocate contacts before heightfield loop
max_contacts = ncollision_in[0] * MJ_MAXCONPAIR * 2
if data.contacts.size < max_contacts:
data.contacts.allocate(max_contacts * 1.5)

# process all prisms in subgrid
count = int(0)
Expand Down
4 changes: 4 additions & 0 deletions mujoco_warp/testspeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ def _main(argv: Sequence[str]):
Total realtime factor: {steps * m.opt.timestep.numpy()[0] / run_time:,.2f} x
Total time per step: {1e9 * run_time / steps:.2f} ns
Total converged worlds: {nsuccess} / {d.nworld}""")

print(f" Collision pairs: {d.ncollision[0]:,d}")
print(f" Contacts: {d.ncontact[0]:,d}")
print(f" Friction dim: {d.friction_dim:.1f}")

if trace:
_print_trace(trace, 0, steps)
Expand Down