Received signal 11 (Segmentation Fault)

I run Ubuntu 18.04 and Python3 within my Virtual Box machine (VBox works for GAMES-101 and pytorch).
I installed taichi from source: Simple Index.
pip3 reports that taichi has been installed successfully, but import taichi returns the following errors:

[E 06/01/20 22:32:27.711] Received signal 11 (Segmentation fault)


e[38;2;255;000;255m***********************************
e[0me[38;2;255;000;255m* Taichi Compiler Stack Traceback *
e[0me[38;2;255;000;255m***********************************
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::Logger::error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::signal_handler(int)
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f8dbbd28f20]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1: llvm::StringMapImpl::LookupBucketFor(llvm::StringRef)
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(+0x98ec5f) [0x7f8d97605c5f]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(+0x98ee0c) [0x7f8d97605e0c]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(+0x984fc5) [0x7f8d975fbfc5]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(+0x990e9d) [0x7f8d97607e9d]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1: llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1: llvm::cl::OptionCategory::registerCategory()
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1(+0x8a1fa2) [0x7f8d97518fa2]
e[0me[38;2;255;000;255m/lib64/ld-linux-x86-64.so.2(+0x10733) [0x7f8dbc0eb733]
e[0me[38;2;255;000;255m/lib64/ld-linux-x86-64.so.2(+0x151ff) [0x7f8dbc0f01ff]
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libc.so.6: _dl_catch_exception
e[0me[38;2;255;000;255m/lib64/ld-linux-x86-64.so.2(+0x147ca) [0x7f8dbc0ef7ca]
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libdl.so.2(+0xf96) [0x7f8dbb8c7f96]
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libc.so.6: _dl_catch_exception
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libc.so.6: _dl_catch_error
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libdl.so.2(+0x1735) [0x7f8dbb8c8735]
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libdl.so.2: dlopen
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0(+0x55f51) [0x7f8d9d90ff51]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0(+0x43120) [0x7f8d9d8fd120]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0(+0x44e5b) [0x7f8d9d8fee5b]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0(+0x37f68) [0x7f8d9d8f1f68]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0(+0x335d4) [0x7f8d9d8ed5d4]
e[0me[38;2;255;000;255m/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0(+0x33b0d) [0x7f8d9d8edb0d]
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: _glfwInitGLX
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: _glfwPlatformCreateWindow
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: glfwCreateWindow
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::initialize_opengl(bool)
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::opengl::is_opengl_api_available()
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so(+0x763e47) [0x7f8d9fa54e47]
e[0me[38;2;255;000;255m/home/xuyinda/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so(+0x655bef) [0x7f8d9f946bef]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a635]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x5161e9]
e[0me[38;2;255;000;255m/usr/bin/python3: PyCFunction_Call
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509a90]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: _PyFunction_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_CallMethodIdObjArgs
e[0me[38;2;255;000;255m/usr/bin/python3: PyImport_ImportModuleLevelObject
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x5161e9]
e[0me[38;2;255;000;255m/usr/bin/python3: PyCFunction_Call
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509a90]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: _PyFunction_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_CallMethodIdObjArgs
e[0me[38;2;255;000;255m/usr/bin/python3: PyImport_ImportModuleLevelObject
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x5161e9]
e[0me[38;2;255;000;255m/usr/bin/python3: PyCFunction_Call
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509a90]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: _PyFunction_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_CallMethodIdObjArgs
e[0me[38;2;255;000;255m/usr/bin/python3: PyImport_ImportModuleLevelObject
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x5141c4]
e[0me[38;2;255;000;255m/usr/bin/python3: PyCFunction_Call
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509a90]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x509758]
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x50a48d]
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: _PyFunction_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_FastCallDict
e[0me[38;2;255;000;255m/usr/bin/python3: _PyObject_CallMethodIdObjArgs
e[0me[38;2;255;000;255m/usr/bin/python3: PyImport_ImportModuleLevelObject
e[0me[38;2;255;000;255m/usr/bin/python3: _PyEval_EvalFrameDefault
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x507d64]
e[0me[38;2;255;000;255m/usr/bin/python3: PyEval_EvalCode
e[0me[38;2;255;000;255m/usr/bin/python3: ) [0x634c82]
e[0me[38;2;255;000;255m/usr/bin/python3: PyRun_FileExFlags
e[0me[38;2;255;000;255m/usr/bin/python3: PyRun_SimpleFileExFlags
e[0me[38;2;255;000;255m/usr/bin/python3: Py_Main
e[0me[38;2;255;000;255m/usr/bin/python3: main
e[0me[38;2;255;000;255m/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
e[0me[38;2;255;000;255m/usr/bin/python3: _start
e[0m

from doc:

If Taichi crashes with a stack backtrace containing a line of glfwCreateWindow (see #958):

This is likely because you are running Taichi on a (virtual) machine with an old OpenGL API. Taichi requires OpenGL 4.3+ to work.

  • Possible solution : add export TI_ENABLE_OPENGL=0 to your ~/.bashrc even if you initialize Taichi with other backends than OpenGL. This disables the OpenGL backend detection to avoid incompatibilities.
1 个赞

It works for me. Thank you a lot!