在AMD GPU中将Python + Theano与OpenCL一起使用 [英] Using Python+Theano with OpenCL in an AMD GPU

查看:253
本文介绍了在AMD GPU中将Python + Theano与OpenCL一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Python与Theano一起使用OpenCL来加速一些代码.我按照指示安装了libgpuarraypygpu(我认为),但没有错误.安装检测到已安装OpenCL运行时.

I'm trying to use Python with Theano to accelerate some code with OpenCL. I installed libgpuarray and pygpu as instructed (I think), and got no errors. The installation detected the OpenCL runtime installed.

我只是不能运行OpenCL的Theano示例,主要是因为我不知道如何指定我的GPU.根据inxi,我的GPU是Radeon HD 5340/5450/5470. Theano文档中的所有代码都使用device=cuda0,并且是唯一提到OpenCL的地方,它表示device=openclN,其中N是数字.

I just cannot run the Theano example for OpenCL, mainly because I don't know how to specify my GPU. My GPU is a Radeon HD 5340/5450/5470, according to inxi. All code in the Theano documentation uses device=cuda0 and the only place where OpenCL is mentioned, it says device=openclN where N is a number.

我尝试了device=opencl0,并得到了一个pygpu错误,说正确的格式是opencl<int>:<int>.此后,我尝试了任意数量的数字组合(opencl0:0等),并且始终尝试使用GpuArrayException: Unknown error.

I tried device=opencl0 and got a pygpu error saying that the correct format is opencl<int>:<int>. I have since tried any number of combinations of numbers (opencl0:0 and such), and always an GpuArrayException: Unknown error.

我的系统是Ubuntu 14.04 x64,硬件是15英寸的东芝Satellite.我用pip安装了Theano,后来按照其网站上的说明安装了libgpuarray.

My system is Ubuntu 14.04 x64 and my hardware is a Toshiba Satellite, 15". I installed Theano with pip, and later installed libgpuarray following the instructions on their site.

我在做什么错了?

推荐答案

opencl0:0是正确的.您可以确认pyopencl是否有效吗?您的opencl(或驱动程序/cl编译器)可能有问题.

opencl0:0 is correct. Could you confirm that pyopencl works? You may have a problem with your opencl (or drivers/cl compiler).

但是,我认为Theano目前无法与OpenCL一起使用.当前状态是部分支持,足以支持"hello world",但不足以运行任何重要代码.

However, I think Theano does not quite work with OpenCL at the moment. The current state is there is partial support, enough for "hello world", but not enough to run any significant code.

请参阅:

https://github.com/Theano/Theano/issues/2189

https://github.com/Theano/Theano/issues/1471

https://github.com/Theano/Theano/issues/2190

https://github.com/Theano/Theano/pull/1732

总而言之,不,大多数内容都不会移植(例如,包括Elemwise,这是常见操作).我真的很想在OpenCL上看到Theano.对于AMD来说,这将是一件很棒的事情.很快:)

To summarize, no, most stuff is not ported (including Elemwise, for example, which is a common op). I would really like to see Theano on OpenCL though. That would be a great thing for AMD to pitch in on. Soon :)

这篇关于在AMD GPU中将Python + Theano与OpenCL一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆