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

Getting "terminate called after throwing an instance of 'cl::Error' what(): clCreateContext" as output

Gunjal_S_
Beginner
1,301 Views

My code for creating context in c++

.........................................................................................................

vector< cl::Platform> platforms;
cl::Platform::get(&platforms); //get available OpenCL platforms (=SDKs)

vector<cl::Device> devices;
platforms[0].getDevices(CL_DEVICE_TYPE_ALL, &devices); //get OpenCL devices from first platform

cl::Context context(devices); //create a context for these devices

...........................................................................................................................

I'm getting

terminate called after throwing an instance of 'cl::Error'
  what():  clCreateContext
Aborted (core dumped)

on output.

Please, tell what I need to do to fix it.

I've install intel opencl sdk for ubuntu 14.04 64-bit

0 Kudos
4 Replies
Robert_I_Intel
Employee
1,301 Views

Hi Gunjal,

Could you try to build and run the following https://software.intel.com/en-us/articles/caps-basic and let me know whether you are able to run it and what the output is?

Thanks!

0 Kudos
Gunjal_S_
Beginner
1,301 Views

This was my output on capsbasic:

Number of available platforms: 1
Platform names:
    [0] Intel(R) OpenCL [Selected]
Number of devices available for each type:
    CL_DEVICE_TYPE_CPU: 1
    CL_DEVICE_TYPE_GPU: 0
    CL_DEVICE_TYPE_ACCELERATOR: 0

*** Detailed information for each device ***

CL_DEVICE_TYPE_CPU[0]
    CL_DEVICE_NAME: Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz
    CL_DEVICE_AVAILABLE: 1
    CL_DEVICE_VENDOR: Intel(R) Corporation
    CL_DEVICE_PROFILE: FULL_PROFILE
    CL_DEVICE_VERSION: OpenCL 1.2 (Build 43)
    CL_DRIVER_VERSION: 1.2.0.43
    CL_DEVICE_OPENCL_C_VERSION: OpenCL C 1.2
    CL_DEVICE_MAX_COMPUTE_UNITS: 2
    CL_DEVICE_MAX_CLOCK_FREQUENCY: 2930
    CL_DEVICE_MAX_WORK_GROUP_SIZE: 8192
    CL_DEVICE_ADDRESS_BITS: 64
    CL_DEVICE_MEM_BASE_ADDR_ALIGN: 1024
    CL_DEVICE_MAX_MEM_ALLOC_SIZE: 1009998848
    CL_DEVICE_GLOBAL_MEM_SIZE: 4039995392
    CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 131072
    CL_DEVICE_GLOBAL_MEM_CACHE_SIZE: 3145728
    CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE: 64
    CL_DEVICE_LOCAL_MEM_SIZE: 32768
    CL_DEVICE_PROFILING_TIMER_RESOLUTION: 1
    CL_DEVICE_IMAGE_SUPPORT: 1
    CL_DEVICE_ERROR_CORRECTION_SUPPORT: 0
    CL_DEVICE_HOST_UNIFIED_MEMORY: 1
    CL_DEVICE_EXTENSIONS: cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_fp64
    CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT: 1
    CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG: 1
    CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT: 1
    CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: 1
    CL_DEVICE_NATIVE_VECTOR_WIDTH_INT: 4
    CL_DEVICE_NATIVE_VECTOR_WIDTH_LONG: 2
    CL_DEVICE_NATIVE_VECTOR_WIDTH_FLOAT: 4
    CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE: 2

 

0 Kudos
Gunjal_S_
Beginner
1,301 Views

When I downloaded opencl sample codes from this link of intel for opencl 1.2 for linux

https://software.intel.com/en-us/intel-opencl-support/code-samples

and ran one sample code of BitonicSort, it shows this output

Platforms (1):
    [0] Intel(R) OpenCL [Selected]
Devices (1):
    [0] Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz [Selected]
[ ERROR ] Sample application specific error: OpenCL error CL_DEVICE_NOT_AVAILABLE happened in file ../intel_ocl_samples_linux/common/oclobject.cpp at line 447.

Does this mean that my CPU is not compatible?

Or Do I need to install some drivers?

Please suggest me what to do now.

0 Kudos
Robert_I_Intel
Employee
1,301 Views

Hi Gunjal,

Your processor was released in Q1'2009 and is not supported by the CPU runtime. I think you will need to upgrade your hardware. One last thing that you could try is to install standalone CPU driver from here https://software.intel.com/en-us/articles/opencl-drivers#lin64 - it wasn't designed for Ubuntu, but you maybe able to install it and try it. However, your mileage may vary, since your processor is fairly old.

Sorry that I don't have a more encouraging answer for you.

0 Kudos
Reply