【问题标题】:Pycuda test_driver.py raises Attribute ErrorPycuda test_driver.py 引发属性错误
【发布时间】:2016-11-07 00:49:06
【问题描述】:

我正在尝试在安装了 GeForce 960M 和 Cuda 8.0 的 Linux Mint 上安装 pycuda。当我运行 test_driver.py 脚本时,它会输出以下错误:

============================== 测试会话开始 =============== ================ 平台 linux2 -- Python 2.7.12、pytest-3.0.3、py-1.4.31、pluggy-0.4.0 根目录:/home/milton/Downloads/pycuda-2016.1.2,inifile: 收集到 28 个项目

test_driver.py ....................x.......F..

====================================失败=========== ========================= _______________________ TestDriver.test_multi_context _________________________

args = (,), kwargs = {}

pycuda = 初始化.pyc'>

ctx =

clear_context_caches = collect =

def f(*args, **kwargs):
    import pycuda.driver
    # appears to be idempotent, i.e. no harm in calling it more than once
    pycuda.driver.init()

    ctx = make_default_context()
    try:
        assert isinstance(ctx.get_device().name(), str)
        assert isinstance(ctx.get_device().compute_capability(), tuple)
        assert isinstance(ctx.get_device().get_attributes(), dict)
      inner_f(*args, **kwargs)

../../../miniconda2/lib/python2.7/site-packages/pycuda-2016.1.2-py2.7-linux-x86_64.egg/pycuda/tools.py:460:


self =

@mark_cuda_test
def test_multi_context(self):
    if drv.get_version() < (2,0,0):
        return
    if drv.get_version() >= (2,2,0):
      if drv.Context.get_device().compute_mode == drv.compute_mode.EXCLUSIVE:

E AttributeError: type object 'compute_mode' 没有属性 'EXCLUSIVE'

test_driver.py:638: AttributeError ================ 1 次失败,26 次通过,1 次在 6.92 秒内失败 ================

【问题讨论】:

    标签: pycuda


    【解决方案1】:

    python驱动计算模式仅支持以下模式:

    默认, 禁止, EXCLUSIVE_PROCESS

    所以请改一下:

    如果 drv.Context.get_device().compute_mode == drv.compute_mode.独家

    如果 drv.Context.get_device().compute_mode == drv.compute_mode.EXCLUSIVE_PROCESS

    在您的 test_driver.py 文件中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-04
      • 2018-06-08
      • 2020-04-08
      • 1970-01-01
      • 2015-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多