taichi-aot-demo icon indicating copy to clipboard operation
taichi-aot-demo copied to clipboard

wsl2: LLVM error: Assertion `findOption(Name) == Values.size() && "Option already exists!"' failed.

Open Scyrc opened this issue 3 years ago • 3 comments

Goal

  • I follow the demo(https://github.com/taichi-dev/taichi-aot-demo/tree/master/mpm88_desktop ), in order to export taichi to cuda.

step1. Compile Taichi source has done

step2. Compile demo with [sh linux_compile_and_run.sh ] but failed,the output is :

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sc/workplace/tmp/for_linux1/build
[ 50%] Building CXX object CMakeFiles/mpm88.dir/mpm88.cpp.o
In file included from /home/sc/workplace/taichi/taichi/taichi/runtime/gfx/aot_module_loader_impl.h:8,
                 from /home/sc/workplace/taichi/taichi/c_api/src/taichi_core_impl.h:7,
                 from /home/sc/workplace/tmp/for_linux1/mpm88.cpp:9:
/home/sc/workplace/taichi/taichi/taichi/runtime/gfx/runtime.h:67:28: warning: ‘maybe_unused’ attribute ignored [-Wattributes]
   67 |   [[maybe_unused]] Device *device_;
      |                            ^~~~~~~
[100%] Linking CXX executable mpm88
[100%] Built target mpm88
[Taichi] version 1.1.4, llvm 10.0.0, commit bf201011, linux, python 3.8.10
[Taichi] Starting on arch=cuda
./tmp/aot_files
TI_LIB_DIR=/home/sc/workplace/taichi/taichi/python/taichi/_lib/runtime ./build/mpm88 ./tmp/aot_files cuda
mpm88: /home/leon/repos/llvm-10.0.0.src/include/llvm/Support/CommandLine.h:853: void llvm::cl::parser<DataType>::addLiteralOption(llvm::StringRef, const DT&, llvm::StringRef) [with DT = llvm::ScheduleDAGInstrs* (*)(llvm::MachineSchedContext*); DataType = llvm::ScheduleDAGInstrs* (*)(llvm::MachineSchedContext*)]: Assertion `findOption(Name) == Values.size() && "Option already exists!"' failed.
Aborted

Environment

  • OS: WSL2 Ubuntu-20.04 on win11
  • Taichi: version 1.1.4
  • python: 3.8.10
  • llvm 10.0.0 download from the doc( https://docs.taichi-lang.cn/docs/dev_install)

Scyrc avatar Nov 06 '22 15:11 Scyrc

Seems a linking issue, could you compile taichi_c_api with TI_WITH_LLVM=OFF if you don't need CUDA support?

PENGUINLIONG avatar Nov 06 '22 16:11 PENGUINLIONG

Seems a linking issue, could you compile taichi_c_api with TI_WITH_LLVM=OFF if you don't need CUDA support?

I compile taichi with args:

eport CXX=/usr/bin/clang++-10
export TAICHI_CMAKE_ARGS="-DTI_BUILD_TESTS=ON -DTI_WITH_VULKAN=ON"
export TAICHI_CMAKE_ARGS="-DTI_WITH_CUDA=ON ${TAICHI_CMAKE_ARGS}"
export TAICHI_CMAKE_ARGS="-DTI_WITH_C_API=ON ${TAICHI_CMAKE_ARGS}"
export TAICHI_CMAKE_ARGS="-DTI_WITH_LLVM=OFF ${TAICHI_CMAKE_ARGS}"
python3 setup.py develop --user

the compile is done , taichi 1.3.0 is install

Scyrc avatar Nov 08 '22 08:11 Scyrc

Seems a linking issue, could you compile taichi_c_api with TI_WITH_LLVM=OFF if you don't need CUDA support?

I compile taichi with args:

eport CXX=/usr/bin/clang++-10
export TAICHI_CMAKE_ARGS="-DTI_BUILD_TESTS=ON -DTI_WITH_VULKAN=ON"
export TAICHI_CMAKE_ARGS="-DTI_WITH_CUDA=ON ${TAICHI_CMAKE_ARGS}"
export TAICHI_CMAKE_ARGS="-DTI_WITH_C_API=ON ${TAICHI_CMAKE_ARGS}"
export TAICHI_CMAKE_ARGS="-DTI_WITH_LLVM=OFF ${TAICHI_CMAKE_ARGS}"
python3 setup.py develop --user

the compile is done , taichi 1.3.0 is install

But I need to export taichi to cuda. when compile the demo, the output is

-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sc/workplace/tmp/for_linux1/build
[ 50%] Building CXX object CMakeFiles/mpm88.dir/mpm88.cpp.o
[100%] Linking CXX executable mpm88
[100%] Built target mpm88
[Taichi] version 1.3.0, llvm targets unsupported, commit 7a5dac06, linux, python 3.8.10
[W 11/08/22 16:27:46.673 30663] [misc.py:adaptive_arch_select@755] Arch=[<Arch.cuda: 5>] is not supported, falling back to CPU
[Taichi] Starting on arch=x64
[E 11/08/22 16:27:46.673 30663] [program.cpp:Program@100] This taichi is not compiled with LLVM


Traceback (most recent call last):
  File "mpm88.py", line 31, in <module>
    ti.init(arch=arch)
  File "/home/sc/workplace/taichi_2/taichi/python/taichi/lang/misc.py", line 457, in init
    impl.get_runtime().create_program()
  File "/home/sc/workplace/taichi_2/taichi/python/taichi/lang/impl.py", line 376, in create_program
    self.prog = _ti_core.Program()
RuntimeError: [program.cpp:Program@100] This taichi is not compiled with LLVM
TI_LIB_DIR=/home/sc/workplace/taichi_2/taichi/python/taichi/_lib/runtime ./build/mpm88 ./tmp/aot_files cuda
Authorization required, but no authorization protocol specified
Failed to create GLFW window

Scyrc avatar Nov 08 '22 08:11 Scyrc