我正在尝试将 Python 与 Theano 结合使用,以通过 OpenCL 加速某些代码。我安装了libgpuarray
and pygpu
按照指示(我认为),并且没有错误。安装检测到已安装 OpenCL 运行时。
我只是无法运行 OpenCL 的 Theano 示例,主要是因为我不知道如何指定我的 GPU。我的 GPU 是Radeon HD 5340/5450/5470
, 根据inxi
。 Theano 文档中的所有代码都使用device=cuda0
唯一提到 OpenCL 的地方,它说device=openclN
where N
是一个数字。
I tried device=opencl0
并得到了一个pygpu
错误说正确的格式是opencl<int>:<int>
。此后我尝试了任意数量的数字组合(opencl0:0
等等),并且总是GpuArrayException: Unknown error
.
我的系统是 Ubuntu 14.04 x64,我的硬件是 Toshiba Satellite,15"。我安装了Theano
with pip
,后来安装了libgpuarray
按照其网站上的说明进行操作。
我究竟做错了什么?
opencl0:0 是正确的。您能确认 pyopencl 有效吗?您的 opencl (或 drivers/cl 编译器)可能有问题。
然而,我认为 Theano 目前还不能很好地与 OpenCL 配合使用。目前的状态是有部分支持,足以支持“hello world”,但不足以运行任何重要的代码。
See:
https://github.com/Theano/Theano/issues/2189 https://github.com/Theano/Theano/issues/2189
https://github.com/Theano/Theano/issues/1471 https://github.com/Theano/Theano/issues/1471
https://github.com/Theano/Theano/issues/2190 https://github.com/Theano/Theano/issues/2190
https://github.com/Theano/Theano/pull/1732 https://github.com/Theano/Theano/pull/1732
总而言之,不,大多数东西都没有被移植(例如,包括 Elemwise,这是一个常见的操作)。不过,我真的很想在 OpenCL 上看到 Theano。对于 AMD 来说,这将是一件好事。很快 :)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)