Taichi: Invalid bitcode signature on Linux

Created on 3 Mar 2020  路  8Comments  路  Source: taichi-dev/taichi

Describe the bug
Any idea why am I getting this error when running sample code on GPU?

My GPU is RTX 2080 Super and OS is Ubuntu 18.04

Log/Screenshots

python3 simple_autodiff.py
[Taichi] mode=release
[Taichi] version 0.5.5, cuda 10.1, commit c826de52, python 3.6.9
[W 03/02/20 23:57:35.670] [llvm_context.cpp:module_from_bitcode_file@187] Bitcode loading error message:
Invalid bitcode signature
[E 03/02/20 23:57:35.670] [llvm_context.cpp:module_from_bitcode_file@189] Bitcode /home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/runtime_x64.bc load failure.
Program aborted due to an unhandled Error:
Invalid bitcode signature***********************************
* Taichi Compiler Stack Traceback *
***********************************
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::signal_handler(int)
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f2520b4ff20]
/lib/x86_64-linux-gnu/libc.so.6: gsignal
/lib/x86_64-linux-gnu/libc.so.6: abort
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: llvm::StringError::StringError(std::error_code, llvm::Twine const&)
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::module_from_bitcode_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, llvm::LLVMContext*)
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::TaichiLLVMContext::clone_runtime_module()
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::TaichiLLVMContext::get_init_module()
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::StructCompilerLLVM::StructCompilerLLVM(taichi::lang::Program*, taichi::lang::Arch)
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::StructCompiler::make(taichi::lang::Program*, taichi::lang::Arch)
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::Program::materialize_layout()
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so: taichi::lang::layout(std::function<void ()> const&)
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so(+0xd41d59) [0x7f25035e2d59]
/home/zhangyan/.local/lib/python3.6/site-packages/taichi/core/../lib/taichi_core.so(+0xb7449d) [0x7f250341549d]
python3() [0x50ac25]
python3(_PyEval_EvalFrameDefault+0x449) [0x50c5b9]
python3() [0x508245]
python3() [0x50a080]
python3() [0x50aa7d]
python3(_PyEval_EvalFrameDefault+0x449) [0x50c5b9]
python3(_PyFunction_FastCallDict+0xf5) [0x509455]
python3() [0x595311]
python3(PyObject_Call+0x3e) [0x5a067e]
python3() [0x557d28]
python3() [0x542020]
python3(_PyEval_EvalFrameDefault+0xed8) [0x50d048]
python3() [0x508245]
python3(PyEval_EvalCode+0x23) [0x50b403]
python3() [0x635222]
python3(PyRun_FileExFlags+0x97) [0x6352d7]
python3(PyRun_SimpleFileExFlags+0x17f) [0x638a8f]
python3(Py_Main+0x591) [0x639631]
python3(main+0xe0) [0x4b0f40]
/lib/x86_64-linux-gnu/libc.so.6: __libc_start_main
python3(_start+0x2a) [0x5b2fda]
[E 03/02/20 23:57:35.674] Received signal 6 (Aborted)
potential bug

Most helpful comment

@zhangryan @tbarton16 v0.5.6 on Linux is released. Could you have a try and let us know if the bug is gone? Thanks so much!

All 8 comments

This may be raise from the mismatch of version between clang and llvm.
How did you install taichi? Have you installed llvm or clang before? What's the version?
Taichi will search for clang and llvm-as in your $PATH variable:
https://github.com/taichi-dev/taichi/blob/9ebe657831408627a80e8e6afc541077e73e9d53/taichi/llvm/llvm_context.cpp#L124-L126
Another possibility is, the support for clang-9 is a recent added feature, and somehow it's not working properly now.
By the way, this may not be related to GPU, since runtime_x64.bc load failure instead of runtime_cuda.bc load failure.

BTW, #551 seems to have the same problem @tbarton16

BTW, #551 seems to have the same problem @tbarton16

Maybe both cause by the new version of Ubuntu.

Thanks for reporting. I'll take a look today.

Should be fixed in v0.5.6. The buildbots are currently working on compiling/releasing the new version.

@zhangryan @tbarton16 v0.5.6 on Linux is released. Could you have a try and let us know if the bug is gone? Thanks so much!

For me it is fixed

@yuanming-hu Sorry for the late response. It works for me too. Thank you Yuanming

Was this page helpful?
0 / 5 - 0 ratings

Related issues

archibate picture archibate  路  3Comments

archibate picture archibate  路  4Comments

liaopeiyuan picture liaopeiyuan  路  3Comments

yuanming-hu picture yuanming-hu  路  4Comments

quadpixels picture quadpixels  路  3Comments