[MT8371/G520] DLA Deployment on NeuroPilot SDK – Platform Folder Availability & C++ Integration Sample

Hi MediaTek team,

I have a question regarding CV model deployment on G520 (MT8371).

I have a super-resolution (SR) model and would like to deploy it on DLA and integrate the inference process into a C++ application.

My questions are:

  1. For CV dla model deployment on MT8371, do I need an MT8371-specific platform folder in the NeuroPilot SDK for DLA compilation and runtime integration? In neuropilot-sdk-basic-8.0.11-build20260211, I only found host platform and device platforms (mt6878 / mt6897 / mt6899 / mt6989 / mt6991). How to get MT8371 files if its necessary?
  2. Is there any related demo, sample code, or reference implementation showing how to integrate DLA inference into a C++ application?

Currently, the examples I can find only demonstrate running the converted DLA model directly using NeuronRT. I could not find examples showing how to call DLA inference APIs and integrate them into a C++ project.

Any guidance or example code would be highly appreciated.

Thanks!

Hi Xin_Qi,

Thanks for reaching out!

1. SDK Download

For DLA deployment on MT8371/G520, you can use the Neuron SDK built for MT8189. It’s compatible with both MT8371 and MT8391. Download it here: 20250423_Neuron_SDK_v1.2517.03_neuron-8.0-release.tar.gz

2. C++ Integration with the DLA Inference API

You can use the Neuron Runtime API for C++ integration. The standard flow:

  1. NeuronRuntime_create(): initialize the Runtime
  2. NeuronRuntime_loadNetworkFromFile or NeuronRuntime_loadNetworkFromBuffer: load the .dla model
  3. NeuronRuntime_setInput: set the input buffer sizes
  4. NeuronRuntime_setOutput: set the output buffer sizes
  5. NeuronRuntime_setQoSOption: set the QoS options
  6. NeuronRuntime_inference: run inference
  7. NeuronRuntime_release: free resources

For more details, refer to: Neuron Runtime API

Best,
Jun


    void* runtime = nullptr;
    EnvOptions options{};
    options.deviceKind = kEnvOptHardware;
    options.MDLACoreOption = Single;
    options.CPUThreadNum = 2;
    options.suppressInputConversion = false;
    options.suppressOutputConversion = false;

    int ret = NeuronRuntime_create(&options, &runtime);
    LOGD("NeuronRuntime_create ret=%d", ret);
    if (ret != 0 || runtime == nullptr) return -1;

    ret = NeuronRuntime_loadNetworkFromFile(runtime, dla_path);
    LOGD("loadNetwork ret=%d", ret);
    if (ret != 0) {
        NeuronRuntime_release(runtime);
        return -1;
    }

    size_t input_num = 0;
    size_t output_num = 0;
    NeuronRuntime_getInputNumber(runtime, &input_num);
    NeuronRuntime_getOutputNumber(runtime, &output_num);

    LOGD("input_num=%d output_num=%d", input_num, output_num);


I want to run DLA using the code above. The DLA model has already been successfully running with NeuronRT before.

The current deployment method is to build an APK with Android Studio and link the two shared libraries, neuron_runtime.so and neuron_adapter.so, into the APK.

However, when I run the APK, I get an error. It looks like the app cannot link to the system shared libraries (the .so files are located under /vendor/lib64).

Is this caused by permission restrictions? How should I correctly link or load these system .so libraries in the APK?


D  [process] NeuronRuntime_create ret=0
E  dlopen failed: library "libapu_mdw.so" not found
E  dlopen failed: library "libapu_mdw_batch.so" not found
E  Load APUSys shared library failed.
E  APUSysEngine initialization failed.
W  Cannot create device for APUSYS_2_0
W  Found an unsupported target: APUSYS_2_0
W  Fail to revise dla::CompiledResult
W  Fail to preprocess dla::CompiledGraph
W  Fail to preprocess dla::CompiledNetwork
E  Cannot prepare execution.
E  Successfully open network but cannot start execution.
E  NeuronRuntime_loadNetworkFromFile fails: Cannot load network
D  [process] loadNetwork ret=4
# ls /vendor/lib64/ | grep apu
libapu_mdw.so
libapu_mdw_batch.so
libapusys.so
vendor.mediatek.hardware.apuware.apusys-V3-ndk.so
vendor.mediatek.hardware.apuware.utils-V1-ndk.so
vendor.mediatek.hardware.apuware.utils@2.0.so