1

I am using a microsoft azure notebook to write a PyOpenCL code, and am using windows 10 with Intel i7-4770K CPU processor.

I managed to install PyOpenCL library, but it throws the error "clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR" when I write the code:

cl.create_some_context()

I am guessing no context is being found, so I followed the PyOpenCL documentation which says I need to install the CPU OpenCL driver from Intel from this link: https://software.intel.com/en-us/articles/opencl-drivers#latest_CPU_runtime

And this is the most confusing page I have ever come across. I am not sure what exactly I am supposed to download and install here. Could someone please help me out?

This is my code:

import pyopencl as cl
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)

And it throws this error: LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR

I install PyOpenCL using this code:

import sys
!{sys.executable} -m pip install pyopencl
digeridoo
  • 103
  • 1
  • 9

2 Answers2

1

Using regular OpenCL doesn't need any special Intel driver. Its packaged with production drivers. Please show the code inside "create_some_context()". You must be doing a clIcdGetPlatformIDsKHR (which requires a device with the cl_khr_icd extension), instead of a regular clGetPlatformIDs. Your device likely doesn't have cl_khr_icd support. https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/cl_khr_icd.html

Hashman
  • 367
  • 1
  • 10
  • Hi, I added the code I used which creates this error. It's a simple enough code and uses create_some_context from the PyOpenCL library which I import – digeridoo Dec 22 '19 at 22:54
0

A solution that worked for me after I got the same error message:

conda install -c conda-forge pocl

This answer is strongly inspired by the solution provided here: Python LogicError: clGetPlatformIDs failed: platform not found khr

Ngrigri
  • 73
  • 1
  • 4