13 Replies Latest reply on Jul 24, 2014 11:48 AM by boxerab

    clBuildProgram crashes on simple kernel

    boxerab

      I am running windows 7 64 bit on intel cpu with AMD HD 7700 series GPU.

       

      I have the Intel OpenCL SDK 2014 integrated into Visual Studio.

       

      When I try to build the following simple kernel targetting the GPU:

       

      void kernel rct_with_shift( image2d_t input,  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)) ;

      }

       

      I get an exception:

       

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

       

      The program builds fine for CPU.

        • Re: clBuildProgram crashes on simple kernel
          dipak

          Hi,

          As I've understood, you are trying to access the AMD GPU using Intel OpenCL SDK. I don't think the Intel SDK supports AMD GPU (i.e. non-Intel GPU) and that's the reason you are facing the problem. Please check list of GPUs supported by the Intel OpenCL SDK.

          Another thing you can do is install latest AMD catalyst driver and APP SDK and then run the kernel on AMD GPU.

           

          Regards,

          • Re: clBuildProgram crashes on simple kernel
            boxerab

            Can someone from AMD please take a look at this?  Simple kernel builds on intel cpu,

            but refuses to build on AMD gpu.

             

            Looks pretty clearly to be a bug.

              • Re: clBuildProgram crashes on simple kernel
                dipak

                Hi,

                Anyways, I created a sample project using AMD sdk, and the crash still happens.

                After installation of the AMD Catalyst driver and APP SDK, the clinfo command can be used to check the detected OpenCL platform(s) and device(s). In your case, it should list the Intel CPU and AMD GPU. If it doesn't show the AMD GPU, then there may some problem in installation and you've to do it once again. Once the clinfo works fine and shows the all devices, you can expect that same devices can be accessible from OpenCL program. Please check and share your findings.

                 

                Regards,

                  • Re: clBuildProgram crashes on simple kernel
                    boxerab

                    Thanks, Dipak. But, there is no question that I have an AMD GPU installed correctly. I can run all of the sample programs

                    that come with the APP sdk.

                     

                    I have spent some time preparing a reproducer, which is posted on my github page. Please take a look.

                    Thanks!

                     

                    Aaron

                      • Re: clBuildProgram crashes on simple kernel
                        boxerab

                        Could someone please look into this and file a bug report if

                        it is a bug?  I am unable to run my kernel because of this issue.

                          • Re: clBuildProgram crashes on simple kernel
                            dipak

                            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,

                              • Re: clBuildProgram crashes on simple kernel
                                boxerab

                                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




                      • Re: clBuildProgram crashes on simple kernel
                        rouellet

                        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.