在 Ubuntu 中对一组 Python 程序进行 nosetests 时发生错误:
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
如何修复它?
最佳答案
您似乎安装了 pyopencl,但没有安装实际的设备驱动程序。请参阅 https://documen.tician.de/pyopencl/misc.html 处的文档.
下面是对这种行为的描述:
Note that PyOpenCL is no fun (i.e. cannot run code) without an OpenCL device driver (a so-called “ICD”, for “installable client driver”) that provides access to hardware through OpenCL. If you get an error message like pyopencl.cffi_cl.LogicError: clGetPlatformIDs failed: , that means you have no OpenCL drivers installed.
基本上,下一个命令应该足以让它在 CPU 上运行:
[pip]conda install pocl
要正确安装 AMD 和 Nvidia 设备,请查找供应商提供的 OpenCL 驱动程序。
关于ubuntu - Python 逻辑错误 : clGetPlatformIDs failed: platform not found khr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11990131/