前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >PyCUDA - Ubuntu14.04安装及测试

PyCUDA - Ubuntu14.04安装及测试

作者头像
AIHGF
发布2019-02-18 10:46:24
1.2K0
发布2019-02-18 10:46:24
举报
文章被收录于专栏:AIUAI

PyCUDA - Ubuntu14.04安装及测试

安装

  • 依赖 Numpy
  • 直接安装
代码语言:javascript
复制
sudo apt install python-pycuda
  • 源码安装:

Step 1 下载并解压 PyCUDA

代码语言:javascript
复制
$ wget http://pypi.python.org/pypi/pycuda
$ tar xfz pycuda-VERSION.tar.gz

Step 2 编译PyCUDA

代码语言:javascript
复制
$ cd pycuda-VERSION # if you're not there already
$ python configure.py --cuda-root=/where/ever/you/installed/cuda
$ su -c "make install"

测试

e.g. 1

代码语言:javascript
复制
$ cd pycuda-VERSION/test
$ python test_driver.py

输出 OK 即成功.

e.g. 2

代码语言:javascript
复制
$ cd pycuda-VERSION/examples
$ python test_demo.py

e.g. 3

代码语言:javascript
复制
import pycuda.autoinit
import pycuda.driver 

free_bytes, total_bytes = pycuda.driver.mem_get_info() # 查询当前显卡的总显存,可用显存

文档

官方文档

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017年07月07日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • PyCUDA - Ubuntu14.04安装及测试
    • 安装
      • Step 1 下载并解压 PyCUDA
      • Step 2 编译PyCUDA
    • 测试
      • e.g. 1
      • e.g. 2
      • e.g. 3
    • 文档
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档