CuPy没有在使用cuda9.0的ubuntu18.04上工作

2024-06-13 20:34:29 发布

您现在位置:Python中文网/ 问答频道 /正文

条件:

  • 丘比7.0.0版
  • 操作系统/平台Ubuntu 18.04
  • CUDA 9.0版
  • cuDNN/NCCL 7.6.5版(适用于cuda 9.0)
  • GPU英伟达GTX580
  • 驱动程序版本390.116

代码1:

import cupy as cp
x = cp.arange(6).reshape(2, 3).astype('f')

错误消息1:

NVRTC compilation error: nvrtc: error: invalid value for --gpu-architecture (-arch)

-----
Name:
Options: -I/home/liu/.local/lib/python2.7/site-packages/cupy/core/include -I /usr/local/cuda-9.0/include -ftz=true -arch=compute_20
CUDA source:
1
-----
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/liu/.local/lib/python2.7/site-packages/cupy/creation/ranges.py", line 57, in arange
    _arange_ufunc(typ(start), typ(step), ret, dtype=dtype)
  File "cupy/core/_kernel.pyx", line 864, in cupy.core._kernel.ufunc.__call__
  File "cupy/core/_kernel.pyx", line 876, in cupy.core._kernel.ufunc._get_ufunc_kernel
  File "cupy/core/_kernel.pyx", line 638, in cupy.core._kernel._get_ufunc_kernel
  File "cupy/core/_kernel.pyx", line 60, in cupy.core._kernel._get_simple_elementwise_kernel
  File "cupy/core/carray.pxi", line 166, in cupy.core.core.compile_with_cache
  File "/home/liu/.local/lib/python2.7/site-packages/cupy/cuda/compiler.py", line 136, in compile_with_cache
    base = _preprocess('', options, arch)
  File "/home/liu/.local/lib/python2.7/site-packages/cupy/cuda/compiler.py", line 97, in _preprocess
    result = prog.compile(options)
  File "/home/liu/.local/lib/python2.7/site-packages/cupy/cuda/compiler.py", line 250, in compile
    raise CompileException(log, self.src, self.name, options)
cupy.cuda.compiler.CompileException: nvrtc: error: invalid value for --gpu-architecture (-arch)

代码2:

import cupy as cp
cp.random.random_sample(10)

错误消息2:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/liu/.local/lib/python3.6/site-packages/cupy/random/sample.py", line 161, in random_sample
    return rs.random_sample(size=size, dtype=dtype)
  File "/home/liu/.local/lib/python3.6/site-packages/cupy/random/generator.py", line 540, in random_sample
    out = self._random_sample_raw(size, dtype)
  File "/home/liu/.local/lib/python3.6/site-packages/cupy/random/generator.py", line 528, in _random_sample_raw
    func(self._generator, out.data.ptr, out.size)
  File "cupy/cuda/curand.pyx", line 158, in cupy.cuda.curand.generateUniformDouble
  File "cupy/cuda/curand.pyx", line 162, in cupy.cuda.curand.generateUniformDouble
  File "cupy/cuda/curand.pyx", line 86, in cupy.cuda.curand.check_status
cupy.cuda.curand.CURANDError: CURAND_STATUS_LAUNCH_FAILURE

Tags: inpycorehomelibpackageslocalline
1条回答
网友
1楼 · 发布于 2024-06-13 20:34:29

GeForce GTX 580的计算能力是2.0,但是CuPy不支持它,也不支持任何比cuda8.0更新的CUDA工具包版本。你知道吗

https://docs-cupy.chainer.org/en/latest/install.html#requirements

Compute Capability of the GPU must be at least 3.0.

https://docs.nvidia.com/cuda/archive/9.0/cuda-toolkit-release-notes/index.html#unsupported-features

Fermi Architecture Support. The CUDA Toolkit, including the CUDA compiler (nvcc), developer tools, and CUDA libraries, no longer supports the Fermi architecture (sm_2.x). Note that support for the Fermi architecture is being removed from the CUDA Toolkit but not from the driver. Applications compiled with CUDA 8 or earlier will continue to work on the Fermi architecture with newer NVIDIA drivers.

相关问题 更多 >