REPRODUCIBILITY: 100%
OS VERSION: 5.2.0.22 (Finlayson)
HARDWARE: Jolla Phone 2 (JP2601, MediaTek mt6858), Android base BP2A.250605.031.A3
UI LANGUAGE: English
REGRESSION: No (never worked as far as I know)
DESCRIPTION:
The MT6858 has a MediaTek APU (NPU), and the vendor partition ships the full NeuroPilot stack for it. Apps can’t use it, though, because the vendor HAL services it needs are never started on the Sailfish port.
I’d like to use the NPU from a native Sailfish app: an on-device denoiser for burst photos in a camera app. The driver loads fine in-process, but it can’t read the hardware configuration, so it rejects every operation.
What’s on the device:
- NNAPI support-library driver: /vendor/lib64/libneuralnetworks_sl_driver_mtk_prebuilt.so. It exports the plain ANeuralNetworks* API and loads in a native process with LD_LIBRARY_PATH=/vendor/lib64:/system/lib64.
- HAL server libraries: APUWareUtilsAidlServer.so, APUWareApusysAidlServer.so, APUWareAisteAidlServer.so.
- HAL interfaces: vendor.mediatek.hardware.apuware.utils-V1-ndk.so, utils@2.0.so, apusys-V5-ndk.so, and neuropilot.neuronservice-V1-ndk.so.
- Service binary: /vendor/bin/hw/vendor.mediatek.hardware.neuropilot.neuronservice.neuronservice.mediatek.
- Kernel device: /dev/apusys (crw-rw---- system:camera).
What’s missing:
- No init .rc in /vendor/etc/init starts the neuronservice or the APUWare services, and none of them is running.
- /vendor/etc/vintf/manifest* has no entry for vendor.mediatek.hardware.apuware.* or neuropilot.neuronservice. So even if started by hand, the services couldn’t register. The system compatibility matrix does list them (apuware.utils, apuware.apusys, apuware.aiste…) as expected HALs.
PRECONDITIONS:
STEPS TO REPRODUCE:
-
Build a small NDK program. It dlopens /vendor/lib64/libneuralnetworks_sl_driver_mtk_prebuilt.so, enumerates devices, builds a model with one CONV_2D (fp16 or relaxed fp32), and calls ANeuralNetworksModel_getSupportedOperationsForDevices.
-
Run it from the Sailfish shell with LD_LIBRARY_PATH=/vendor/lib64:/system/lib64.
-
Check /system/bin/logcat -d.
EXPECTED RESULT:
The mtk-neuron device supports common operations (CONV_2D, ADD, RELU…), and models can be compiled and run on the APU.
ACTUAL RESULT:
The device is found, but no operation is supported:
device 0: mtk-neuron, type 4 (accelerator), version 8.2.26, feature level 1000008
logcat:
E apuware_hidl: queryHwConfigInternal utilsHidlService and utilsAidlService is null
E neuron : Getting configuration data failed.
I Manager : Found interface mtk-neuron (version = 8.2.26)
I NeuronCanonicalDelegate: getSupportedOperations
E NeuronCanonicalDelegate: Model operations are not fully supported
fp16 and relaxed fp32 behave the same. The driver also segfaults at process exit, in its PerformanceWorker thread.
MODIFICATIONS:
None to the OS. The test program is a standalone binary.
ADDITIONAL INFORMATION:
What would make this work:
- Start the APUWare HAL services (at least apuware.utils, probably also apuware.apusys) and/or the neuronservice in the Android container. Add the matching VINTF manifest entries so they can register.
- Let normal apps reach the APU. Right now /dev/apusys is root/group camera only, so a Sailjail permission or a group rule would be needed, plus a supported way to load the vendor driver from a native app.
For context, the GPU path works: the same network runs via headless EGL + GLES 3.2 compute on the Mali-G610 in about 0.35 s per 12 MP frame. The NPU would allow bigger models at lower power. Any app doing on-device ML could use it, not just cameras.
Is enabling these services planned? Or is there a reason they’re left out, like a licensing or power issue?
