前端之家收集整理的这篇文章主要介绍了
PyCUDA - Ubuntu14.04安装及测试,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
PyCUDA - Ubuntu14.04安装及测试
安装
@H_
404_10@
sudo apt install python-pycuda
@H_
403_18@Step 1 下载并解压
PyCUDA
@H_
404_10@$ wget http://pypi
.python.org/pypi/pycuda
$ tar xfz pycuda-VERSION
.tar.gz
Step 2 编译PyCUDA
@H_
404_10@$ cd pycuda-VERSION #
if you
're not there already
$ python configure.py
$ su -c
"make install"
测试
e.g. 1
@H_
404_10@
$ cd pycuda-
VERSION/test
$ python test_driver.py
输出 OK 即成功.
e.g. 2
@H_
404_10@
$ cd pycuda-
VERSION/examples
$ python test_demo.py
e.g. 3
@H_
404_10@
import pycuda.autoinit
import pycuda.driver
free_bytes,total_bytes = pycuda.driver.mem_get_info()
文档
官方文档