Skip to content

[Bug] undefined symbol _ZN3tvm3ffi9ReprPrintERKNS0_3AnyE in libtvm_compiler.so #19486

@petersktang

Description

@petersktang

USE_CUDA=OFF USE_ROCM=ON USE_LLVM=ON

Expected behavior

import tvm is able to load

Actual behavior

Traceback (most recent call last):
  File "<test>/tvmSample1.py", line 1, in <module>
    import tvm
  File "<tvm>/python/tvm/__init__.py", line 29, in <module>
    from .base import TVMError, __version__, _RUNTIME_ONLY
  File "<tvm>/python/tvm/base.py", line 60, in <module>
    _LIB = libinfo.load_lib_ctypes(
        "tvm", "tvm_compiler", "RTLD_LOCAL", extra_lib_paths=_extra_lib_paths
    )
  File "<tvm>/python/tvm/libinfo.py", line 143, in load_lib_ctypes
    return ctypes.CDLL(str(lib_path), getattr(ctypes, mode))
           ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<conda env>/tvm/lib/python3.14/ctypes/__init__.py", line 433, in __init__
    self._handle = self._load_library(name, mode, handle, winmode)
                   ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<conda env>/tvm/lib/python3.14/ctypes/__init__.py", line 473, in _load_library
    return _dlopen(name, mode)
OSError: <conda env>/tvm/lib/python3.14/site-packages/tvm/lib/libtvm_compiler.so: undefined symbol: _ZN3tvm3ffi9ReprPrintERKNS0_3AnyE

Environment

  • Ubuntu 24, Linux 6.17.0-1017-oem with ROCm 7.2.2 (AMD Ryzen™ AI 9 HX 370, GPU 890M, no Nvidia GPU)
  • The CUDA compiler identification is NVIDIA 13.1.115 with host compiler GNU 14.3.0 [conda virtual environment]

Steps to reproduce

                "-DTVM_BUILD_PYTHON_MODULE=ON",
                "-DUSE_CUDA=OFF", "-DUSE_ROCM=ON", "-DUSE_LLVM=ON",
                "-DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang",
                "-DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++"
  • set(USE_LLVM "/usr/bin/llvm-config-20" )
  • pip install -e . [in a conda virtual environment]
  • python -C 'import tvm'

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triagePRs or issues that need to be investigated by maintainers to find the right assignees to address ittype: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions