python - 为什么我不能正确导入 cupy-cuda101?
问题描述
在 pip 安装 cupy-cuda101 后,我遇到了导入 CuPy 的问题。我确保我使用的是正确的 CUDA 版本,并且我只安装了一个版本的 CuPy。错误代码如下:
import cupy
Traceback (most recent call last):
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/__init__.py", line 16, in <module>
from cupy import _core # NOQA
File "/home1/xuchenhao/.local/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 "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/cuda/__init__.py", line 8, in <module>
from cupy.cuda import compiler # NOQA
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/cuda/compiler.py", line 11, in <module>
from cupy.cuda import device
File "cupy/cuda/device.pyx", line 10, in init cupy.cuda.device
ImportError: /home1/xuchenhao/.local/lib/python3.7/site-packages/cupy_backends/cuda/libs/cusparse.cpython-37m-x86_64-linux-gnu.so: symbol cusparseConstrainedGeMM_bufferSize version libcusparse.so.10 not defined in file libcusparse.so.10 with link time reference
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home1/xuchenhao/.local/lib/python3.7/site-packages/cupy/__init__.py", line 37, 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: /home1/xuchenhao/.local/lib/python3.7/site-packages/cupy_backends/cuda/libs/cusparse.cpython-37m-x86_64-linux-gnu.so: symbol cusparseConstrainedGeMM_bufferSize version libcusparse.so.10 not defined in file libcusparse.so.10 with link time reference
My environments are:
python=3.7.6
GCC=7.3.0
cuda=10.1.168
cupy-cuda101=9.5.0
我该如何解决这个问题?
解决方案
推荐阅读
- apache-nifi - 如何在服务器上设置 nifi 注册表
- flask - 一次登录 Apache Superset 集成
- java - 如何在“数据”中获取“url”字段?
- django - 如何在 django 表单中将表单日期字段从公历更改为波斯日历?
- tesseract - 在make期间安装Tesseract问题
- ios - 当导航栏滑动隐藏时如何向上滚动 UIView
- php - MySQL Unrecognized Keyword near 选项
- c# - 在 x 数量产生/被摧毁后敌人停止产生?
- c++ - C++:`X&& goo();` 是函数声明还是变量定义?
- npm - JSDelivr URL 中的差异有和没有“最新”