Python LogicError: clGetPlatformIDs failed: platform not found khr

When testing the nose for a set of Python programs in Ubuntu, an error occurs:

devices = [ d for d in cl.get_platforms()[0].get_devices() if
LogicError: clGetPlatformIDs failed: platform not found khr


File "/home/fateeva/prog/deflectometry/SGMFMeasurement/_PhaseShifts.py", line 30, in <module>
    devices = [ d for d in cl.get_platforms()[0].get_devices() if
LogicError: clGetPlatformIDs failed: platform not found khr

How can this be fixed?

+5
source share
5 answers

this is an error try this:

sudo apt-get install nvidia-settings
sudo nvidia-smi

or run it (without sudo) as root.

After that you can start it.

add

nvidia-smi

in /etc/rc.local (of course, before exiting), so your GPU will be available after each boot.

+2
source

It seems you have pyopencl installed, but there is not a single actual device driver. Please refer to the documentation at https://documen.tician.de/pyopencl/misc.html .

Here is a description of this behavior:

, PyOpenCL ( ) OpenCL ( "ICD", " "), OpenCL. , pyopencl.cffi_cl.LogicError: clGetPlatformIDs failed: , OpenCL.

, :

[pip]conda install pocl

AMD Nvidia OpenCL, .

+2

python script root. cl.get_platforms() root, . , nvidia-modprobe:

sudo apt-get install nvidia-modprobe

0

, OpenCL .

Intel OpenCL Runtime Intel Core Intel Xeon (16.1.1 ). OpenCL ™ Runtime intel. .

: https://youtu.be/AieYqNQ6ADM

0

. :

devices = [ d for d in cl.get_platforms()[0].get_devices(cl.device_type.GPU)]

,

platform = cl.get_platform()
my_devices = platform[0].get_devices(device_type = cl.devices_type.ALL)
print my_devices

, :

context = cl.Context([my_devices[<index>])

, . :

context = cl.Context([my_devices[0])

, . :

pyopencl:

-1

All Articles