[Android 14/15/16] TensorFlow Lite GPU delegate not supported? (ObjectDetection demo issue)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

[Android 14/15/16] TensorFlow Lite GPU delegate not supported? (ObjectDetection demo issue)

跳至解决方案
205 次查看
hank2024
Contributor II

Hi,

I have been testing the TensorFlow Lite Object Detection demo on several Android BSP releases for the i.MX8MQ EVK, but the GPU delegate cannot be enabled successfully.
The inference works correctly on CPU, but when switching to GPU delegate, initialization fails and inference does not start.

Test Environment

Item Version / Detail
SoCNXP i.MX8MQ
Android BSPandroid-16.0.0_1.0.0 / android-15.0.0_2.0.0 / android-14.0.0_1.2.0
DemoTensorFlow Lite Object Detection (from TensorFlow)
GPUVivante GC7000Lite
NPUNot used

 

Problem Details

The app runs fine with CPU inference, but when enabling GPU delegate, it fails to initialize.
Here are some of the relevant logcat messages during GPU mode:

2025-09-11 20:05:58.595  libEGL  E  call to OpenGL ES API with no current context (logged once per thread)
2025-09-11 20:05:55.994  Surface  E  IGraphicBufferProducer::setBufferCount(0) returned Invalid argument
2025-09-11 20:05:56.086  BaseTaskApi  W  Closing an already closed native lib

in the code:

                if (CompatibilityList().isDelegateSupportedOnThisDevice) {
                    baseOptionsBuilder.useGpu()
                    activeDelegate = "GPU"
                } else {
                    objectDetectorListener?.onError("GPU is not supported on this device") // also print this !!!!!!!!!!!!
                }

 

I have check:

In /vendor/lib64/, there are libraries such as libOpenCL.so, libtim-vx.so,
 
Is direct GPU Delegate unsupported on i.MX8MQ even in Android  BSP? (Similar to this Android 13 thread, where VX was recommended for Android 14+.)

 

0 项奖励
回复
1 解答
107 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi hank:

The stock TFLite GPU delegate is not supported on i.MX8MQ Android BSPs , this is expected due to GPU backend compatibility and NXP's chosen acceleration strategy.  Use VX (TIM-VX) delegate on i.MX8M, and Neutron delegate on i.MX95.

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
108 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi hank:

The stock TFLite GPU delegate is not supported on i.MX8MQ Android BSPs , this is expected due to GPU backend compatibility and NXP's chosen acceleration strategy.  Use VX (TIM-VX) delegate on i.MX8M, and Neutron delegate on i.MX95.

 

0 项奖励
回复
99 次查看
hank2024
Contributor II

Thank you very much for your reply. I have already resolved the issue. I also referred to this document. i.MX TensorFlow Lite on Android User's Guide