Build issue for hexagon

Hi, I’m trying to get stuff in this article to work: TVM open source compiler now includes initial support for Qualcomm Hexagon DSP.

I compiled the entire tvm according to the install process on the official website.
USE_HEXAGON_DEVICE in config.cmake is set to sim.
The build process is OK, but there is an error when calling the compiled function.

As sim_dev tries to open libtvm_runtime.so, I added the path of libtvm_runtime.so to ADSP_LIBRARY_PATH. I’m not sure if this is correct. The thing is, sim_dev can find libtvm_runtime.so but cannot open it. Then I found sim_dev was built to 32bit while libtvm_runtime.so was built to 64 bit.

I also tried to set CFLAGS=-m64 in CMakeLists.txt of sim_dev,and the final compiled sim_dev executable is still 32bit.

I would like to know why this is happening and is there any way to compile it to 64bit?
The version of tvm I am using is 0.8 released on Github.

sim_dev was a Hexagon executable, it was executed by Hexagon simulator. All Hexagon executables are 32-bit. The libtvm_runtime.so that you’re looking at was built for x86, you’ll need to build the TVM runtime for Hexagon separately.

Btw, all of that has been removed in recent TVM (in the main branch). We have removed support for offload (which is what sim_dev was for). The Hexagon support has been expanded and also made simpler to use, so maybe you could switch to the latest TVM.

Thanks for reply. That really helps a lot.
I’ve tried with the latest TVM and it seems a little wired.

I set USE_HEXAGON to ON but it doesn’t seem to look for the hexagon toolchain when configuring.
So I’m wondering if there are some items I’m not setting in config.cmake, as there is no complete tutorial on hexagon.

There are some README files in the source tree: building, two apps used to run workloads on Hexagon here and here, plus some testing info.

Let us know if there is enough information there, if not, we’ll try to improve them.

I’ve found and looked into building and test earlier sometime.
For myself, if I dont set USE_HEXAGON_RPC=True in cmake, no hexagon related code will be compiled.
And this is not mentioned in your README files.

I followed test to do some tests.
In test_launcher.py mentioned in this readme, I’m not really sure what hexagon_session is.
So in my own code I tried to generate one. image

I don’t know if this is what you intended, but so far it works.
Then I just try to generate some data and move them to the hexagon simulator, just like in the test file.
image

At this step, I got an error.
It seems to be caused by copying data to hexagon simulator.

I am still looking for the reason and I dont know if you have any clues.
Thanks again for your reply, it really helped me.

I‘ve create a new topic (simulator cpu arch) for my question…
Thanks for your help.