CuPy - 导入错误 - 未找到 nvidia lib

CuPy - 导入错误 - 未找到 nvidia lib

尝试导入 CuPy 时出现以下错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/cupy/__init__.py", line 20, in <module>
    six.reraise(ImportError, ImportError(msg), exc_info[2])
  File "/usr/local/lib/python2.7/dist-packages/cupy/__init__.py", line 9, in <module>
    from cupy import core  # NOQA
  File "/usr/local/lib/python2.7/dist-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 (cupy/core/core.cpp:103472)
  File "/usr/local/lib/python2.7/dist-packages/cupy/cuda/__init__.py", line 3, in <module>
    from cupy.cuda import compiler  # NOQA
  File "/usr/local/lib/python2.7/dist-packages/cupy/cuda/compiler.py", line 12, in <module>
    from cupy.cuda import function
  File "cupy/cuda/function.pyx", line 1, in init cupy.cuda.function (cupy/cuda/function.cpp:6346)
ImportError: CuPy is not correctly installed. Please check your environment, uninstall CuPy and reinstall it with `pip install cupy --no-cache-dir -vvvv`.

original error: libnvidia-fatbinaryloader.so.375.82: cannot open shared object file: No such file or directory

我尝试按照建议重新安装 CuPy。此外,我尝试将 libnvidia-fatbinaryloader.so.375.82 文件从 /usr/lib/nvidia-375 复制到 /usr/local/cuda-8.0/lib64/,但没有成功。

事实上,当我将该文件复制到 /usr/local/cuda-8.0/lib64/ 时出现此错误(尝试创建数组时):

>>> import cupy as cp

>>> x_gpu = cp.array([1, 2, 3])

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/cupy/creation/from_data.py", line 26, in array
    return core.array(obj, dtype, copy, ndmin)
  File "cupy/core/core.pyx", line 1822, in cupy.core.core.array (cupy/core/core.cpp:59154)
  File "cupy/core/core.pyx", line 1848, in cupy.core.core.array (cupy/core/core.cpp:58918)
  File "cupy/core/core.pyx", line 92, in cupy.core.core.ndarray.__init__ (cupy/core/core.cpp:6509)
  File "cupy/cuda/memory.pyx", line 283, in cupy.cuda.memory.alloc (cupy/cuda/memory.cpp:5911)
  File "cupy/cuda/memory.pyx", line 263, in cupy.cuda.memory._malloc (cupy/cuda/memory.cpp:5853)
  File "cupy/cuda/memory.pyx", line 264, in cupy.cuda.memory._malloc (cupy/cuda/memory.cpp:5739)
  File "cupy/cuda/memory.pyx", line 34, in cupy.cuda.memory.Memory.__init__ (cupy/cuda/memory.cpp:1789)
  File "cupy/cuda/device.pyx", line 67, in cupy.cuda.device.Device.__init__ (cupy/cuda/device.cpp:1789)
  File "cupy/cuda/runtime.pyx", line 158, in cupy.cuda.runtime.getDevice (cupy/cuda/runtime.cpp:2563)
  File "cupy/cuda/runtime.pyx", line 130, in cupy.cuda.runtime.check_status (cupy/cuda/runtime.cpp:2242)
cupy.cuda.runtime.CUDARuntimeError: cudaErrorUnknown: unknown error

我的 CUDA 版本:8.0

Ubuntu 16.04

Python:2.7

有人能帮忙吗?如果可能的话,我想避免重新安装 CUDA。如果您需要更多信息来解决问题,请随时询问。谢谢!

答案1

我重新安装了 NVIDIA 驱动程序并且解决了......

相关内容