OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

crash when setting kernel argument for dynamic local memory

ABoxe
Beginner
182 Views

Hello List,

I am trying to pass dynamically allocated local memory to my kernel.

So, I am using the line

    clSetKernelArg(myKernel, 2, localMemSize, NULL);

where argument two in the kernel is prefixed by local.

When I run this (windows 7, visual studio 2012), I get an exception:

 

Unhandled exception at 0x51AFF594 (IntelOpenCLProfiler.dll) in ocldwt.exe: 0xC0000005: Access violation reading location 0x00000000.

 

Any ideas?

Thanks,

Aaron

0 Kudos
4 Replies
ABoxe
Beginner
182 Views

I can easily reproduce this on any intel sample project:

Just add a dummy local variable to the kernel, (let's say it is argument number 8),

and call

 error_code = clSetKernelArg(kernel, 7, 256, NULL);

    if (CL_SUCCESS != error_code)
    {
        LogError("Error: clSetKernelArg (6) returned %s.\n", TranslateOpenCLError(error_code));
        return error_code;
    }

 

This results in an access violation crash.

Dmitry_K_Intel
Employee
182 Views

Hi Aaron,

We are aware of this issue. It will be fixed in a next release.

 

Ofir_C_Intel
Employee
182 Views

Hi Aaron,

This is a known issue we have already addressed, and will be fixed on the next release

(we will update the website in due course).

For now you can work around this issue by disabling API Debugger:

Visual Studio > Tools > Code Builder - Options > API Debugger

and uncheck "Enable OpenCL API Debugger".

 

This (disabling API Debugger) will not be necessary in the next release.

 

Note: API Debugger provides you valuable information about your OpenCL host application, such as:

  • Trace of all your API calls with their return values, and parameters passed:
    36ED52A7-4871-4552-8239-6727334153A2.png
     
  • Objects (tree) view of all the Context, Devices, Memory OpenCL objects
    objects_view.png
  • etc

and much more.

You can find more about it in our Users Guide.

 

 

Thanks and sorry for the temporary inconvenience,

Ofir Cohen

ABoxe
Beginner
182 Views

Thanks, Guys. I wish I had known about this issue before.

How about having a publicly accessible issue tracker, so that we can see what's broken.

Also, do you have a ballpark time for the next release?

 
@Ofir thanks for the info about the api debugger : I had not been using it, but I will start once this issue is fixed.

 

Cheers,

Aaron

 

 

Reply