zhouxian / FluidLab

[ICLR 2023] FluidLab: A Differentiable Environment for Benchmarking Complex Fluid Manipulation
148 stars 14 forks source link

Let's Rock Example Error #5

Closed ssungho98 closed 1 year ago

ssungho98 commented 1 year ago

Hello! I followed all the installation instructions(except GLRenderer) and faced the following error message while trying Let's Rock first step.

File "fluidlab/run.py", line 10, in <module>
    from fluidlab.optimizer.solver import solve_policy
  File "/home/sungho/FluidLab/fluidlab/optimizer/__init__.py", line 1, in <module>
    from .solver import Solver
  File "/home/sungho/FluidLab/fluidlab/optimizer/solver.py", line 7, in <module>
    from fluidlab.fluidengine.taichi_env import TaichiEnv
  File "/home/sungho/FluidLab/fluidlab/fluidengine/taichi_env.py", line 7, in <module>
    from fluidlab.fluidengine.renderers import *
  File "/home/sungho/FluidLab/fluidlab/fluidengine/renderers/__init__.py", line 4, in <module>
    from .gl_renderer import GLRenderer
  File "/home/sungho/FluidLab/fluidlab/fluidengine/renderers/gl_renderer.py", line 10, in <module>
    from .gl_renderer_src import flex_renderer
ImportError: cannot import name 'flex_renderer' from 'fluidlab.fluidengine.renderers.gl_renderer_src' (unknown location)

Could you take a look into this?``

zhouxian commented 1 year ago

The error message indicates it failed to import GLRenderer, probably because you didn't compile it.

Try commenting out that line in renderers/__init__.py if you only need GGUIRenderer.

ssungho98 commented 1 year ago

Hi! Thank you for your reply.

I commented out the gl_renderer part and it did work. However, I got another error message as follows:

[Taichi] version 1.1.0, llvm 10.0.0, commit f5bb6464, linux, python 3.7.13
[Taichi] Starting on arch=cuda
[E 08/04/23 12:00:40.443 7683] [llvm_runtime_executor.cpp:materialize_runtime@510] Assertion failure: prealloc_size <= total_mem
Traceback (most recent call last):
  File "fluidlab/run.py", line 10, in <module>
    from fluidlab.optimizer.solver import solve_policy
  File "/home/sungho/FluidLab/fluidlab/optimizer/__init__.py", line 1, in <module>
    from .solver import Solver
  File "/home/sungho/FluidLab/fluidlab/optimizer/solver.py", line 7, in <module>
    from fluidlab.fluidengine.taichi_env import TaichiEnv
  File "/home/sungho/FluidLab/fluidlab/fluidengine/taichi_env.py", line 12, in <module>
    ti.init(arch=ti.gpu, device_memory_GB=8, packed=True)
  File "/home/sungho/anaconda3/envs/fluidlab/lib/python3.7/site-packages/taichi/lang/misc.py", line 456, in init
    impl.get_runtime().prog.materialize_runtime()
RuntimeError: [llvm_runtime_executor.cpp:materialize_runtime@510] Assertion failure: prealloc_size <= total_mem
[W 08/04/23 12:00:40.840 7683] [llvm_offline_cache.cpp:clean_cache@379] Lock /home/sungho/.cache/taichi/ticache/metadata.lock failed

Thank you always for your help.

zhouxian commented 1 year ago

the initialization code ti.init(arch=ti.gpu, device_memory_GB=8, packed=True) will try to allocate 8GB of your gpu memory. The error occurs when there's no sufficient memory available on you gpu. Try using a smaller number, like 4GB.

ssungho98 commented 1 year ago

Thank you! It worked at last!