taichi-dev / taichi_elements

High-performance multi-material continuum physics engine in Taichi
MIT License
483 stars 69 forks source link

Examples break with taichi 0.5.9 #13

Closed r03ert0 closed 4 years ago

r03ert0 commented 4 years ago

For example, python3 demo_3d.py fails like this:

[Taichi] mode=release
[Taichi] version 0.5.9, cpu only, commit fe51732c, python 3.7.5
[W 03/29/20 21:36:13.408] [program.cpp:Program@40] Taichi is not compiled with CUDA.
[W 03/29/20 21:36:13.408] [program.cpp:Program@63] Falling back to x64
Traceback (most recent call last):
  File "demo_3d.py", line 21, in <module>
    mpm.step(4e-3)
  File "/Users/roberto/Applications/taichi_elements/mpm_solver.py", line 158, in step
    self.p2g(dt)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/kernel.py", line 518, in __call__
    return self._primal(self._kernel_owner, *args, **kwargs)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/kernel.py", line 414, in __call__
    self.materialize(key=key, args=args, arg_features=arg_features)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/kernel.py", line 261, in materialize
    visitor.visit(tree)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 559, in visit_Module
    self.generic_visit(node)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 78, in generic_visit
    value = self.visit(value)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 640, in visit_FunctionDef
    self.generic_visit(node)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 78, in generic_visit
    value = self.visit(value)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 491, in visit_For
    return self.visit_struct_for(node, is_grouped=False)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 411, in visit_struct_for
    self.generic_visit(node, ['body'])
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 72, in generic_visit
    list_stmt[i] = self.visit(l)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/opt/miniconda3/envs/mypy3/lib/python3.7/site-packages/taichi/lang/transformer.py", line 469, in visit_For
    "Static grouped struct for loop is not allowed. Please use 'ti.static(ti.grouped(ti.ndrange(...)))' instead."
taichi.lang.transformer.TaichiSyntaxError: Static grouped struct for loop is not allowed. Please use 'ti.static(ti.grouped(ti.ndrange(...)))' instead.
yuanming-hu commented 4 years ago

Hi @r03ert0 Sorry about that and thank you so much for reporting. I'm fixing this and will release v0.5.10 tonight with this issue resolved.

Btw, I did see your post (https://forum.taichi.graphics/t/run-without-gui-installation-problem/77/3) yet I don't have a clear idea how to resolve it. I did google it, and your attempted solution (edit LD_LIBRARY_PATH) seems to be the suggested solution. Not sure why this doesn't work for your case...

r03ert0 commented 4 years ago

Thank you @yuanming-hu! It works all fine now. You and your team are really impressive 🚀 !!