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.

pyopencl.RuntimeError : device not available

Teddy_C_
Beginner
1,389 Views

Hi All,

We have a DELL server PowerEdge M600 with Intel Xeon processor E5450 @ 3.00 GHz running RedHat RHEL6 [2.6.32-573.7.1.el6.x86_64] on 64bit platform.

ruby and redhat-lsb-core have been installed.

Has downloaded ocl-icd-2.2.7.tar.gz, untarred and built successfully.

opencl_runtime_15.1_x64_5.0.0.57.tgz has been installed successfully too.

when running a simple python script:

import pyopencl
pyopencl.create_some_context()

 

will always get this error message:

Choose platform:
[0] <pyopencl.Platform 'Intel(R) OpenCL' at 0x1691680>
Choice [0]:
Set the environment variable PYOPENCL_CTX='' to avoid being asked again.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/test/pyopencl/__init__.py", line 886, in create_some_context
    return Context(devices)
pyopencl.RuntimeError: Context failed: device not available

 

 

This problem does not occur on other Dell poweredge server with E5xxx processor.

Anyone has a clue and solution to this?

 

0 Kudos
6 Replies
Robert_I_Intel
Employee
1,389 Views

Hi Teddy,

Could you download and run the following very basic OpenCL sample: https://software.intel.com/en-us/articles/caps-basic ? Please post the output to this forum. Just want to make sure that your OpenCL is actually installed properly.

0 Kudos
Teddy_C_
Beginner
1,389 Views
Hi Robert,
 
Thanks for your post/reply.
I have downloaded from the link you gave for Linux platform.
 
This is the result when i ran './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) Xeon(R) CPU           E5450  @ 3.00GHz
    CL_DEVICE_AVAILABLE: 1
    CL_DEVICE_VENDOR: Intel(R) Corporation
    CL_DEVICE_PROFILE: FULL_PROFILE
    CL_DEVICE_VERSION: OpenCL 1.2 (Build 57)
    CL_DRIVER_VERSION: 1.2.0.57
    CL_DEVICE_OPENCL_C_VERSION: OpenCL C 1.2
    CL_DEVICE_MAX_COMPUTE_UNITS: 8
    CL_DEVICE_MAX_CLOCK_FREQUENCY: 3000
    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: 8417054720
    CL_DEVICE_GLOBAL_MEM_SIZE: 33668218880
    CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE: 131072
    CL_DEVICE_GLOBAL_MEM_CACHE_SIZE: 6291456
    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
Robert_I_Intel
Employee
1,389 Views

Hi Teddy,

I am suspecting that what's happening is that you are by default trying to select a GPU device, which is not available for your platform. Try to explicitly select a CPU device:

import pyopencl as cl

platform = cl.get_platforms()[0]

device = platform.get_devices()[0]

print(device)

Let me know if that worked for you.

0 Kudos
Teddy_C_
Beginner
1,389 Views

Hi Robert,

Thanks for the codes, it works.

But its strange that the previous codes dont work on that particular machine, others are fine.

0 Kudos
Tony_C_
Beginner
1,389 Views

Dear all.

I have the same problem and i can't find a solution.

Screenshot_2.pngScreenshot_1.png

0 Kudos
Jeffrey_M_Intel1
Employee
1,389 Views

The first thing to check is that OpenCL is installed and working.  

You can try the OpenCL CapsBasic sample: https://software.intel.com/en-us/articles/caps-basic 

This processor does not contain an Intel integrated graphics GPU, so you will need to select a CPU device.

The implementation of pyopencl is a bit out of our scope, but we can help with getting OpenCL going.

0 Kudos
Reply