Giter Club home page Giter Club logo

damianliumin / softmac Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 2.0 65.7 MB

Code repository for our paper SoftMAC: Differentiable Soft Body Simulation with Forecast-based Contact Model and Two-way Coupling with Articulated Rigid Bodies and Clothes

Home Page: https://sites.google.com/view/softmac

Python 100.00%
differentiable-physics-engine differentiable-programming differentiable-simulations optimal-control robot-learning robotics simulation soft-body-simulation trajectory-optimization

softmac's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

crtie megumi-x

softmac's Issues

CUDA_ERROR_OUT_OF_MEMORY / CUDA_ERROR_ASSERT when running demos

Hi, I'm trying to run your demos, but I'm getting CUDA errors. I'm using a machine with RTX 3080 with 10GB of VRAM.

When I run the code without any changes, I'm getting CUDA_ERROR_OUT_OF_MEMORY:

(softmac) ➜  softmac git:(main) python3 demo_grip.py
[Taichi] version 1.4.1, llvm 15.0.4, commit e67c674e, linux, python 3.8.19
[Taichi] Starting on arch=cuda
[E 06/12/24 14:29:13.462 234973] [cuda_driver.h:operator()@88] CUDA Error CUDA_ERROR_OUT_OF_MEMORY: out of memory while calling malloc (cuMemAlloc_v2)


Traceback (most recent call last):
  File "demo_grip.py", line 11, in <module>
    from softmac.engine.taichi_env import TaichiEnv
  File "/home/mateusz/Programming/SoftMAC/softmac/engine/taichi_env.py", line 13, in <module>
    ti.init(arch=ti.gpu, debug=False, fast_math=True, device_memory_GB=9)
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/lang/misc.py", line 473, in init
    impl.get_runtime().prog.materialize_runtime()
RuntimeError: [cuda_driver.h:operator()@88] CUDA Error CUDA_ERROR_OUT_OF_MEMORY: out of memory while calling malloc (cuMemAlloc_v2)

I tried lowering the device_memory parameter in ti.init, but then I get the following error:

(softmac) ➜  softmac git:(main) ✗ python3 demo_grip.py
[Taichi] version 1.4.1, llvm 15.0.4, commit e67c674e, linux, python 3.8.19
[Taichi] Starting on arch=cuda
Building primitive
enable_external_force: True
friction: 0.001
urdf_path: assets/gripper/gripper.urdf
Mesh: assets/gripper/palm.obj
Loading cached sdf...
Building primitive
enable_external_force: True
friction: 0.001
urdf_path: assets/gripper/gripper.urdf
Mesh: assets/gripper/finger.obj
Loading cached sdf...
Building primitive
enable_external_force: True
friction: 0.001
urdf_path: assets/gripper/gripper.urdf
Mesh: assets/gripper/finger.obj
Loading cached sdf...
{'offset': (0.0, 0.0, 0.0), 'path': PosixPath('envs/grip/grip_mpm_init_state.npy'), 'color': 7939085}
Taichi JIT:0: allocate_from_buffer: block: [0,0,0], thread: [0,0,0] Assertion `Out of CUDA pre-allocated memory.
Consider using ti.init(device_memory_fraction=0.9) or ti.init(device_memory_GB=4) to allocate more GPU memory` failed.
[E 06/12/24 14:30:44.219 238194] [cuda_driver.h:operator()@88] CUDA Error CUDA_ERROR_ASSERT: device-side assert triggered while calling stream_synchronize (cuStreamSynchronize)


Traceback (most recent call last):
  File "demo_grip.py", line 193, in <module>
    main(args)
  File "demo_grip.py", line 116, in main
    env = TaichiEnv(cfg)
  File "/home/mateusz/Programming/SoftMAC/softmac/engine/taichi_env.py", line 59, in __init__
    self.initialize()
  File "/home/mateusz/Programming/SoftMAC/softmac/engine/taichi_env.py", line 66, in initialize
    self.primitives.initialize()
  File "/home/mateusz/Programming/SoftMAC/softmac/engine/primitive/primitives.py", line 56, in initialize
    self.set_softness(666.)
  File "/home/mateusz/Programming/SoftMAC/softmac/engine/primitive/primitives.py", line 45, in set_softness
    i.softness[None] = softness
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/lang/util.py", line 310, in wrapped
    return func(*args, **kwargs)
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/lang/field.py", line 361, in __setitem__
    self._initialize_host_accessors()
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/lang/field.py", line 256, in _initialize_host_accessors
    taichi.lang.impl.get_runtime().materialize()
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/lang/impl.py", line 408, in materialize
    self.materialize_root_fb(not self.materialized)
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/lang/impl.py", line 340, in materialize_root_fb
    root.finalize(raise_warning=not is_first_call)
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/_snode/fields_builder.py", line 150, in finalize
    return self._finalize(raise_warning, compile_only=False)
  File "/home/mateusz/anaconda3/envs/softmac/lib/python3.8/site-packages/taichi/_snode/fields_builder.py", line 162, in _finalize
    _ti_core.finalize_snode_tree(_snode_registry, self.ptr,
RuntimeError: [cuda_driver.h:operator()@88] CUDA Error CUDA_ERROR_ASSERT: device-side assert triggered while calling stream_synchronize (cuStreamSynchronize)
[E 06/12/24 14:30:44.446 238194] [cuda_driver.h:operator()@88] CUDA Error CUDA_ERROR_ASSERT: device-side assert triggered while calling stream_synchronize (cuStreamSynchronize)


[1]    238194 IOT instruction (core dumped)  python3 demo_grip.py

Could you maybe help me figure out how to solve this?

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.