New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meshes affecting simulation performance #1279
Comments
Thanks, this is valuable! On its face meshes that do not collide should not be adding anything to runtime, your expectation is very valid. We will investigate, though probably only in the new year. |
Hi @jdao913, We've diagnosed this and the core issue is a little tricky to solve (related to Bounding Volume Hierarchies of visual meshes, which are used by raycasting). However we have a workaround that should work well and is generally a good thing to know about. In the recently submitted 1e2e0b3, @quagla improved the compiler's discardvisual flag. Setting this flag will automatically discard all visual-only elements from the Closing this issue for now, but feel free to comment if the above doesn't work for you. |
The fix in fea7c10 is what you want. Added a flag to disable the visualization of active bounding volumes. |
Hi Pierre,
(Somehow your comment is not on the GitHub issue?)
I can't seem to reproduce what you are reporting, and we also have an
explicit test for this.
If you still experience this problem, please open a new issue. If there's a
bug we want to fix it!
cc +Alessio Quaglino ***@***.***>
Dr. Yuval Tassa | Senior Research Scientist | Google DeepMind |
***@***.***
…On Fri, 19 Jan 2024 at 23:18, Pierre Schumacher ***@***.***> wrote:
Hi,
we've just tried out the discardvisual flag with tendon and muscle-driven
models, and we found it removes wrapping geoms, even do they are not purely
visual. The models cannot load if we set the flag to true.
—
Reply to this email directly, view it on GitHub
<#1279 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQXORXBTHHGHN7UDEJQMXDYPKMGDAVCNFSM6AAAAABAUCGNAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBQG4YDQNJVHE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Hi Yuval, Thank you for checking up on this. |
👍
Dr. Yuval Tassa | Senior Research Scientist | Google DeepMind |
***@***.***
…On Fri, 9 Feb 2024 at 11:29, Pierre Schumacher ***@***.***> wrote:
Hi Yuval,
it seems I was not using the newest version of MuJoCo when I tested it. It
as intended with our models and mujoco==3.1.2.
Thank you for checking up on this.
—
Reply to this email directly, view it on GitHub
<#1279 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQXORWMS25QJQ4SW4KRAMLYSWQY7AVCNFSM6AAAAABAUCGNAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVGMYTONRTGY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Hello!
Our group has been using Mujoco for a while now our research and I recently noticed some strange performance differences when having meshes vs. not having them. We recently updated to Mujoco version 3.0.1 from 2.3.5 and noticed that our models were running a lot slower, and it seems to be caused by meshes, even though we have no mesh collisions. I found that just removing all meshes sped up performance a lot, by about 60%. Using the example
testspeed
profiling script I can see that this difference comes mainly from collisions; kinematics, constraints, etc. all take about the same amount of time with and without meshes.After some version traceback it seems like something changed between versions 2.3.5 and 2.3.6. The same model will run slower in 2.3.6 than in 2.3.5, and in order to get a similar level of performance back, I have to delete all meshes.
As a minimal example, I used the Mujoco Menagerie Cassie model. For the no mesh version I just deleted all the mesh geoms and all of the meshes in asset. On my machine (AMD 5900X) testing on a single core I get the following results.
Mujoco 2.3.5, original model (with meshes)
Mujoco 2.3.5, model without meshes
Mujoco 2.3.6, original model (with meshes)
Mujoco 2.3.6, model without meshes
As can be seen the same model runs faster in version 2.3.5 than in 2.3.6, and in version 2.3.5 we get similar performance between having meshes and not having them. When removing the meshes we get 2.3.6 to perform as fast as 2.3.5, and the cause for the slow down is from the
pos_collision
taking double the amount of time in the mesh case.As an extra check, here are the same tests run in current 3.0.1 version. It runs faster than in 2.3.5/2.3.6, but the difference between mesh vs. no mesh is still present. (Note that collision time is still twice as long in the mesh case vs. no mesh).
Mujoco 3.0.1, original model (with meshes)
Mujoco 3.0.1, model without meshes
The only note in the changelog of 2.3.6 that I saw about meshes is a mesh bounding box and coordinate frame fix, but that doesn't seem relevant to this? Regardless, why is removing meshes affecting collision computation time even when there are no mesh collisions? I might just be stupid and missing something about how meshes work and how collision detection happens, but I don't understand what is happening here.
Thanks for any help and insight you can provide!
The text was updated successfully, but these errors were encountered: