Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

username: Mactarvish
cooked: <p>I tried to train my model just now and it just stopped with such an error:</p>
<pre><code class="lang-auto">Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
</code></pre>
<p>but in debug mode everything can run normally, and yesterday it was everything OK and I haven’t change it. What’s the problem?</p>

username: Mactarvish
cooked: <p>It’s extremely strange for me. I just added a cuda check in the top of my code like that:</p>
<pre><code class="lang-auto">import ......

print(torch.cuda.is_available())

...
...
...
</code></pre>
<p>And the error vanished with my code running normally… Does anyone know what’s the matter? And I never add such a check before when it could still run normally.</p>

username: albanD
cooked: <p>Hi,</p>
<p>Could you give a small code sample that reproduce this issue?</p>

username: Nabarun_Goswami
cooked: <p>Happened to me too. But it seems to occur randomly. Once after 2 epochs, and once after 33. Also I tried executing the script inside gdb to get a stacktrace of the crash, it didn’t segfault for the entire training. Really confused here as well.</p>
<p>BTW, I am on <code>0.5.0a0+8fbab83</code> on a TitanX pascal with cuda 8.0</p>

username: Arnold_MuST
cooked: <p>Hi Mactarvish</p>
<p>I have exact same problem as you. Just imported torch and torch.cuda in the console to see if cuda is available by using torch.cuda.is_available() and now no PyCharm project is working. Have you found a solution to this?</p>
<p>(EDIT)</p>
<p>Turns out the problem was my NVIDIA drivers, i switched back to Intel drivers and it worked fine (after I reinstalled conda and pytorch which was a drag.)</p>

username: ilinaqin
cooked: <p>Hi，have you solved this problem？When I test a model after I’ve trained it, it always comes up randomly. If I restart the computer or test it a few more times, it maybe effective.But it won’t always work out.</p>

username: Pinocchioo
cooked: <p>Wow,it is so strange for it ,and it is same happen to me . When I ran my code that was OK before somedays , the error is : <code>Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)</code>.<br>
And I just added some cuda check :</p>
<pre><code class="lang-auto">import torch 
print(torch.cuda.is_available())
</code></pre>
<p>And the code could runing normally … It is so strange and I want to know whether anyone know why？</p>

username: EvanZ
cooked: <p>Hmm I’m having this issue all of a sudden where my training is suddenly throwing these errors:</p>
<pre><code class="lang-auto">Using cuda
  1%|▏         | 21/1584 [00:00&lt;01:00, 26.03it/s]
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
</code></pre>
<p>It seems like it gets through some iterations and then bam, segmentation fault.</p>
<p>I checked nvidia-smi:</p>
<pre><code class="lang-auto">+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.119.03   Driver Version: 450.119.03   CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:01:00.0  On |                  N/A |
|  0%   50C    P5    21W / 250W |   4867MiB / 11177MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
</code></pre>
<p>Having just upgraded to torch 1.9.0, is it possible my gpu drivers need to be updated?</p>

username: Doge_Coin
cooked: <p>I Fixed the Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) error</p>
<p>the problem is with import cv2. you need to use pip install numpy==1.24.3</p>
<p>this version of numpy fixed it. the newest version of numpy must be broken</p>