CUDA Runtime Error 30

username: pasawaya
cooked: <p>I’m receiving the same error as in <a href="https://discuss.pytorch.org/t/resolved-cuda-runtime-error-30/1116">this post</a> except the specified solution (rebooting) isn’t resolving the issue in my case.</p>
<p>To diagnose the issue I followed the directions <a href="http://forums.fast.ai/t/how-to-check-your-pytorch-keras-is-using-the-gpu/7232?source_topic_id=7551" rel="nofollow noopener">here</a> to see if Pytorch is using the GPU at all and received the error again at the below code:</p>
<pre><code class="lang-auto">Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
&gt;&gt;&gt; import torch
&gt;&gt;&gt; torch.cuda.is_available()
True
&gt;&gt;&gt; torch.cuda.device_count()
4
&gt;&gt;&gt; torch.cuda.device(0)
&lt;torch.cuda.device object at 0x7f49ef3623c8&gt;
&gt;&gt;&gt; torch.cuda.get_device_name(0)
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/THC/THCTensorRandom.cu line=25 error=30 : unknown error
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/home/philippe/miniconda3/envs/cv-dl/lib/python3.6/site-packages/torch/cuda/__init__.py", line 272, in get_device_name
    return get_device_properties(device).name
  File "/home/philippe/miniconda3/envs/cv-dl/lib/python3.6/site-packages/torch/cuda/__init__.py", line 290, in get_device_properties
    init()  # will define _get_device_properties and _CudaDeviceProperties
  File "/home/philippe/miniconda3/envs/cv-dl/lib/python3.6/site-packages/torch/cuda/__init__.py", line 143, in init
    _lazy_init()
  File "/home/philippe/miniconda3/envs/cv-dl/lib/python3.6/site-packages/torch/cuda/__init__.py", line 161, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (30) : unknown error at /opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/THC/THCTensorRandom.cu:25
&gt;&gt;&gt; torch.cuda.current_device()
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/home/philippe/miniconda3/envs/cv-dl/lib/python3.6/site-packages/torch/cuda/__init__.py", line 332, in current_device
    _lazy_init()
  File "/home/philippe/miniconda3/envs/cv-dl/lib/python3.6/site-packages/torch/cuda/__init__.py", line 161, in _lazy_init
    torch._C._cuda_init()
RuntimeError: cuda runtime error (30) : unknown error at /opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/THC/THCGeneral.cpp:844
&gt;&gt;&gt;
</code></pre>
<p>I’ve tried rebooting, uninstalling and reinstalling CUDA 8 and the corresponding drivers, uninstalling and reinstalling torch, and verifying that my torch version for built for CUDA 8 but nothing seems to resolve the issue.</p>

username: albanD
cooked: <p>Hi,</p>
<p>Can you properly run the CUDA 8 samples that come with the cuda install? Your GPU crash during the cuda initialization itself.</p>

username: bichenghu
cooked: <p>I had a similar issue today on Ubuntu Server 14.04, and I think it’s maybe related to the user’s permission.I solved this problem by add sudo when I running python.</p>
<pre><code class="lang-auto">sudo ~/anaconda3/bin/python
</code></pre>

username: Tomato3351
cooked: <p>Maybe you have no cudnn.Remeber to install the right Version!<br>
Secondly,the version of CUDA may be different from the one needed by pytorch.<br>
I got the same Error, now it goes right. I have no cudnn before.<br>
Good luck!</p>

username: miladiouss
cooked: <p>I am still experiencing this error on my laptop. Rebooting solves it, but I don’t want to reboot every time this error comes up, which is a lot.</p>

username: Jenic
cooked: <p>Hi,I have the same problem.<br>
I have cudnn of the right version,and I can run the cuda 10.1 samples properly.<br>
but when I run<br>
‘’‘torch.cuda.current_device()<br>
‘’’<br>
it will be wrong.<br>
I am really confused now.</p>

username: WangShiJie521
cooked: <p>Have you solved this problem? I ran into the same problem…</p>