Run without GUI? (Installation problem)

Hello! :wave: I’m happy running Taichi on my Mac’s CPU (works great! thank you!). I’d like to move to cuda, using the cluster of my institute, but right now it’s not working.

  • I installed taichi-nightly-cuda-10-1
  • cuda 10.1 is present:
$ nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
  • gcc 8.3.1 is present:
$ gcc --version
gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
  • python is 3.6.8
$ python --version
Python 3.6.8
  • centos 7
$ cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)

In the cluster, however, I can’t have a display, all has to be headless. So I commented out everything including ‘GUI’ in demo_2d.py, which now looks like this:

import taichi as ti
import numpy as np
from mpm_solver import MPMSolver
write_to_disk = True
ti.init(arch=ti.cuda) # Try to run on GPU
mpm = MPMSolver(res=(128, 128))
for i in range(3):
  mpm.add_cube(lower_corner=[0.2 + i * 0.1, 0.3 + i * 0.1], cube_size=[0.1, 0.1], material=MPMSolver.material_elastic)
for frame in range(500):
  mpm.step(8e-3)
  if 10 < frame < 100 and frame % 2 == 0:
    mpm.add_cube(lower_corner=[0.4, 0.7], cube_size=[0.2, 0.01], material=MPMSolver.material_water)
  if 120 < frame < 300 and frame % 40 == 0:
    mpm.add_cube(lower_corner=[0.4 + frame * 0.001, 0.6 + frame // 40 * 0.02], cube_size=[0.2, 0.1], material=MPMSolver.material_snow)
  np_x, np_v, np_material = mpm.particle_info()

It fails with the following error:

python demo_2d.py
[Taichi] mode=release
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Share object taichi_core import failed. If you are on Windows, please consider installing "Microsoft Visual C++ Redistributable" (https://aka.ms/vs/16/release/vc_redist.x64.exe)
Traceback (most recent call last):
  File "demo_2d.py", line 1, in <module>
    import taichi as ti
  File "/master/home/rto/taichi/taichi_env/lib64/python3.6/site-packages/taichi/__init__.py", line 1, in <module>
    from taichi.main import main
  File "/master/home/rto/taichi/taichi_env/lib64/python3.6/site-packages/taichi/main.py", line 6, in <module>
    from taichi.tools.video import make_video, interpolate_frames, mp4_to_gif, scale_video, crop_video, accelerate_video
  File "/master/home/rto/taichi/taichi_env/lib64/python3.6/site-packages/taichi/tools/video.py", line 3, in <module>
    import taichi.core as core
  File "/master/home/rto/taichi/taichi_env/lib64/python3.6/site-packages/taichi/core/__init__.py", line 1, in <module>
    from .util import tc_core, build, format, load_module, start_memory_monitoring, \
  File "/master/home/rto/taichi/taichi_env/lib64/python3.6/site-packages/taichi/core/util.py", line 176, in <module>
    import_tc_core()
  File "/master/home/rto/taichi/taichi_env/lib64/python3.6/site-packages/taichi/core/util.py", line 35, in import_tc_core
    raise e
  File "/master/home/rto/taichi/taichi_env/lib64/python3.6/site-packages/taichi/core/util.py", line 31, in import_tc_core
    import taichi_core as core
ImportError: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.11' not found (required by /master/home/rto/taichi/taichi_env/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so)

Any ideas? :pray:
Thank you in advance!

Actually… just running import taichi as ti fails…

python -i
Python 3.6.8 (default, Aug  7 2019, 17:28:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import taichi as ti

I also

LD_LIBRARY_PATH=/usr/local/lib64/:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

just in case…

We’re finally running taichi using a singularity image and it works all fine : )

Thanks for trying that :slight_smile:

In case you still need to run taichi on your original environment, a user pointed out Package recently broken on ubuntu 16.04 ? · Issue #819 · tensorflow/serving · GitHub could be a solution.