OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
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.
1687 Discussions

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


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, Intel OpenCL runtime for CPU (I check this on runtime 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
Hi Alex, It is kind of known problem (I hope), see this thread 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 - (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

Hi Yuri,

Thank you, this method is working.

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

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