Anyone who knows how to set compile target for Jetson Nano?

Follow the tutorial of Cross Compilation and RPC, I try to export a .so file for in Nvidia Jetson Nano.
I set the target=‘cuda’, make the export as
func.export_library("./tvm_output/myfunc_nano_cr_cuda.so", cc = "/usr/bin/aarch64-linux-gnu-gcc")
because of the cpu architecture of Nano is aarch64-linux-gnu-gcc. But I got the error:
> RuntimeError: Compilation error:
> aarch64-linux-gnu-gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory.

However, if I change the target to "llvm target = aarch64-linux-gnu-gcc ", the error disappears. But the compiled library couldn’t use gpu.

So I thinks the error maybe related to the different architecture of local GPU and Nano’s GPU, of which the former is Pascal, while the latter is Maxwell. So, there should be a specific setting for the target.
Can anyone offer some help? Thank you!

2 Likes

Reply.

check this tutorial

https://tvm.apache.org/docs/how_to/deploy_models/deploy_model_on_nano.html?highlight=jetson%20nano

if local_demo:
    target = tvm.target.Target("llvm")
else:
    target = tvm.target.Target("nvidia/jetson-nano")
    assert target.kind.name == "cuda"
    assert target.attrs["arch"] == "sm_53"
    assert target.attrs["shared_memory_per_block"] == 49152
    assert target.attrs["max_threads_per_block"] == 1024
    assert target.attrs["thread_warp_size"] == 32
    assert target.attrs["registers_per_block"] == 32768

with tvm.transform.PassContext(opt_level=3):
    lib = relay.build(func, target, params=params)