Installing PyTorch with older CUDA version

f3ba: <p>I am trying to install PyTorch on a cluster that has NVidia driver version 390.87 and CUDA toolkit version 9.1 installed.</p>
<p>It seems that to install PyTorch 1.4 we require CUDA 9.2 or 10.1, which I cannot install because I don’t have root privileges on the cluster and the admins are reluctant to upgrade the drivers for fear of breaking things.</p>
<p>So what are my options? Is there a way to get install PyTorch 1.4 with CUDA toolkit 9.1? Or should I install an older version of PyTorch? If so, which one and how?</p>

xen0f0n: <p>If you use a pre-built binary (check <a href="https://pytorch.org/get-started/locally/" rel="nofollow noopener">https://pytorch.org/get-started/locally/</a>) you don’t need to install CUDA on the machine.</p>

f3ba: <p>But when I install pytorch via <code>conda install pytorch torchvision cudatoolkit=9.2 -c pytorch</code>, I find that <code>torch.cuda.is_available()</code> returns false. I guess because the driver version (390) does not support CUDA toolkit 9.2 which is required by pytorch 1.4?</p>

xen0f0n: <p>yeah… You are right… Check this answer:</p><aside class="quote" data-post="10" data-topic="20614">
  <div class="title">
    <div class="quote-controls"></div>
    <img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/48/1823_2.png" class="avatar">
    <a href="https://discuss.pytorch.org/t/torch-cuda-is-available-returns-false-nvidia-smi-is-working/20614/10">Torch.cuda.is_available() returns False, nvidia-smi is working</a> 
  </div>
  <blockquote>
    Which CUDA version are you using? 
Based on the driver, you could only use CUDA&lt;=9.2 as shown <a href="https://docs.nvidia.com/deploy/cuda-compatibility/#binary-compatibility" rel="noopener nofollow ugc">here</a>. 
I would recommend to update the driver and the CUDA version (if you are using an older one).
  </blockquote>
</aside>

<p>You could install a previous version of PyTorch that supports CUDA-9.0…</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://pytorch.org/get-started/previous-versions/">
  <header class="source">
      <img src="https://pytorch.org/favicon.ico?" class="site-icon" width="32" height="32">

      <a href="https://pytorch.org/get-started/previous-versions/" target="_blank" rel="noopener nofollow ugc">PyTorch</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:690/362;"><img src="https://pytorch.org/assets/images/social-share.jpg" class="thumbnail" width="690" height="362"></div>

<h3><a href="https://pytorch.org/get-started/previous-versions/" target="_blank" rel="noopener nofollow ugc">Previous PyTorch Versions</a></h3>

  <p>Installing previous versions of PyTorch</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>


f3ba: <p>Thanks. That seems like my issue.</p>
<p>Do you if it is possible to build pytorch 1.4 (or master) from source using an older CUDA version?</p>

ptrblck: <p>It should be possible and you’ll find the instructions <a href="https://github.com/pytorch/pytorch#from-source">here</a>.<br>
Let us know, if you encounter any issues.</p>