I am using a Google Pixel (Snapdragon 821), but Google didn't support OpenCL on all its phone. When I ran the example on my phone, I got an exception:
Unable to create network! Cause: error_code=809; error_message=OpenCL function has returned error. OpenCL Error (-59) CL_INVALID_OPERATION; error_component=GPU Runtime; line_no=121; thread_id=-731907728; opencl_error=-59
But I think the runtime I selected is "CPU". The "GPU Runtime" component shouldn't have be loaded.
Is there a way to run my model on devices without OpenCL? And by the way, can I use dsp on Pixel? In the document I saw dsp on 821 is available but I got an exception that it is not supported when I switch runtime to "DSP"
Thanks in advance.
GPU runtime requires OpenCL driver on device, CPU runtime does not.
So error you see is expected when GPU runtime is selected. You should not see it with CPU runtime. Could you please make sure that indeed you selected CPU runtime when that error message came out?
As for DSP runtime error, could you please provide the error message? Also, what kind model are you trying to load?
Thanks
Hi,
an update regarding DSP runtime on Pixel. DSP runtime doesn't work on Pixel phone. FastRPC feature required by DSP runtime has been disabled for apps.
DSP runtime support is device OEM dependent. Not all OEMs enable support for DSP. Pixel is an example.
Thanks for your reply! I didn't edit the example project and just run it. Here is my screencord.
http://quexian.me/snpe_error.mp4
You can see the runtime is "CPU" and then I got an exception. Is there something wrong?
Thanks in advance.
Thanks for your reply. I uploaded a screenrecord. I hope I didn't do something wrong :)
Thanks for the screen capture. It appears you are doing everything correctly. Please give us a bit more time to investigate further. Do you perhaps have any other Android phone to try it on in mean time?
Thanks for your support :)
I tried the same apk on my friend's Xiaomi Mi 6 (with Snapdragon 835 and OpenCL support). CPU works fine on this device (and also GPU and DSP but it is not surprised)
Hi,
Thanks for trying it out on different phone.
We have confirmed the behavior you described. There is an issue in Snapdragon NPE 1.2.2 code which will cause it to not be able to run on any device which does not have OpenCL support (like Pixel), with similar symptoms that you have reported. Currently the only workaround is to use device which has OpenCL support. We will fix this issue in the future SDK release.
Thanks for helping uncoverng the issue, and sorry for the inconvenience.
It's my honor to report a valid bug. Hope that it can be fixed quickly :)
The same behaviour on Snapdragon 625 Linux camera.
SNPE does not see OpenCL on board somehow and fails. But OpenCL is there and simple clpeak benchmark tool shows that:
Hi,
Thank you for your interest in Snapdragon NPE.
The scenaio that you have (which you also describe on another thread) is different, as you are running on Linux and not Android, and your Linux has openCL library. This SDK is intended for running on Android.
I believe that there is a work-around for your scenario. See reply on the other thread.
I see that libraries are available for android and linux in snpe-1.2.2/lib:
Thanks for SNPE - it works great on many of our devices.
Unfortunately, we also ran into this problem of SNPE trying the GPU runtime even when the CPU runtime is the only one selected.
Our device is a stock Google Pixel XL running Android 7.1.2 security patch level August 5, 2017.
We explicitly set only the CPU runtime with :
snpeBuilder = new SNPE.NeuralNetworkBuilder((Application)(context.getApplicationContext()));
snpeBuilder.setModel(dlcModelFile);
snpeBuilder.setRuntimeOrder(NeuralNetwork.Runtime.CPU);
snpeNetwork = snpeBuilder.build(); // <-- CRASH
The error is :
Caused by: java.lang.IllegalStateException: Unable to create network! Cause: error_code=809; error_message=OpenCL function has returned error. OpenCL Error (-59) CL_INVALID_OPERATION; error_component=GPU Runtime; line_no=121; thread_id=-264866508; opencl_error=-59
Thanks.
Rex
CPU runtime now works on devices without OpenCL like most Google devices (Pixel, etc...)
It would be great to release a gradle packaged version (I have one decompiled from the AAR) as using AAR less Android Studio debug friendly.