首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AMD上的CuPy导致ImportError

AMD上的CuPy导致ImportError
EN

Stack Overflow用户
提问于 2020-10-30 18:02:28
回答 1查看 439关注 0票数 0

我正在尝试使用/测试CuPy (8.1.0)的AMD支持(实验性)。简而言之:我有一个ImportError

  • 我遵循了在Ubuntu焦点机器上安装ROCm的说明(带有gfx906 906/Radeon VII (Vega 20)卡)。
  • 文档中,我设置了上述变量(带有调整后的HCC_AMDGPU_TARGET)、ROCM_HOMEexport PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin
  • pip3 install -v --no-cache-dir cupy没有任何抱怨就成功了。因为有-v选项,所以只有几个编译器注释和警告
  • 现在,当我试图导入cupy时,它会抛出一个ImportError
代码语言:javascript
复制
In [1]: import cupy                                                                                                                                                                                                                         
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/cupy/__init__.py in <module>
     19             message='can\'t resolve package from __spec__')
---> 20         from cupy import core  # NOQA
     21 except ImportError as e:

/usr/local/lib/python3.8/dist-packages/cupy/core/__init__.py in <module>
----> 1 from cupy.core import core  # NOQA
      2 from cupy.core import internal  # NOQA
      3 

cupy/core/core.pyx in init cupy.core.core()
cupy/core/_routines_manipulation.pyx in init cupy.core._routines_manipulation()
cupy/core/_routines_indexing.pyx in init cupy.core._routines_indexing()
cupy/core/_routines_math.pyx in init cupy.core._routines_math()
cupy/core/_reduction.pyx in init cupy.core._reduction()
cupy/core/_cub_reduction.pyx in init cupy.core._cub_reduction()

ModuleNotFoundError: No module named 'cupy.cuda.cub'

The above exception was the direct cause of the following exception:

ImportError                               Traceback (most recent call last)
<ipython-input-1-329ec5cf1bc8> in <module>
----> 1 import cupy

/usr/local/lib/python3.8/dist-packages/cupy/__init__.py in <module>
     39 original error: {}'''.format(_exc_info[1]))  # NOQA
     40 
---> 41     raise ImportError(_msg) from e
     42 
     43 

ImportError: CuPy is not correctly installed.
If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
  $ pip freeze

If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
  $ pip install cupy --no-cache-dir -vvvv

Check the Installation Guide for details:
  https://docs.cupy.dev/en/latest/install.html

original error: No module named 'cupy.cuda.cub'

我接下来该怎么办?在编译过程中我应该寻找什么?提前感谢

应请求编辑安装过程的完整标准输出和标准输出以及控制台的几个io:https://seafile.cloud.uni-hannover.de/d/68862cd1057e47d180aa/

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-16 06:28:55

总结到目前为止的评论中的讨论:

  • 对于ROCm v8.x (最新的稳定版本):在v8.1之前,cupy.cuda.cub模块不是在ROCm/HIP环境中构建的,希望在v8.2中修复(参见票证)。
  • 对于CuPy v9.x (主分支):只要正确安装了rocPRIM和hipCUB,它就可以工作。可能OP的本地环境没有正确设置,导致cupy.cuda.cub模块未构建,从而导致ImportError
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64613606

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档