Pytorch is not detecting cuda enabled devices

kirk86: <p>I have the following packages installed on my conda environment:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/4/467f1e8602e78c3d25201572366ffa06ef8fb016.png" data-download-href="https://discuss.pytorch.org/uploads/default/467f1e8602e78c3d25201572366ffa06ef8fb016" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/2X/4/467f1e8602e78c3d25201572366ffa06ef8fb016.png" alt="image" data-base62-sha1="a3DM1Gb64u6ACLab8IRDRspzGQu" width="690" height="99" data-dominant-color="1E1F1D"><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">image</span><span class="informations">695×100 20.9 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>my nvidia drivers are:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/9/97d7ee1dc0fef3fac1de45a00e9034dd85236021.png" data-download-href="https://discuss.pytorch.org/uploads/default/97d7ee1dc0fef3fac1de45a00e9034dd85236021" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/2X/9/97d7ee1dc0fef3fac1de45a00e9034dd85236021.png" alt="image" data-base62-sha1="lFgJ1Dvw3cwj4KeIv9Ls9cXdN9D" width="690" height="212" data-dominant-color="222522"><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">image</span><span class="informations">783×241 34.6 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>But pytorch returns false when:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/2X/b/b643292029a51ca0898fd0acd14e4673c378f635.png" data-download-href="https://discuss.pytorch.org/uploads/default/b643292029a51ca0898fd0acd14e4673c378f635" title="image"><img src="https://discuss.pytorch.org/uploads/default/original/2X/b/b643292029a51ca0898fd0acd14e4673c378f635.png" alt="image" data-base62-sha1="q0mN1eGmoSkdUdPtOjKt75gG4V7" width="690" height="149" data-dominant-color="1B1F1D"><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">image</span><span class="informations">730×158 17.8 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>Any ideas what’s going on here?</p>

kirk86: <p>Never mind folks, I found that after restarting only then <code>torch.cuda.is_available()</code> returned <code>True</code>. One thing though that seems strange to me is that when updating the conda  environment pkgs pytorch &amp; torchvision update to latest version 1.2 &amp; 0.4 but cudatoolkit downgrades to 10.0 from 10.1, why is that, can’t we use cudatoolkit 10.1 instead of 10.0? Is there some conflict which forces conda to downgrade to cudatoolkit 10.0?</p>

ptrblck: <p>The binaries are shipped with CUDA10.0. Did you build from source with CUDA10.1 or how did you install it?</p>

kirk86: <p>Basically if you install in a conda env <code>conda install pytorch torchvision cudatoolkit=10.1 -c pytorch</code> it installs pytorch 1.0 &amp; torchvison 0.2 instead of 1.2 &amp; 0.4, but seems to be working fine with cuda 10.1. Now if you do <code>conda update --all</code> it upgrades torch &amp; torchvision to 1.2 &amp; 0.4 equivalently but it downgrades cuda to 10.0. The only reasoning I can find behind this is if pytorch 1.0 binary is built with cuda 10.1? If so then why 1.2 binary is built with cuda 10 instead of 10.1?</p>