gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 16:49:59 35 4
gpt4 key购买 nike

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

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com