Hi. I’ve faced LLVM error in tests after enabling llvm on my machine. Error goes from very early stage of loading libtvm.so library, the exact place is ctype.CDLL call located in python/tvm/_ffi/base.py, executed from any import tvm statement.
The error says
: CommandLine Error: Option 'disable-symbolication' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
After some googling I’ve found the https://github.com/CastXML/CastXML/issues/102#issuecomment-372488956
discussion suggesting to replace ${LLVM_LIBS} with LLVM in cmake rules. It seems to work in my case. Could anyone who is more familiar with llvm please explain the problem and possibly review the solution?
Note: I’m using latest tvm (cmake-based build system) and llvm-5.0
Thank you for the reply. I’ve re-checked the issue and it seems that the problem is actual at least for my particular Linux distribution. Below is a patch witch seems to fix it. Thanks.
diff --git a/cmake/modules/LLVM.cmake b/cmake/modules/LLVM.cmake
index 3e896a60..1246efe2 100644
--- a/cmake/modules/LLVM.cmake
+++ b/cmake/modules/LLVM.cmake
@@ -10,7 +10,7 @@ if(NOT USE_LLVM STREQUAL "OFF")
# Set flags that are only needed for LLVM target
add_definitions(-DTVM_LLVM_VERSION=${TVM_LLVM_VERSION})
file(GLOB COMPILER_LLVM_SRCS src/codegen/llvm/*.cc)
- list(APPEND TVM_LINKER_LIBS ${LLVM_LIBS})
+ list(APPEND TVM_LINKER_LIBS LLVM)
list(APPEND COMPILER_SRCS ${COMPILER_LLVM_SRCS})
if(NOT MSVC)
set_source_files_properties(${COMPILER_LLVM_SRCS}
Strange, that should be fixed long time ago. But I didn’t try opencl. Actually, for me it was for any application, at the time of import tvm.
If I remember correctly, this problem appeared only if I put USE_LLVM ON. If I put full path to llvm config, the problem didn’t come. You could try this.
It’s not about TVM actually it’s about LLVM used in a NEO OpenCL driver which is required for GEN9+ and alternative, but recommended for other generation of the Intel graphics. I created MR to IGC, you can try this fix in the meanwhile… Current approach doesn’t work for any project that loads some LLVM before NEO’s one
@apivovarov, either/or is not interesting because it’s common concept to employ both CPU and GPU running Intel to utilize all available resources of the system.