Error loading "\lib\site-packages\torch\lib\shm.dll" or one of its dependencie

srinim: <p>I installed torch using “pip install torch” command. it was working.<br>
I did install torchvision  using “pip install torchvision” . after that started getting following error .<br>
Error loading “\lib\site-packages\torch\lib\shm.dll” or one of its dependencies</p>
<p>Note: Uninstalled torch, torchvision  and re-installed torch. still the issue persisted.</p>

Alexander_DE: <p>I have same issue (Windows 10, Cuda 12.1, Python 3.11).<br>
Going back to Torch==2.2.2 fixed it for me, 2.3 failed.</p>

srinim: <p>Following command solved the issue on my machine, I experianced the issue due to MKl version mismatch, latest torch installation getting me mkl which is interfering with mkl I have in my application.</p>
<p>python.exe -m pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 --index-url <a href="https://download.pytorch.org/whl/cpu" rel="noopener nofollow ugc">https://download.pytorch.org/whl/cpu</a></p>

kirbaz: <p>Hello, I tried as you wrote in your comment. Nothing worked, I tried installing different versions of Torch, Torchaudio, Torchvision. The error remains the same: …Python311\site-packages\torch\lib\shm.dll" or one of its dependencies. Please tell me the solution. Thanks in advance.</p>

orionflame: <p>i have the same issue today:<br>
pip3 install torch torchvision torchaudio --index-url <a href="https://download.pytorch.org/whl/cu121" rel="noopener nofollow ugc">https://download.pytorch.org/whl/cu121</a></p>
<p>I have cuda 12.1 on windows 11. is something broken on pytorch side?</p>

Zain_Mehdi: <p>Installing pytorch separately using the guide here fixed it for me</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://pytorch.org/get-started/locally/">
  <header class="source">
      <img src="https://pytorch.org/favicon.ico?" class="site-icon" width="32" height="32">

      <a href="https://pytorch.org/get-started/locally/" 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/locally/" target="_blank" rel="noopener nofollow ugc">Start Locally</a></h3>

  <p>Start Locally</p>


  </article>

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

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

<p>conda install pytorch torchvision torchaudio cpuonly -c pytorch</p>

orionflame: <p>that looks like CPU only though. I need GPU support.</p>

srinim: <p>select options in following link for GPU support</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://pytorch.org/get-started/locally/">
  <header class="source">
      <img src="https://pytorch.org/favicon.ico?" class="site-icon" width="32" height="32">

      <a href="https://pytorch.org/get-started/locally/" 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/locally/" target="_blank" rel="noopener nofollow ugc">Start Locally</a></h3>

  <p>Start Locally</p>


  </article>

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

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


AlphaBetaGamma96: <p>Following on from <a class="mention" href="/u/alexander_de">@Alexander_DE</a>’s reply, you should be able to resolve the issue by installing PyTorch2.2 instead of the current latest version 2.3.</p>
<p>The previous install commands can be found on: <a href="https://pytorch.org/get-started/previous-versions/" class="inline-onebox" rel="noopener nofollow ugc">Previous PyTorch Versions | PyTorch</a></p>
<p>More information on debugging this issue can be found on this thread here: <a href="https://discuss.pytorch.org/t/cuda-not-available-for-rtx-6000-mobile/202160/9" class="inline-onebox">Cuda not available for RTX 6000 mobile - #9 by AlphaBetaGamma96</a></p>

ptrblck: <p>Cross-posting also <a href="https://discuss.pytorch.org/t/cuda-not-available-for-rtx-6000-mobile/202160/12">the GitHub issue</a> tracking it.</p>

kirbaz: <p>Hello! I solved this problem. Add env path …\AppData\Roaming\Python\Library\bin\</p>

chenming7777: <p>its not working… also changing the version to torch==2.2.2 cant even show  have cuda</p>

chenming7777: <p>help its not working as well</p>

kerwin_Zhou: <p>Thnaks, I solved it with your suggestion.</p>

SilverGreen93: <p>So I had this problem also, version 2.2.1 works, but version 2.3.0 does not.<br>
Is this a bug that needs fixing? What is the root cause of this? I want to keep my packages updated and there are some dependencies that will require to keep up with the latest.</p>

rohan1: <p>thanks after countless hours your suggestion worked</p>

Rishabh_Kausish: <p>Faced the same issue.</p>
<p>Resolved it using:</p>
<p>pip install torch==2.2.0 torchvision==0.17.0 torchaudio==2.2.0</p>

Tai_Ph_m_t_n: <p>Thnaks, I solved it with your suggestion</p>

Joseph1: <p>thank you, your method worked for me</p>

Binayak_Koirala: <p>Thank you dude for solving my 5 hrs issue. Hope you have a great time ahead.</p>