radeon_gpu_analyzer
radeon_gpu_analyzer copied to clipboard
[opencl] `printf` will lead to clCreateKernel exception
I wrote a opencl code , such as:
#pragma OPENCL EXTENSION cl_amd_printf : enable
__kernel void test_ker(__global int* out, int num) {
int tid = get_global_id(0);
int tnum = get_global_size(0);
if (tid == 0) {
printf("hello**************************");
}
for (int t = tid; t
I Compiled the code by rga using the command:
rga -s opencl -c gfx1030 --O2 -b a.bin test.cl
when I executed the kernel, I got the error:
unknown file: Failure
C++ exception with description "clCreateKernel" thrown in the test body.
but if I remove printf, the kernel will run successfully, so How should I print something inside the kernel??
Hi @qiji2023,
Thanks for reporting this issue.
Can you please set the following environment variables, then rerun and share the stderr output?
- AMD_LOG_LEVEL=7
- AMD_COMGR_EMIT_VERBOSE_LOGS=1