tvm._ffi.base.TVMError: TVMError: Runtime "crt" is not defined

When I try to run the micro_tflite.py, it shows this bug: tvm._ffi.base.TVMError: TVMError: Runtime “crt” is not defined.

The enviroment is based on tlcpack/ci-qemu:v0.11 image. The tvm version is 0.9.dev0.

The config.cmake file is below.

.

Is my config.cmake is not right or something else?

Thank you.

When I install TVM Python Package, it shows the error message as below: error: can’t copy ‘…/build/standalone_crt’: doesn’t exist or not a regular file

Is there some default setting is not right?

I check the build directory, it has standalone_crt directory.

Hi @zhenhouhong, when you say 0.9.dev0, are you using the tlcpack Python package? Have you tried this building from source? Unfortunately we aren’t testing those tlcpack packages as well as we should right now.

I built it from the source code. I download the tvm source code from the release version.

@areusch

I follow the install from source documentation. https://tvm.apache.org/docs/install/from_source.html

@zhenhouhong hmm, the error you’re referring to could have been caused by a breaking API change that was submitted just after releasing 0.8.0. I don’t think we have released 0.9.0.dev0 yet, and we have a TODO to fix up that API error. I’m also wondering if you’re using micro_tflite.py from that same branch? (I presume you are).

I’d suggest either trying with the released 0.8.0 or with main. Could you let me know if you find success with one of those routes?

Sure , I will try the main or 0.8.0 branch. And I wonder the documentation could have the version select? Like the PyTorch documentation. I don’t see the tvm documentation 0.8.0, only the official 0.9.dev0 documentaion. I google it only show the 0.8.dev, should I use it?微信截图_20220324083228

Thank you for your helping me @areusch .

Yeah the version select is a thing we have been meaning to add, we even discussed it at the community meeting this morning. Filed https://github.com/apache/tvm/issues/10754 if you want to follow along.

OK, that will be great. Thanks a lot @areusch

It is wired. I success to run the micro_tflite.py when I use pip install tlcpack-nightly[tvmc] -f https://tlcpack.ai/wheels. @areusch

When I install tvm from tvm 0.8.0 or main branch source code, still show the same error messages as below:

tvm._ffi.base.TVMError: TVMError: Runtime “crt” is not defined.

error: can’t copy ‘…/build/standalone_crt’: doesn’t exist or not a regular file

@zhenhouhong hmm. can you clarify a couple things:

  1. are you using the same micro_tflite.py script, or do you also change micro_tflite.py when you change the version of TVM? I would not expect the same script to work on 0.8.0 and also on later versions (due to the API change I mentioned).
  2. can you send me the exact set of commands you’re running here and the console output? I can’t tell where this error is occurring.

I know this is an old thread, but it seems like this error persists in 2024 where building from source with CRT (specifically microTVM) is broken. Were there any updates on this? I was trying to get AoT compilation to work, but a lot of the official Dockerfiles are also broken. Is there a specific version that is still functional? I opened a new thread on this here.