[Solved] Cuda error: unknown error

Aniket_Thomas: <p>I am getting this error very frequently and I don’t know how to solve it. I read somewhere that I have to update graphic driver and I’ve done it and restart my laptop but again getting this error.<br>
Is it some sort of bug or what please help me out.<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/6/6e7a3d53b7352ac1a13512491980b0f9d33d88a1.png" data-download-href="https://discuss.pytorch.org/uploads/default/6e7a3d53b7352ac1a13512491980b0f9d33d88a1" title="Screenshot%20(329)"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/6/6e7a3d53b7352ac1a13512491980b0f9d33d88a1_2_690x388.png" alt="Screenshot%20(329)" data-base62-sha1="fLkpXQNCdD6ysNEO0B530qPxGr7" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/6/6e7a3d53b7352ac1a13512491980b0f9d33d88a1_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/2X/6/6e7a3d53b7352ac1a13512491980b0f9d33d88a1_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/2X/6/6e7a3d53b7352ac1a13512491980b0f9d33d88a1_2_1380x776.png 2x" data-dominant-color="E0E1E1"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot%20(329)</span><span class="informations">1920×1080 202 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>P.S I am using windows</p>

ptrblck: <p>Could you post some information on your current setup (i.e. which GPU, driver version, CUDA, cudnn version etc.)?</p>
<p>Were you able to use the GPU before or do you always encounter this issue?</p>

Aniket_Thomas: <p>GPU is NVIDIA GTX 1060<br>
Driver Version 26.21.14.3086<br>
CUDA version 10.0</p>

Aniket_Thomas: <p>And yes it used to work before but sometimes it used to give same error</p>

ptrblck: <p>According to the driver version, it should be ~430.xx?</p>
<p>Since you are using a laptop, could you check some Windows energy saving options, which might deactivate the GPU?</p>

Aniket_Thomas: <p>Charger is plugged in and it is working on best performance.<br>
Please help me out I can’t work on my projects.</p>

ptrblck: <p>Could you try to set <code>num_workers=0</code> and <code>pin_memory=False</code> in your <code>DataLoader</code>?<br>
In the past this error was often solved by upgrading the driver, restarting etc., as you already said.</p>

Aniket_Thomas: <p>Okay that did work for dataloader but I still can’t move my model to GPU, it’s showing same error.</p>

ptrblck: <p>What does it mean?<br>
Are you able to push tensors now onto the GPU, but not the model?</p>

Aniket_Thomas: <p>I think anything related to cuda is not working as I can’t push anything on GPU</p>

Aniket_Thomas: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/0/0757184eae3a9c034c7165114e0629317b191ec5.png" data-download-href="https://discuss.pytorch.org/uploads/default/0757184eae3a9c034c7165114e0629317b191ec5" title="Screenshot%20(331)"><img src="https://discuss.pytorch.org/uploads/default/optimized/2X/0/0757184eae3a9c034c7165114e0629317b191ec5_2_690x388.png" alt="Screenshot%20(331)" data-base62-sha1="12VWqrLjF9vYTvq4zxzJVEEh73T" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/2X/0/0757184eae3a9c034c7165114e0629317b191ec5_2_690x388.png, https://discuss.pytorch.org/uploads/default/optimized/2X/0/0757184eae3a9c034c7165114e0629317b191ec5_2_1035x582.png 1.5x, https://discuss.pytorch.org/uploads/default/optimized/2X/0/0757184eae3a9c034c7165114e0629317b191ec5_2_1380x776.png 2x" data-dominant-color="979798"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">Screenshot%20(331)</span><span class="informations">1920×1080 189 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
And it is working properly in command prompt</p>

ptrblck: <p>That’s good to know.<br>
Did you start this REPL session using <code>python</code> or <code>ipython</code>?<br>
I assume IPython might yield these problems.</p>
<p>Could you create a new conda environment and install PyTorch and all other dependencies there?</p>

Aniket_Thomas: <p>As you said I created new conda environment then tweaked some of my settings in NVIDIA control panel and voila it started to work. Thanks for all the help.</p>