[Hexagon][DSP] Fail to run model on Hexagon

I’m trying to get a resnet-18 model work on SnapDragon 865 DSP by following the tutorial here: tvm/apps/hexagon_launcher at main · apache/tvm · GitHub

I almost get everything ready before I encountered an issue inside the FastRPC part which I don’t know how to debug/fix.

Here is the error when I run the launcher_android:

Here is the logcat log:

Could anyone help this, thanks a lot!

Here is the model:

import sys
import torch
import torchvision.models as models

class ResNet18(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.backbone = models.resnet18(pretrained=True)
        self.act = torch.nn.Softmax(dim=1)

    def forward(self, x):
        return self.act(self.backbone(x))
        

if __name__ == '__main__':
    resnet18_model = ResNet18()
    resnet18_model.eval()
    input_shape = [1, 3, 224, 224]
    input_data = torch.randn(input_shape)
    script_model = torch.jit.trace(resnet18_model, input_data)
    script_model.save(sys.argv[1])

And I applied several fixes before I can get it running in TVM:

By enabling FARF logs in DSP, just get more error logs from logcat:

Still investigating…

By adding more logs in FARF, the issue is in the hexagon_dma module. It’s because I’m using v66 hardware which doesn’t support dma yet…

By applying this fix, it works now: [Hexagon] Guard UserDMA code with architecture check (#10770) · apache/tvm@3918717 · GitHub

Hello, I met some similar erros NULL ptr occurenaces in mem_free(), can you tell me where did you add more logs in FARF?