My Linux system has both Intel i7 CPU and Nvidia Geforce GPU, and both work fine as OpenCL platforms outside of matlab mex modules.
But when compiled and run as a Matlab MEX module only the Nvidia OpenCL Platform will show up, and clGetPlatformIds will return just one platform (the nvidia one).
Using the current Intel OpenCL release ( 4.4.0.117 ) in combination with Matlab R2012b on openSUSE 2012.2.
The same problem exists when using the inofficial Matlab OpenCL Toolbox:
wiki
download
To replicate:
- unzip, fix path for OpenCL headers and libOpenCL in make.m
- run matlab and go to directory with make.m, then type:
- make
- opencl_info = opencl()
- opencl_info.platforms
The libOpenCL loaded during matlab mex execution is the current libOpenCL by Intel. Both ICDs are where they should be within /etc/OpenCL/vendors.
The OP in this thread has the same problem:
http://stackoverflow.com/questions/24602945/opencl-and-mex-files-error/24701285
Thank you for any suggestions.