【发布时间】:2019-10-13 06:33:21
【问题描述】:
我正在尝试使用 Radeon R9 270x garphics 卡并使用 amdgpu 19.30 驱动程序在 Ubuntu 18.04 上设置 pyopencl。
import pyopencl as cl
import numpy as np
platform = cl.get_platforms()[0]
platform_info = platform.get_info(cl.platform_info.VENDOR)
platform_version = platform.get_info(cl.platform_info.VERSION)
device = platform.get_devices()[0]
device_info = device.get_info(cl.device_info.VENDOR)
device_version = device.get_info(cl.device_info.VERSION)
context = cl.Context([device])
queue = cl.CommandQueue(context, device)
每当我尝试运行上述代码时,它都无法创建 CommandQueue 并出现以下错误
Traceback (most recent call last):
File "example.py", line 13, in <module>
queue = cl.CommandQueue(context, device)
pyopencl._cl.RuntimeError: CommandQueue failed: OUT_OF_HOST_MEMORY
为了安装 pyopencl,我使用了他们的 install page 中的说明,并按照 AMD here 中的说明并使用旧版 OpenCL 通过 amdgpu 驱动程序安装了 OpenCL。
我认为我安装 OpenCL 的方式没有问题,因为platform_version 给了我'OpenCL 2.1 AMD-APP (2906.7)' 和device_version 给了我'OpenCL 1.2 AMD-APP (2906.7)',正如预期的那样。
有人知道发生了什么吗?
【问题讨论】:
-
我不熟悉 Python 绑定,但如果可以,我会尝试用纯 C 语言重现该问题。如果它在那里有效,则说明您的 Python 绑定或 Python 进程有些问题本身就是造成问题的原因。如果 C 版本以同样的方式失败,则可能是 OpenCL 方面有问题。