Giter VIP home page Giter VIP logo

Comments (10)

yuvaltassa avatar yuvaltassa commented on June 7, 2024

Did you try this?
https://mujoco.readthedocs.io/en/latest/XMLreference.html#size-memory
https://mujoco.readthedocs.io/en/latest/modeling.html#csize

from mujoco.

kurtenkera avatar kurtenkera commented on June 7, 2024

@yuvaltassa The mesh file that I'm currently trying to load is attached here (
MSH41_exceed_memory.zip). I tried the advice that you recommended in those above links. As you can see in the code below, I include the line <size memory = "8G"/> in my XML file which I thought would be a reasonable amount of allocated memory:

import mujoco
import mediapy as media

xml = r"""
<mujoco model="3DMBB">
  <size memory = "8G"/>
  <worldbody>
    <flexcomp name="3DMBB" type="gmsh" dim="3" file="converted_3d_mbb_ascii.stl_out_vol.msh">
    <edge equality="true"/>
    </flexcomp>
  </worldbody>
</mujoco>
"""

# Make model and data
model = mujoco.MjModel.from_xml_string(xml)
data = mujoco.MjData(model)

# Make renderer, render and show the pixels
renderer = mujoco.Renderer(model)
mujoco.mj_forward(model, data)
renderer.update_scene(data)

media.show_image(renderer.render())

However, I get this error message below:

ValueError: Error: engine error: mj_stackAlloc: insufficient memory: max = 8573357512, available = 107779936, requested = 8461964232 (ne = 57810, nf = 0, nefc = 57810, ncon = 0)

How do I load in .msh files with a large amount of nodes and elements (~10k nodes, ~40k elements) like this one? Do I need to try run the model on a different machine with more RAM (my machine has 64GB of memory)? Even when I try to load the model with the following setting <size memory = "20G"/> to increase the memory allocation I get the following output:

ValueError: XML Error: unsigned integer with an optional suffix {K,M,G,T,P,E} is expected in attribute 'memory' (or the size specified is too big)
Element 'size', line 3

This indicates that I can't allocate 20GB of memory even though I should be able to on my machine?

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 7, 2024

Ah the latter seems like an actual bug in the parser, we should be using long instead of int somewhere...

from mujoco.

kurtenkera avatar kurtenkera commented on June 7, 2024

@yuvaltassa Thanks for the clarification - what about the first/former issue? Why do I get the error below when it clearly says I have both a max and available amount of memory greater than what was requested?

ValueError: Error: engine error: mj_stackAlloc: insufficient memory: max = 8573357512, available = 107779936, requested = 8461964232 (ne = 57810, nf = 0, nefc = 57810, ncon = 0)

Will I have to wait for the bug that you identified to be fixed before I can model this 3D mesh file in MuJoCo?

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 7, 2024

Why do I get the error below when it clearly says I have both a max and available amount of memory greater than what was requested?

Count more carefully, available is smaller by an order of magnitude...

from mujoco.

kurtenkera avatar kurtenkera commented on June 7, 2024

So when I requested 8GB of memory in the above example, I actually only had 100MB available? Why is this the case? When I print out the available memory on my machine in the terminal, it says I currently have 39GB of memory available (see below):

image

Surely 39GB of available memory should be more than enough to simulate the mesh file with ~10k nodes, ~40k elements, no?

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 7, 2024

Like I said, I think we have some bug related to using an int somewhere where we shouldn't. INT_MAX is 2147483647 which is just 2.14GB ...

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 7, 2024

The main bug is now fixed at head. Build from source or wait for next release.

from mujoco.

kurtenkera avatar kurtenkera commented on June 7, 2024

When will the next release be?

from mujoco.

yuvaltassa avatar yuvaltassa commented on June 7, 2024

May 6th

from mujoco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.