0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

RuntimeError: cuInit failed: no CUDA-capable device is detected

Posted at

RuntimeError: cuInit failed: no CUDA-capable device is detected がGoogle Colabで出たら。

import numpy as np
import pycuda.gpuarray as gpuarray
from pycuda.elementwise import ElementwiseKernel
import pycuda.autoinit


-------------------------以下エラー------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-be9ea5a5b25e> in <module>()
      2 import pycuda.gpuarray as gpuarray
      3 from pycuda.elementwise import ElementwiseKernel
----> 4 import pycuda.autoinit

/usr/local/lib/python3.7/dist-packages/pycuda/autoinit.py in <module>()
      3 
      4 # Initialize CUDA
----> 5 cuda.init()
      6 
      7 from pycuda.tools import make_default_context  # noqa: E402

RuntimeError: cuInit failed: no CUDA-capable device is detected

  1. ランタイムのセッションタイプを押下する。
    image.png

2.ハードウェア アクセラレータを「GPU」に変える。
image.png

3.もう一度実行する。
image.png

OK!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?