viennacl / viennacl-dev

Developer repository for ViennaCL. Visit http://viennacl.sourceforge.net/ for the latest releases.
Other
281 stars 89 forks source link

Get CL_PLATFORM_NOT_FOUND_KHR when clGetPlatformIDs() is called in viennacl #282

Closed xiaxinkai closed 4 years ago

xiaxinkai commented 4 years ago

Hi, Dear ALL: Please Help Me. Thanks in advance. I'm trying to run viennacl on an arm aarch64 embeded linux platform. I cross compiled viennacl successfully. But When I run the example program: opencl-bench-opencl,

I got the error log: ----log start--- ViennaCL: Getting current_context with id 0 ViennaCL: Initializing context no. 0 ViennaCL: Initializing new ViennaCL context. ViennaCL: Setting all devices for context... ViennaCL: Getting platform... xiaxinkai 1 err: -1001 terminate called after throwing an instance of 'viennacl::ocl::unknown_error' what(): ViennaCL: FATAL ERROR: ViennaCL encountered an unknown OpenCL error. Most likely your OpenCL SDK or driver is not installed properly. In some cases, this e. If you think that this is a bug in ViennaCL, please report it at viennacl-support@lists.sourceforge.net and supply at least the following information:

----log finish---

The error code is CL_PLATFORM_NOT_FOUND_KHR.

The error location is at: viennacl/ocl/platform.hpp:58 err = clGetPlatformIDs(42, ids, &num_platforms);

My OpenCL Library is OK. I tested it with: https://github.com/huytd/opencl-benchmark/blob/master/gpu.c

In my opencl test code, code below runs ok: clGetPlatformIDs(1, &platform_id, &ret_num_platforms)

So I dont't know how to solve it.

xiaxinkai commented 4 years ago

My opencl version is 1.2

xiaxinkai commented 4 years ago

@karlrupp Can you help me? thanks!

xiaxinkai commented 4 years ago

Sorry, finally I found that my opencl 1.2 isn’t working normally. So I close this issue.

karlrupp commented 4 years ago

Yes, a CL_PLATFORM_NOT_FOUND_KHR almost always means that the OpenCL installation is incomplete or broken.

xiaxinkai commented 4 years ago

@karlrupp Thanks anyway. Everything of viennacl is OK.

Finally I found the reason Why I can't use libOpenCL.so: I have (1)libOpenCL.so(2)libVivanteOpenCL.so. But In my machine, there is no icd file: /etc/OpenCL/vendors/vivante.icd The content of vivante.icd is only 1 line: libVivanteOpenCL.so