imx8 openCL clBuildProgram error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8 openCL clBuildProgram error

Jump to solution
1,953 Views
1019599657
Contributor III

Hi , i use opencl at imx8 , i meet a error . when it run to the status=clBuildProgram(pgram,1,device,option,NULL,NULL), it will return error:CL_BUILD_PROGRAM_FAILURE . I use clGetProgramBuildInfo to get error, i can get this error:

Build Log : error : Failed to open the temporary file /data/vendor/.opencl-cache/cl-640601. for writing.

How i can solve this error?5.png

0 Kudos
1 Solution
1,827 Views
1019599657
Contributor III

Hi , i do clGetProgramBuildInfo to get  the error information ,log is:Failed to open the temporary file "/data/vendor/.opencl-cache/cl-xxx" for writing.

My kernel is only:

#define KERNEL_SRC "\n" \
    "__kernel void hello_kernel(__global const float *a,__global const float *b, __global float *result) \n "\
    "{                                                                                                   \n "\
    "   int gid = get_global_id(0);                                                                      \n "\
    "   result[gid] = a[gid] + b[gid];                                                                    \n"\
    " } "
 

I also do it on xiaomi6x, and i can run process. 

View solution in original post

0 Kudos
3 Replies
1,827 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Li,

This error is typically caused by a syntax error in your kernel code. You can call the OpenCL function clGetProgramBuildInfo with the flag CL_PROGRAM_BUILD_LOG to access the log generated by the compiler. This log contains the output you are probably used to when compiling on the command-line (errors, warnings, etc.).

Regards

0 Kudos
1,827 Views
1019599657
Contributor III

Hi, i do "clGetProgramBuildInfo" to get error log,

the log is: error : Failed to open the temporary file /data/vendor/.opencl-cache/cl-612501. for writing,

statues is CL_BUILD_PROGRAM_FAILURE.

My kernel code is below. And i alse run it on xiaomi phone . I can run it success. How i can solve it ?

#define KERNEL_SRC "\n" \
    "__kernel void hello_kernel(__global const float *a,__global const float *b, __global float *result) \n "\
    "{                                                                                                   \n "\
    "   int gid = get_global_id(0);                                                                      \n "\
    "   result[gid] = a[gid] + b[gid];                                                                    \n"\
    " } "


0 Kudos
1,828 Views
1019599657
Contributor III

Hi , i do clGetProgramBuildInfo to get  the error information ,log is:Failed to open the temporary file "/data/vendor/.opencl-cache/cl-xxx" for writing.

My kernel is only:

#define KERNEL_SRC "\n" \
    "__kernel void hello_kernel(__global const float *a,__global const float *b, __global float *result) \n "\
    "{                                                                                                   \n "\
    "   int gid = get_global_id(0);                                                                      \n "\
    "   result[gid] = a[gid] + b[gid];                                                                    \n"\
    " } "
 

I also do it on xiaomi6x, and i can run process. 

0 Kudos