v2n-two-models
Run two models at the same time on an E1M-V2M: one on the RZ/V2N's on-die DRP-AI3 and one on the DEEPX DX-M1, each in its own thread, through <alp/inference.h>. Prints per-NPU latency and the combined FPS. A Linux/Yocto user-space app on the Cortex-A55 cluster.
Source: examples/v2n/v2n-two-models/. New in alp-sdk v0.17.0.
[UNTESTED on silicon]Nothing here has run on an E1M-V2M, and the two backends have never been run together. Each NPU has been run alone on silicon (DRP-AI3 with YOLOX-S, the DX-M1 with yolo11n). The HIL specs exist but are not bench-verified.
What it shows
- NPU per handle, chosen by model format.
backendstaysALP_INFERENCE_BACKEND_AUTOandformatnames the model:ALP_INFERENCE_MODEL_DRPAIresolves to DRP-AI3,ALP_INFERENCE_MODEL_DXNNto the DX-M1. There is no SoM-specific code; on a SoM without one of the NPUs, that open fails withALP_ERR_NOSUPPORT. - One thread per NPU. The two NPUs are independent hardware, so a thread on each overlaps their work. Two threads on the same NPU would only take turns.
- Only the NPUs a mode needs are opened, so one process per NPU is safe. DRP-AI is one process per board — a second process opening DRP-AI gets
ALP_ERR_BUSY. - Solo, then both. The default
allmode runs DRP-AI alone, the DX-M1 alone, then both, so the numbers show what sharing the A55 cores and DDR costs each NPU. - CPU budget. Unless you exported them, the program sets
TVM_NUM_THREADS=2andTVM_BIND_THREADS=0so the DRP-AI TVM runtime's worker pool does not fight the DX-M1 runtime for the four A55 cores. The values are a starting point; their effect is unmeasured. - A failed DRP-AI job is not detectable — the runtime's
Run()returnsvoid— so a fast result is not proof of a correct one.
Run
No compiled model ships in the repository. Provide both:
| Argument | What |
|---|---|
<drpai-model.tar> | a drpai_dir bundle (see v2n-drpai-inference) |
<drpai-frame.bin> | the raw bytes of that model's input tensor |
<model.dxnn> | a DEEPX model compiled with dxcom |
<dxnn-frame.bin> | the raw bytes of that model's input tensor |
[seconds] | length of each phase, default 10 |
[mode] | all (default), solo-drpai, solo-dx or both |
v2n-two-models drpai.tar drpai_frame.bin yolo11n.dxnn dx_frame.bin 30
Expected output
Shape only — the numbers depend on the models:
[two-npu] v2n-two-models: mode all, 30 s per phase
[two-npu] drpai: handle open (1 input, 1 output)
[two-npu] deepx: handle open (1 input, 1 output)
[two-npu] temp start: thermal_zone0 = <n> mC
[two-npu] phase: solo drpai
[two-npu] drpai: <n> invokes, avg <ms> ms, max <ms> ms, <fps> FPS
[two-npu] phase: solo deepx
[two-npu] deepx: <n> invokes, avg <ms> ms, max <ms> ms, <fps> FPS
[two-npu] phase: both
[two-npu] drpai: ...
[two-npu] deepx: ...
[two-npu] combined: <n> invokes in <s> s = <fps> FPS
[two-npu] temp end: thermal_zone0 = <n> mC
[two-npu] done
board.yaml
som:
sku: E1M-V2M103
preset: e1m-x-evk
cores:
a55_cluster:
app: ./src # Linux userspace app -- <alp/inference.h> only
recipe: alp-two-models-inference # meta-alp-sdk/recipes-examples/alp-two-models-inference
m33_sm:
os: "off" # Both NPUs are A55/Linux-owned; no M33 app.
diagnostics:
log_level: info
Image requirements
Linux-only — there is no Zephyr target. Build it with the alp-two-models-inference recipe (add the package to your image). Both NPU stacks must be in the image and in libalp_sdk:
- DEEPX:
meta-deepx-m1inbblayers.conf(the V2M machine configs enable it). - DRP-AI3:
meta-rz-drpaiinbblayers.conf, andRUHMI_DRPAI_TVM_DIRset to an account-gated Renesas RUHMI checkout. Without RUHMI the SDK's DRP-AI backend is not compiled and a DRP-AI model fails withALP_ERR_NOSUPPORT.
On V2M, libdxrt turns SIGSEGV / SIGBUS / SIGABRT into a silent exit(1) for every SDK application — see E1M-X V2N-M1.
See also
v2n-drpai-inference— DRP-AI3 alonev2n-m1-deepx-inference— the DEEPX bring-up example<alp/inference.h>reference- Examples overview