gpt4 book ai didi

python - CuPy 不适用于带有 CUDA 9.0 的 Ubuntu 18.04

转载 作者:行者123 更新时间:2023-12-02 00:09:47 26 4
gpt4 key购买 nike

条件:

  • CuPy 版本 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

最佳答案

GeForce GTX 580 的计算能力是 2.0,但它不受 CuPy 支持,也不受任何高于 CUDA 8.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.

关于python - CuPy 不适用于带有 CUDA 9.0 的 Ubuntu 18.04,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59451428/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com