No OpenCL platform matched given existing options


I get this error msg “No OpenCL platform matched given existing options” when I run the demo,

I already build the TVM-RPC with OpenCL enabled(following steps here:

and build TVM with set(USE_OPENCL ON)

I tried “opencl -device=adreno” , “opencl” or "opencl -device=mali’, all get same error msg…

My Android Device Info
GLES: Qualcomm, Adreno ™ 512, OpenGL ES 3.2 V@331.0 (GIT@0f7742b, Ib21e741bcf) (Date:09/10/18)

Android Device Side:
tvm/apps/android_rpc/app/src/main/jni/…/…/…/…/…/…/include/…/src/runtime/ Check failed: f != nullptr Loader of (module.loadbinary_) is not presented.

Auto-Tuning Side: No OpenCL platform matched given existing options …

My questions are:
How should I investigate this problem? how can I see what are " existing options" and what are " Available OpenCL platform"? and how those are decided?

Thanks in Advance!


What is the output of clinfo on your device? The command will show you available OpenCL platforms.


sorry, I don’t have clinfo command on my device, I only have the info showed by following command:
adb shell dumpsys | grep GLES
which shows “GLES: Qualcomm, Adreno ™ 512, OpenGL ES 3.2 V@331.0 (GIT@0f7742b, Ib21e741bcf) (Date:09/10/18)”


Further debug showed line:198 of

the call of clGetPlatformIDs return error code of CL_PLATFORM_NOT_FOUND_KHR

cl_int code = clGetPlatformIDs(0, nullptr, &ret_size);

Is TVM trying to query my server side’s OpenCL support? my server do not have a GPU, for cross compilation for my android device, why my auto-tuning side’s OpenCL platform is needed?

and when I disable OpenCL (set (USE_OPENCL OFF)) and rebuild TVM, the error msg disappeared;

Could anyone help to explain what happen here?


Does it work now? My guess is that the OpenCL flag that you are changing is for the runtime which would explain why compiling with it enabled causes TVM to search for available devices. It’s very likely that you don’t need to compile with OpenCL enabled to just generate a source module.


It works now for not have this specific problem now, No OpenCL platform matched given existing options.

but I got a new problem of “after whole night auto-tuning, TVM found a schedule which contains CL_INVALID_WORK_GROUP_SIZE”, I’ll create a new issue for that.

I think your guess is correct, but this is still confusing and counterintuitive, as when we set (USE_OPENCL OFF), auto-TVM can work for OPENCL… some improve in tutorials or code would be very helpful


If you think there is a concrete way that we can improve tutorials, please submit a PR! Contributions are always welcome!


@sol401430 Thanks for your feedback. I think this is a bug, and sent a PR to allow compiling TVM with OpenCL enabled on the rpc client side.