taichi-dev / taichi-aot-demo

A demo illustrating how to use Taichi as an AOT shader compiler
Apache License 2.0
71 stars 16 forks source link

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

Open Scyrc opened 1 year ago

Scyrc commented 1 year ago

Goal

PENGUINLIONG commented 1 year ago

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

Scyrc commented 1 year ago

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 commented 1 year ago

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