Libstdc++.so.6: version `GLIBCXX_3.4.30' not found and sovled

when excute the example of the doc, the error happed.

Traceback (most recent call last): File “postprocess.py”, line 7, in from tvm.contrib.download import download_testdata File “/home/jiazhanbo/ai_dev/build_fold/0.12.0/apache-tvm-src-v0.12.0/python/tvm/init.py”, line 26, in from ._ffi.base import TVMError, version, _RUNTIME_ONLY File “/home/jiazhanbo/ai_dev/build_fold/0.12.0/apache-tvm-src-v0.12.0/python/tvm/_ffi/init.py”, line 28, in from .base import register_error File “/home/jiazhanbo/ai_dev/build_fold/0.12.0/apache-tvm-src-v0.12.0/python/tvm/_ffi/base.py”, line 71, in _LIB, _LIB_NAME = _load_lib() File “/home/jiazhanbo/ai_dev/build_fold/0.12.0/apache-tvm-src-v0.12.0/python/tvm/_ffi/base.py”, line 57, in _load_lib lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL) File “/home/jiazhanbo/.conda/envs/pytorch-38/lib/python3.8/ctypes/init.py”, line 373, in init self._handle = _dlopen(self._name, mode) OSError: /home/jiazhanbo/.conda/envs/pytorch-38/bin/…/lib/libstdc++.so.6: version `GLIBCXX_3.4.30’ not found (required by /home/jiazhanbo/ai_dev/build_fold/0.12.0/apache-tvm-src-v0.12.0/python/tvm/libtvm.so)

the lib of conda is ok:

the lib of os is ok:

ref this link package management - GLIBCXX 3.4.30 not found in conda environment - Ask Ubuntu I add the link in conda evn to the os lib: in path ~/.conda/envs/pytorch-38/lib use this cmd: ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6

it’s OK

1 Like

Hi @lanyuflying, did you install TVM by pip install? If so, it is probably because the pip wheel is built on manylinux where the libstdc++ is newer than the one Ubuntu offers. One another workaround you can do is to use Conda to install gcc so that the latest libstdc++ can be installed, as mentioned in the “Note for Pip Installation under Conda” section here MLC | MLC Packages

2 Likes

I also meet this problem, l tried

export TVM_HOME=/path/to/tvm
export PYTHONPATH=$TVM_HOME/python:${PYTHONPATH}

But it still shows same problem.

Finally, I find the solution

It can works.