python调用gpu amd,在AMD GPU中将Python + Theano与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.

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.

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

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.

What am I doing wrong?

解决方案

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

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.

See:

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 :)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值