You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "petersktang (via GitHub)" <gi...@apache.org> on 2026/06/06 03:10:54 UTC
[I] [Bug] undefined symbols in libtvm_compiler.so [tvm]
petersktang opened a new issue, #19678:
URL: https://github.com/apache/tvm/issues/19678
### Expected Behaviour: dlopen libtvm_compiler.so
loading succesful
### Actual Behaviour: dlopen libtvm_compiler.so failed with undefined symbols
libtvm_compiler.so is built with undefined symbols, failing ctypes.CDLL("libtvm_compiler.so")
```
ldd -r build/py3-none-linux_x86_64/lib/* | grep undefined
undefined symbol: LLVMInitializeM68kTargetInfo, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeXtensaTargetInfo, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeM68kTarget, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeXtensaTarget, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeM68kTargetMC, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeXtensaTargetMC, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeM68kAsmParser, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeXtensaAsmParser, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeM68kAsmPrinter, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
undefined symbol: LLVMInitializeXtensaAsmPrinter, version LLVM_22.1 (build/py3-none-linux_x86_64/lib/libtvm_compiler.so)
```
### Environment
- Ubuntu 24.04.1 [Linux 6.17.0-35-generic], ROCm 7.2.3
- AMD AI 9 HX 370 [890M]
- TVM [main branch]
```
(pyproject.toml)
[tool.scikit-build.cmake.define]
TVM_BUILD_PYTHON_MODULE = "ON"
USE_CUDA = "ON"
USE_ROCM = "ON"
USE_LLVM = "ON"
USE_CUBLAS = "ON"
USE_HIPBLAS = "ON"
USE_CUDNN = "ON"
CMAKE_C_COMPILER = "/opt/rocm/llvm/bin/clang"
CMAKE_CXX_COMPILER = "/opt/rocm/llvm/bin/clang++"
```
```
(build/config.cmake)
set(USE_CUDA $ENV{USE_CUDA})
set(USE_ROCM $ENV{USE_ROCM})
set(USE_CUBLAS $ENV{USE_CUBLAS})
set(USE_HIPBLAS $ENV{USE_HIPBLAS})
set(USE_CUDNN $ENV{USE_CUDNN})
set(BUILD_STATIC_RUNTIME $ENV{BUILD_STATIC_RUNTIME})
set(HIDE_PRIVATE_SYMBOLS $ENV{HIDE_PRIVATE_SYMBOLS})
set(USE_LLVM "llvm-config-22" CACHE STRING "Path to llvm-config or ON/OFF") # llvm-config-22
set(CUDA_TOOLKIT_ROOT_DIR $ENV{CONDA_PREFIX})
set(CMAKE_CXX_VISIBILITY_PRESET $ENV{CMAKE_CXX_VISIBILITY_PRESET})
set(CMAKE_VISIBILITY_INLINES_HIDDEN $ENV{CMAKE_VISIBILITY_INLINES_HIDDEN})
set(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE}) # Release, Debug, RelWithDebInfo, MinSizeRel
```
### Steps to reproduce
```
pip install -e .
python -c 'import ctypes;ctypes.CDLL("./build/py3-none-linux_x86_64/lib/libtvm_compiler.so")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
import ctypes;ctypes.CDLL("./build/py3-none-linux_x86_64/lib/libtvm_compiler.so")
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "CONDA tvm/lib/python3.14/ctypes/__init__.py", line 433, in __init__
self._handle = self._load_library(name, mode, handle, winmode)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "CONDA tvm/lib/python3.14/ctypes/__init__.py", line 475, in _load_library
return _dlopen(name, mode)
OSError: ./build/py3-none-linux_x86_64/lib/libtvm_compiler.so: undefined symbol: LLVMInitializeM68kTargetInfo, version LLVM_22.1
```
* needs-triage
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [I] [Bug] undefined symbols in libtvm_compiler.so [tvm]
Posted by "petersktang (via GitHub)" <gi...@apache.org>.
petersktang commented on issue #19678:
URL: https://github.com/apache/tvm/issues/19678#issuecomment-4637542935
## Resolved
- after `conda install llvmdev`
- `pip install -e .`
- `ldd -r build/py3-none-linux_x86_64/lib/libtvm_compiler.so | grep undefined` returns nothing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org
Re: [I] [Bug] undefined symbols in libtvm_compiler.so [tvm]
Posted by "petersktang (via GitHub)" <gi...@apache.org>.
petersktang closed issue #19678: [Bug] undefined symbols in libtvm_compiler.so
URL: https://github.com/apache/tvm/issues/19678
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org