- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我在 Windows 10 上运行 python 3.5.4 通过 Anaconda 和来自 conda-forge 的 pyopencl 2017.2,通过 Anaconda 安装。我的系统是i5 4670K,运行驱动版本是R9 29017.11.1 与 OpenCL 版本23.20.788.0.
尝试导入 pyopencl 模块时遇到以下错误
>>> import pyopencl as cl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "[my home folder]\Anaconda3\lib\site-packages\pyopencl\__init__.py", line 37, in <module>
import pyopencl.cffi_cl as _cl
File "[my home folder]\Anaconda3\lib\site-packages\pyopencl\cffi_cl.py", line 39, in <module>
from pyopencl._cffi import ffi as _ffi
ImportError: DLL load failed: The specified module could not be found.
错误似乎是在加载 _cffi.pyd
时发生的。此错误与之前线程中显示的问题有相似之处:
cffi load failure when trying to import PyOpenCL
pyopencl import error cffi.so undefined symbol
然而,尽管安装完成(看似)没有错误,但我从 AMD 和 Intel 安装 OCL SDK:s 时问题仍然存在。我还更新了我的显卡驱动程序。
我尝试使用 Dependency Walker 检查 _cffi.pyd
的依赖项,如以下线程中所述:
Python pyopencl DLL load failed even with latest drivers
这确实在 opencl.dll
下出现了很多循环依赖和缺失的依赖,名称以 API-MS-WIN
和 EXT-MS-获胜
。重命名 /System32
中的 opencl.dll
并改用 \Anaconda3\Library\bin
中的文件时,依赖项错误仍然存在。
经过一番搜索,我发现了这个主题:
Dependency Walker: missing dlls
这基本上说明缺少的依赖项无需担心。
最佳答案
我也遇到了这个问题,我的研究使我找到了帮助安装兼容版本的文档:https://media.readthedocs.org/pdf/mot/master/mot.pdf
错误是因为您没有适用于 AMD 或 Intel 的 pyopencl 和 opencl 驱动程序的兼容版本。
引用:
Installing a precompiled binary wheel (.whl) is the easiest way to install PyOpenCL, but only works if the wheel is compiled for your specific Python implementation. At Christoph Gohlke website (http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl) you can find a range of PyOpenCL binary packages. If there is a compatible one for your system, download that version. You can see if it is compatible if the Python version and OpenCl version in the binary name matches that of your installed Python and driver supported versions. Note that many drivers, such as nVIDIA’s only support OpenCL 1.2, so in that case take the wheel with “+cl12” in the name, and not e.g. “+cl21”. For example if you have 64-bit Windows system with Python 3.5 and your GPU or CPU drivers support OpenCL 1.2 you need to download the wheel with “+cl12”,
win-amd64
and cp35m in the name (note the format, cp<version>m, the m is important). (To check which Python version you have you can runpython --version
in the command line).
这对你有帮助
关于python - pyopencl 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47161850/
以下代码向我发出警告“警告:将'__global int'传递给'__global int *'类型的参数时不兼容的整数到指针转换;使用&获取地址”并且不会产生所需的结果。 import pyopen
我使用以下命令来分析我的 Python 代码: python2.7 -m cProfile -o X2_non_flat_multiprocessing_dummy.prof X2_non_flat.
我刚刚开始通过 PyOpenCL 学习 OpenCL,并且一直在关注一些教程。我正在编写脚本 here 。程序执行时没有任何错误,但数组的求和不正确。这是确切的代码: # Use OpenCL To
我有使用 PyOpenCL 进行多维数组加法的代码。我的问题是,除了第一个维度之外,其他维度的结果都是错误的。我一直在咨询这个Link。 from __future__ import absolute
我正在 python 中尝试 OpenCl,但无法弄清楚这个简单的矩阵复制代码我做错了什么。 我的输入矩阵是: [[1 2 3 4], [5 6 7 8], [9 10 11 12], [13 14
我对 https://github.com/inducer/pyopencl/blob/master/examples/benchmark-all.py 中的标准代码进行了一些修改 用数字代替,变量z
我试图将代码的内核部分与 3 个“””存储在不同的文件中。我尝试将其另存为文本文件和 bin 文件,然后读入,但我没有用它找不到成功。它开始给我一个错误,说“””丢失,或者)丢失。 “但是,如果我只是
在运行程序时..错误是 Choose platform: [0] [1] Choice [0]:1 设置环境变量 PYOPENCL_CTX='1' to avoid being asked aga
问题描述 我正在尝试在 Anaconda 中将 pyopencl 与我的 GPU 结合使用。但是没有找到设备。在 Python 中,我得到以下输出: >>> import pyopencl as cl
我在 Windows 10 上运行 python 3.5.4 通过 Anaconda 和来自 conda-forge 的 pyopencl 2017.2,通过 Anaconda 安装。我的系统是i5
我最近发现了 GP-GPU(通用图形处理单元)的强大功能,并想利用它在单台机器上执行“繁重”的科学和数学计算(否则需要大型 CPU 集群)。 我知道有多种接口(interface)可以在 GPU 上运
我有 PyOpenCL 代码和 OpenCL C 内核代码。我在运行我的应用程序时捕获了段错误。如何使用某些调试器或其他开发工具来调试此类错误?我不知道到底该怎么做才能找出问题所在。我想到了 prin
我正在将模拟移动到 pyOpenCL 中,但无法使我的数据访问正常工作。我正在尝试提供一维向量数组(嗯,实际上有几个,但我包含的示例只使用了一个)。 目前,几个向量被复制得很好,但是数据根本不是我提供
我已经获得了提供的 OpenCL 内核以在 C 环境中执行,但是当我尝试使用 PyOpenCL 和提供的代码运行它时,出现以下错误: > Traceback (most recent call las
我有一段内核源代码,可以在我的 PC 上的 G970 上运行,但无法在我的 2015 年初配备 Iris 6100 1536MB 显卡的 MacBook pro 上编译。 platform = cl.
更新:我的内核中的 int4 是错误的。 我正在使用 pyopencl,但无法使结构对齐正常工作。在下面的代码中,调用内核两次,b 值正确返回(如 1),但 c 值具有一些“随机”值。 换句话说:我正
我正在尝试使用 pyOpenCL 填充二维数组。计算内核及其调用贴在下面: ctx = cl.Context([cl.get_platforms()[0].get_devices()[0]]) que
我想使用来自 OpenCL API 函数的 global_work_offset 参数 clEnqueueNDRangeKernel .我不知道如何在 pyopencl 中做到这一点应用程序接口(in
我想用另一个数组覆盖 PyOpenCL 数组的一部分。这么说吧 import numpy as np, pyopencl.array as cla a = cla.zeros(queue,(3,3),
我正在尝试安装 PyOpenCL在 Ubuntu 16.04 上,但出现以下错误: /usr/bin/ld: cannot find -lOpenCL collect2: error: ld retu
我是一名优秀的程序员,十分优秀!