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.
1719 Discussions

In some cases opencl runtime can't create context in DLL

Tar__Alex
Beginner
412 Views

I try create some DLL based opencl for working with MATLAB. Function clCreateContext can't create context when it called from DLL used from MATLAB (I try a function clCreateContextFromType too). Return error -6 (CL_OUT_OF_HOST_MEMORY), but at this moment task manager show more than 1.5 GB memory is free.

It is strange but if I use this DLL with Intel platform from VisualStudio or from Excel all is working.

This DLL is working with MATLAB when I use another platform (AMD on the same machine or Nvidia on another machine).

The system is CPU Intel Core i5 660, RAM 4 GB, Windows 7 64-bit, MATLAB 8.3 64 bit, Intel SDK 4.4.0.117, Intel OpenCL runtime for CPU 4.5.0.5 (I check this on runtime 4.4.0.117 doesn't work too), AMD APP SDK 2.9.599.381, Nvidia version I can't remember (I think something latest).

I attached little project for VisualStudio 2013. This project write error code in windows application event log. In archive also include matlab.m file.

0 Kudos
2 Replies
Yuri_K_Intel
Employee
412 Views
Hi Alex, It is kind of known problem (I hope), see this thread https://software.intel.com/en-us/forums/topic/518064 for more information. In short -TBB DLLs that MATLAB ships are older than required by Intel OpenCL runtime. But in your case (Windows OS) resolution would be slightly different - you need to update TBB DLLs that ship with MATLAB: "C:\Program Files\MATLAB\R2014a\bin\win64\tbb.dll" "C:\Program Files\MATLAB\R2014a\bin\win64\tbbmalloc.dll" to the latest ones - https://www.threadingbuildingblocks.org/download (or at least to the ones that ship with Intel OpenCL runtime). TBB team strictly keeps backward compatibility, so there should not be any issues in doing so. Thanks, Yuri
0 Kudos
Tar__Alex
Beginner
412 Views

Hi Yuri,

Thank you, this method is working.

Все получилось :-)

С уважением, Алексей!

0 Kudos
Reply