[BUG] ROCm: the `cupy.cuda.cub` module cannot be built in v8
See original GitHub issueLooks like in CuPy v8 we assumed the cupy.cuda.cub
module is always built, but the ROCm support was not added until recently (#4027), so an error is raised upon import cupy
:
$ pip install -v cupy # build from sdist
$ python -c "import cupy"
Traceback (most recent call last):
File "/home/leofang/miniconda3/envs/cupy_test/lib/python3.7/site-packages/cupy/__init__.py", line 20, in <module>
from cupy import core # NOQA
File "/home/leofang/miniconda3/envs/cupy_test/lib/python3.7/site-packages/cupy/core/__init__.py", line 1, in <module>
from cupy.core import core # NOQA
File "cupy/core/core.pyx", line 1, in init cupy.core.core
File "cupy/core/_routines_manipulation.pyx", line 1, in init cupy.core._routines_manipulation
File "cupy/core/_routines_indexing.pyx", line 1, in init cupy.core._routines_indexing
File "cupy/core/_routines_math.pyx", line 6, in init cupy.core._routines_math
File "cupy/core/_reduction.pyx", line 1, in init cupy.core._reduction
File "cupy/core/_cub_reduction.pyx", line 1, in init cupy.core._cub_reduction
ModuleNotFoundError: No module named 'cupy.cuda.cub'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/leofang/miniconda3/envs/cupy_test/lib/python3.7/site-packages/cupy/__init__.py", line 41, in <module>
raise ImportError(_msg) from e
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'
I think this can be fixed simply by backporting #4027.
ref: https://stackoverflow.com/questions/64613606/cupy-on-amd-gpu-causing-an-importerror
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Installation — CuPy 11.4.0 documentation
pip fails to install CuPy If you are using certain versions of conda, it may fail to build CuPy with error g++: error:...
Read more >CuPy Documentation - Read the Docs
CuPy is a NumPy/SciPy-compatible array library for GPU-accelerated computing with Python. CuPy acts as a drop-in.
Read more >CuPy on AMD GPU causing an ImportError - Stack Overflow
1 the offending cupy.cuda.cub module is not built in ROCm/HIP environments, which will hopefully be fixed in v8.2 (see ticket). For ...
Read more >ROCm Documentation
1.3.29 HIP-Supported CUDA API Reference Guide v4.5 . ... AMD ROCm is built for scale; it supports multi-GPU computing in and out of ......
Read more >gfB - River Thames Conditions - Environment Agency - GOV.UK
Trilha salkantay mapa, Compagnie gendarmerie domfront, Voy definition spanish, 3 ml syringe w needle, First governor of tn, Aldos night club halloween, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@leofang , do you mean to build CuPy in an environment that has only ROCm installed but has an NVCC env var exported? I tried it as follows:
This cannot install CuPy successfully. Here is the log. log-ROCm39-NVCC.LOG
@leofang , with ROCm 3.5 and CuPy v8.0.0,I have no issue with
import cupy
. Currently I have tested CuPy with ROCm 3.5 and ROCm 3.9 on two different machines, both of which have more than one version of ROCm installed. I usemodule
(an environment variables management tool) to switch among different versions of ROCm. I uninstalled the previous CuPy v8.0.0 on ROCm 3.5 and reinstelled it and got this log: log-3.5.LOG It seems that there are some major diffenences between the installation of v9 on ROCm 3.9 and v8.0.0 on ROCm 3.5,for example, in v8.0.0, cub module is not configured, instead it is cusolver that is configured:Is this the reason that there is no cub issue in v8.0.0? Here are the outputs of hipconfig on my two machines, one of which is configured to ROCm 3.5 and the other is ROCm 3.9.
hipconfig-rocm35.LOG hipconfig-rocm39.LOG
To be clear, the two logs are from two different machines, but both of the two machines have multiple versions of ROCm,from rocm 2.9 to 3.9, installed in different directories, and managed using the
module
tool. On the machine which has both ROCm 3.5 and ROCm 3.9, the CuPy v8.0.0 works with ROCm 3.5,but v8.1.0, v8.2.0 and v9 have the cub issue with ROCm 3.9.