【发布时间】:2020-10-30 18:02:28
【问题描述】:
我正在尝试使用/测试对 CuPy (8.1.0) 的(实验性)AMD GPU 支持。简而言之:我有一个ImportError。
- 我按照说明在 Ubuntu 焦点机器上安装 ROCm(使用 gfx906/Radeon VII (Vega 20) 卡)。
- 从doc 我设置了提到的变量(调整了
HCC_AMDGPU_TARGET),ROCM_HOME和export PATH=$PATH:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin。 -
pip3 install -v --no-cache-dir cupy成功,没有任何抱怨。由于-v选项,只有一些编译器注释和警告 - 现在,当我尝试导入 cupy 时,它会抛出
ImportError。
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/
【问题讨论】:
-
在构建 CuPy 之前是否安装了
hipcub和rocprim?它们是必需的依赖项。 -
是的。我
apt-get installed 来自文档的完整行。后来exported 变量并执行pip3行。全部作为“用户”root(我有我的理由为什么(这里)我不使用 sudo) -
如果您能找到一种方法在此处发布完整的安装日志(
pip3 install -v ...的输出),那就太好了。要尝试的另一件事是克隆 v8 分支,然后从源代码git clone -b v8.1.0 https://github.com/cupy/cupy.git; cd cupy; pip3 install -v .构建,只是看看它是否是 PyPI 上的 sdist 的问题。 -
(顺便说一句,这些天我是支持 CuPy 的 ROCm 的主要驱动力)
-
@LeoFang 我将请求的日志上传到我们的 seafile 文件夹。我稍后会尝试你的 git 方法