ubuntu - Python 逻辑错误 : clGetPlatformIDs failed: platform not found khr

标签 ubuntu pyopencl

在 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/

相关文章:

linux - fatal error : aux. h 没有这样的文件或目录 (Ubuntu)

python - pyOpenCL 和 2D FFT

opencl - 可以优化此 OpenCL 代码吗?

ruby-on-rails - 远程服务器上的 Postgres 语言环境错误

php - ' fatal error 无法创建锁定文件 : Bad file descriptor (9)' while running php artisan server

linux - Java 在 Windows 上播放音频,但在 Ubuntu 上不播放

c - OpenCL/C pow(x,0.5) != sqrt(x)

php - 如果 Composer 在我的 Web 服务器根目录之外,如何包含它的自动加载?

python - 将向量 (float4) kernell 参数传递给 OpenCL (Python)

python - PyOpenCL 入门