No OpenCL platform matched given existing options


#1

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

I already build the TVM-RPC with OpenCL enabled(following steps here:https://github.com/dmlc/tvm/tree/master/apps/android_rpc)

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)

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

Auto-Tuning Side:
opencl_device_api.cc:239: 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!


#2

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


#3

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)”


#4

Further debug showed line:198 of opencl_device_api.cc

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?


#5

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.


#6

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


#7

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


#8

@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.