Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opencl] printf will lead to clCreateKernel exception #121

Open
qiji2023 opened this issue Oct 22, 2024 · 1 comment
Open

[opencl] printf will lead to clCreateKernel exception #121

qiji2023 opened this issue Oct 22, 2024 · 1 comment

Comments

@qiji2023
Copy link

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 < num; t += tnum) {
       out[t] = out[t] * t + out[t]&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??

@AmitBM
Copy link
Contributor

AmitBM commented Nov 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants