How to properly set up an conda environment with PyTorch

setsailforfail: <p>I want to use PyTorch with cuda support, and here is what I am usually doing when starting a new project:</p>
<p>conda create -n ‘myproject’<br>
conda activate ‘myproject’</p>
<p>Then, in order to install PyTorch, I go to the site</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://pytorch.org/blog/pytorch-enterprise-support-update/">
  <header class="source">
      <img src="https://pytorch.org/favicon.ico?" class="site-icon" width="32" height="32">

      <a href="https://pytorch.org/blog/pytorch-enterprise-support-update/" target="_blank" rel="noopener nofollow ugc">pytorch.org</a>
  </header>

  <article class="onebox-body">
    <img src="https://pytorch.org/" class="thumbnail onebox-avatar" width="32" height="32">

<h3><a href="https://pytorch.org/blog/pytorch-enterprise-support-update/" target="_blank" rel="noopener nofollow ugc">PyTorch Enterprise Support Program Update</a></h3>

  <p>On May 25, 2021, we announced the PyTorch Enterprise Support Program (ESP) that enabled providers to develop and offer tailored enterprise-grade support to their customers.</p>


  </article>

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

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

<p>and choose what I require:</p>
<p>Stable, Linux, Conda, Python, Cuda 11.8 (I got a 4090, and with 11.7 it was somehow slow). I copy paste the command and install everything. Is this the correct way? Am I missing something?</p>
<p>Because, with that approach I just got the error :<br>
Could not load library libcudnn_cnn_infer.so.8. Error: libnvrtc.so: cannot open shared object file: No such file or directory</p>
<p>Do I still need to install the nvidia cuda toolkit ?</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&amp;target_arch=x86_64&amp;Distribution=Ubuntu&amp;target_version=22.04">
  <header class="source">
      <img src="https://developer.nvidia.com/sites/all/themes/cuda/favicon.ico" class="site-icon" width="48" height="48">

      <a href="https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&amp;target_arch=x86_64&amp;Distribution=Ubuntu&amp;target_version=22.04" target="_blank" rel="noopener nofollow ugc" title="02:39PM - 03 October 2022">NVIDIA Developer – 3 Oct 22</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&amp;target_arch=x86_64&amp;Distribution=Ubuntu&amp;target_version=22.04" target="_blank" rel="noopener nofollow ugc">CUDA Toolkit 11.8 Downloads</a></h3>

  <p>Resources CUDA Documentation/Release NotesMacOS Tools Training Sample Code Forums Archive of Previous CUDA Releases FAQ Open Source PackagesSubmit a BugTarball and Zip Archive Deliverables</p>


  </article>

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

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


ptrblck: <p>Your workflow is correct and you are running into <a href="https://github.com/pytorch/pytorch/issues/97041">this issue</a>. You could apply a workaround by creating the missing symbolic link as described <a href="https://github.com/pytorch/pytorch/issues/97041#issuecomment-1477002945">here</a>.</p>

setsailforfail: <p>Thanks! But it is actually recommended to use cuda 11.8 instead of 11.7 for the 4090?</p>

ptrblck: <p>Yes, as the CUDA 11.8 builds ship with a newer cuDNN version (8.7) and added the heuristics for your 4090. Older GPUs should not see a huge difference.</p>