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

OpenCL for CPU is installed, but OpenCL cannot find CPU

Josh_M
Novice
1,313 Views

Computer is Dell laptop with 11th generation core vpro i5 CPU.

I have downloaded and installed what I believe is the latest OpenCL for CPU (w_opencl_runtime_p_2024.0.0.49848).

Using PyOpenCl, however, only 1 platform (Intel(R) OpenCL Graphics) and 1 device (Intel(R) Iris(R) Xe Graphics) can be found.

So, if the driver is installed (at C:\Program Files (x86)\Common Files\Intel\Shared Libraries\), why can't OpenCl find it? Any idea how can I fix this?

Thanks!

Labels (2)
0 Kudos
1 Solution
Josh_M
Novice
1,249 Views

Hi! Sorry, I think I fixed it.

 

For some reason, the OpenCl for CPU standalone version wasn't working, so I tried downloading the oneAPI base toolkit (specifically, just the DPCC++ compiler) which comes with the newer version. And now my system is detecting the CPU

 

Thanks!

View solution in original post

0 Kudos
5 Replies
cw_intel
Moderator
1,284 Views

Hi,

Can you provide us the following information?

1. Please provide your test code.

2. Can you try building your code without pyopencl? Then let us know whether the code can find the CPU. 

3. Please set the environment available OCL_ICD_ENABLE_TRACE=1, and run your code, then tell us the output information. 

 

Thanks.

0 Kudos
Josh_M
Novice
1,253 Views

Hi! Thanks for the prompt reply!

1. Please provide your test code.

The code I'm working with is a bit too long and bulky to provide, sorry - but this code, that I found online, also shows the number of OpenCl platforms and devices:

 

#
# Display Device Information
#
# Script to print out some information about the OpenCL devices
# and platforms available on your system
#
# History: C++ version written by Tom Deakin, 2012
# Ported to Python by Tom Deakin, July 2013
#

# Import the Python OpenCL API
import pyopencl as cl

# Create a list of all the platform IDs
platforms = cl.get_platforms()

print("\nNumber of OpenCL platforms:", len(platforms))

print("\n-------------------------")

# Investigate each platform
for p in platforms:
# Print out some information about the platforms
print("Platform:", p.name)
print("Vendor:", p.vendor)
print("Version:", p.version)

# Discover all devices
devices = p.get_devices()
print("Number of devices:", len(devices))

# Investigate each device
for d in devices:
print("\t-------------------------")
# Print out some information about the devices
print("\t\tName:", d.name)
print("\t\tVersion:", d.opencl_c_version)
print("\t\tMax. Compute Units:", d.max_compute_units)
print("\t\tLocal Memory Size:", d.local_mem_size/1024, "KB")
print("\t\tGlobal Memory Size:", d.global_mem_size/(1024*1024), "MB")
print("\t\tMax Alloc Size:", d.max_mem_alloc_size/(1024*1024), "MB")
print("\t\tMax Work-group Total Size:", d.max_work_group_size)

# Find the maximum dimensions of the work-groups
dim = d.max_work_item_sizes
print("\t\tMax Work-group Dims:(", dim[0], " ".join(map(str, dim[1:])), ")")

print("\t-------------------------")

print("\n-------------------------")


And it provides the output:

Number of OpenCL platforms: 1

-------------------------
Platform: Intel(R) OpenCL Graphics
Vendor: Intel(R) Corporation
Version: OpenCL 3.0
Number of devices: 1
-------------------------
Name: Intel(R) Iris(R) Xe Graphics
Version: OpenCL C 1.2
Max. Compute Units: 80
Local Memory Size: 64.0 KB
Global Memory Size: 6304.55078125 MB
Max Alloc Size: 3152.275390625 MB
Max Work-group Total Size: 512
Max Work-group Dims:( 512 512 512 )
-------------------------

-------------------------


--

 2. Can you try building your code without pyopencl? Then let us know whether the code can find the CPU. 

I'm going to be honest with you, I know very little about building code with opencl at all; The original aim here is to run some python code I've found in the literature (I'm a researcher), and when I tried to run it as is, it turned out my GPU was apparently incapable of calculating double point precision; the reason I'm trying to get OpenCL for CPU working is to test it on my CPU. Sorry that that makes this a bit more complicated...

3. Please set the environment available OCL_ICD_ENABLE_TRACE=1, and run your code, then tell us the output information. 

 


There was no change to the above output when I made this change, unfortunately.

0 Kudos
Josh_M
Novice
1,250 Views

Hi! Sorry, I think I fixed it.

 

For some reason, the OpenCl for CPU standalone version wasn't working, so I tried downloading the oneAPI base toolkit (specifically, just the DPCC++ compiler) which comes with the newer version. And now my system is detecting the CPU

 

Thanks!

0 Kudos
cw_intel
Moderator
1,231 Views


We tested on our end based on your description. It looks like that there are some files are missing in the OpenCL CPU RT standalone installation package. We will fix it.


Thanks.


0 Kudos
cw_intel
Moderator
972 Views

Hi,


The issue will be fixed in the next release. Please see the page (https://www.intel.com/content/www/us/en/developer/articles/technical/intel-cpu-runtime-for-opencl-applications-with-sycl-support.html ) for the workarounds for 2024.0 version.




Thanks


0 Kudos
Reply