Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Scyrc opened this issue Nov 6, 2022 · 3 comments

Comments

@Scyrc
Copy link

Scyrc commented Nov 6, 2022

Goal

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

@PENGUINLIONG
Copy link
Member

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

@Scyrc
Copy link
Author

Scyrc commented Nov 8, 2022

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
Copy link
Author

Scyrc commented Nov 8, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants