Pytorch 1.4 cannot find my cuda

Luca_Pamparana: <p>I am running ubuntu 16.04 and have cuda 10.1 installed. The output from <code>nvcc --version</code> is:</p>
<pre><code class="lang-auto">nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
</code></pre>
<p>I also have the latest drivers installed. The output from <code>nvidia-smi</code> is:</p>
<pre><code class="lang-auto">+-----------------------------------------------------------------------------+
| NVIDIA-SMI 430.64       Driver Version: 430.64       CUDA Version: N/A      |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 108...  Off  | 00000000:05:00.0 Off |                  N/A |
| 25%   61C    P0    64W / 250W |      0MiB / 11176MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   1  GeForce GTX 108...  Off  | 00000000:06:00.0 Off |                  N/A |
| 27%   55C    P0    62W / 250W |      0MiB / 11178MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   2  GeForce GTX 108...  Off  | 00000000:09:00.0 Off |                  N/A |
| 23%   51C    P0    54W / 250W |      0MiB / 11178MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
|   3  GeForce GTX 108...  Off  | 00000000:0A:00.0 Off |                  N/A |
| 18%   37C    P0    53W / 250W |      0MiB / 11178MiB |      1%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
</code></pre>
<p>I am running python <code>3.7</code> and installed pytorch in a new conda environment as:</p>
<pre><code class="lang-auto">conda create --name testcuda python=3.7
conda activate testcuda
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch
</code></pre>
<p>I also verify that the correct python version is being used.</p>
<pre><code class="lang-auto">import torch
torch.version.cuda  # returns 10.1
torch.cuda.is_available()  # return False
</code></pre>
<p>I tried uninstalling, reinstalling and all that and sort of out of ideas.</p>
<p>Does anyone have any suggestions on what else I could try?</p>

theairbend3r: <p>Try restarting your PC and immediately check if cuda is available. For me, if I use my laptop for long enough without using/checking for cuda, then PyTorch is unable to find it. So, I need to restart my pc.</p>
<ol>
<li>Restart PC</li>
<li><code>conda activate testcuda</code></li>
<li><code>import torch</code></li>
<li><code>torch.cuda.is_available()</code></li>
</ol>
<p>Try this and see if it works. <img src="https://discuss.pytorch.org/images/emoji/apple/slight_smile.png?v=9" title=":slight_smile:" class="emoji" alt=":slight_smile:"></p>

Luca_Pamparana: <p>So for  some reason it started working after I downgraded my driver to <code>418.87.00</code>. Not sure what has  happened  but sorry for the noise. I need to  move  to Docker.</p>