Tvm build issue in docker container


Hello guys,

I first raise an issue in github and tqchen suggests me to ask here.
I download tvmai/ci-cpu docker images from docker hub and then add following instructions in Dockerfile to build myself docker image.

#Build TVM
COPY install/ /install/
RUN bash /install/
#Install mxnet
RUN pip3 --no-cache-dir install --upgrade --force-reinstall mxnet
#Environment variables
ENV PYTHONPATH=/usr/tvm/python:/usr/tvm/topi/python:/usr/tvm/nnvm/python:/usr/tvm/vta/python:${PYTHONPATH}

Both tvm and docker image are built successfully. But when I run a container and import tvm in python3, I got following error info.

        import tvm
        Traceback (most recent call last):
        File "", line 1, in
        File "/usr/tvm/python/tvm/", line 21, in
        from . import tensor
        File "/usr/tvm/python/tvm/", line 20, in
        from ._ffi.node import NodeBase, NodeGeneric, register_node, convert_to_node
        File "/usr/tvm/python/tvm/_ffi/", line 24, in
        from .node_generic import NodeGeneric, convert_to_node, const
        File "/usr/tvm/python/tvm/_ffi/", line 23, in
        from .base import string_types
        File "/usr/tvm/python/tvm/_ffi/", line 60, in
        _LIB, _LIB_NAME = _load_lib()
        File "/usr/tvm/python/tvm/_ffi/", line 52, in _load_lib
        lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
        File "/usr/lib/python3.6/ctypes/", line 348, in init
        self._handle = _dlopen(self._name, mode)
        OSError: /usr/tvm/build/ undefined symbol: tvm_ecall_packed_func

I try commenting following two intructions in i.e. build tvm without sgx-sdk.

echo set(USE_SGX /opt/sgxsdk) >> config.cmake
echo set(RUST_SGX_SDK /opt/rust-sgx-sdk) >> config.cmake

The building is success and the error doesn’t appear when import tvm. But several warnings like this appear when I compile an mxnet model.

Cannot find config for target=llvm -mcpu=haswell, workload=(‘conv2d’, (1, 128, 28, 28, ‘float32’), (256, 128, 3, 3, ‘float32’), (1, 1), (1, 1), (1, 1), ‘NCHW’, ‘float32’). A fallback configuration is used, which may bring great performance regression.

The compile python script can be run without warning in the prebuilt tvmai/demo-cpu image with tvm 0.4.

I tried in master branch. Any suggestion? Thanks.


Their docker containers are broken.
Workaround: inside a running container, follow steps to build from source documentation page. Once thats done, commit your container to form a docker image docker <container_id> <image_name>