cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

dipak
Staff
Staff

Re: clBuildProgram crashes on simple kernel

Thanks for sharing the code.

As you've mentioned, you're facing a problem with building the kernel on the GPU.  Can you confirm whether you are getting a compiler error or some other error?

It is difficult to say whether the issue is with the OpenCL compiler/run-time or your project.  If it's a compilation error, what is the error message?  Did you face problems building the kernel for this project only, or does the problem occur with all projects? 

To help us investigate, can you a simple test case (with corresponding host-code) that manifests the same problem.  Please also share the clinfo output.

Note: Most of the AMD APP SDK samples run fine even there is no GPU device found;  those samples fall back to the CPU to run the kernel.

Regards,

0 Likes
boxerab
Challenger

Re: clBuildProgram crashes on simple kernel

Dipak,

Please read the original post.

I run clBuildProgram, and I have the following exception:

Unhandled exception at 0x000007FEE0486278 (amdocl64.dll) in opj_compress.exe: 0xC0000005: Access violation executing location 0x000007FEE0486278.


Not build errors - the compiler crashes,


I have provided a sample project that exhibits this behaviour: please check it out and run it.


I have to say, on the intel forums, this would not take four days, only to have me repeating the details from the original post.


In frustration,

Aaron




0 Likes
rouellet
Staff
Staff

Re: clBuildProgram crashes on simple kernel

Yup.

I can reproduce the crash.

When run against the top of tree RTL, this error is given:

"<file>", line 11: error: bad argument type to opencl image op: expected write_only image type

    write_imagei(output, pos, (int4)(0,0,0,0)) ;

Here's the relevant OpenCL V1.2 description:

"

6.6 Access Qualifiers

Image objects specified as arguments to a kernel can be declared to be read-only or write-only.

A kernel cannot read from and write to the same image object. The __read_only (or read_only) and __write_only (or write_only) qualifiers must be used with image object arguments to declare if the image object is being read or written by a kernel. The default qualifier is __read_only. In the following example

__kernel void

foo (read_only image2d_t imageA,

      write_only image2d_t imageB)

{

….

}

imageA is a read-only 2D image object, and imageB is a write-only 2D image object.

The __read_only, __write_only, __read_write, read_only, write_only and read_write names are reserved for use as access qualifiers and shall not be used otherwise.

"

If you change your kernel to:

void kernel

rct_with_shift(

               __read_only image2d_t input,

               __write_only image2d_t output,

               unsigned short width,

               unsigned short height,

               int level_shift)

{

  const int2 pos = {get_global_id(0), get_global_id(1)};

  write_imagei(output, pos, (int4)(0,0,0,0)) ;

}

The crash should go away.

I can say with certainty, that this bug will be fixed in a future release.

I cannot (without a whole lot of difficulty) say with certainty which future release that might be.

But it should be the next release or the one after that.

Thanks,

R.

0 Likes
boxerab
Challenger

Re: clBuildProgram crashes on simple kernel

Thank you, Roland!!

0 Likes