Can I use PyTorch without a CUDA gpu?

jlelane1992: <p>I’ve read elsewhere that you can run PyTorch on a cpu, but I’m trying to run a random library (that uses PyTorch) I found on github. So, I’m unsure all the necessary changes I would need to make in order to make it compatible with a cpu.</p>
<p>The issue I’m running into is that when torch is called, it starts by trying to call the dlopen() function for some DLL files. That’s where the program ends with the error below. I think it’s b/c I don’t have an nvidia card, but I’m not sure as I’m new to PyTorch.</p>
<p>File “C:\Users*<em>\Desktop\VIP*</em>\venv\lib\site-packages\pytorch_lightning_<em>init</em>_.py”, line 28, in <br>
from .trainer.trainer import Trainer<br>
File “C:\Users*<em>\Desktop\VIP*</em>\venv\lib\site-packages\pytorch_lightning\trainer\trainer.py”, line 9, in <br>
import torch<br>
File “C:\Users*<em>\Desktop\VIP*</em>\venv\lib\site-packages\torch_<em>init</em>_.py”, line 81, in <br>
ctypes.CDLL(dll)<br>
File “C:\Users*<em>\Anaconda3\envs*</em>\lib\ctypes_<em>init</em>_.py”, line 364, in <strong>init</strong><br>
self._handle = _dlopen(self._name, mode)<br>
OSError: [WinError 126] The specified module could not be found</p>

eqy: <p>You do not need an NVIDIA GPU to use PyTorch, unless the workload you are running has operations that are only implemented for CUDA devices (e.g., a custom CUDA extension). How did you install PyTorch? It might be worth validating that the install itself is functioning properly before trying a PyTorch Lightning workload.</p>

jlelane1992: <p>Hi, Eqy. Thank you for replying.</p>
<p>So my install wasn’t as easy as “pip install torch==1.5.0”. When I used that, I got an error saying pip couldn’t find that version and that it only has versions 1.7.0+. So I had to pip it from  <a href="https://download.pytorch.org/whl/torch_stable.html" rel="noopener nofollow ugc">https://download.pytorch.org/whl/torch_stable.html</a> along with torchvision==0.6.0.</p>
<p>But when I run the program at the command line (using the authors instructions), it says that some DLL modules could not be found. That was when the program was calling the <strong>init</strong>.py file for the torch module. I was getting lost beyond that though.</p>
<p>How can I validate the install was clean?</p>

eqy: <p>Note that 1.5.0 is a very old version at this point. Is there a reason that you need it in particular rather than a newer version?</p>
<p>I would start by trying simple operations and examples in PyTorch and seeing that they execute without errors to validate your install.</p>

jlelane1992: <p>I’m actually trying to run a library I found on github that makes use of pytorch. Its requirements require this version. Should I just try a newer version of torch and hope for the best (or I guess worst too would be just to reconfigure the necessary parts of the library). I honestly think it’s related to my GPU though.</p>

eqy: <p>My intuition is that this looks tricky as from your directory paths I assume you are on a WSL/WSL2 system. My experience is that more recent versions of PyTorch + WSL2 have greatly improved support so I would try a newer version if possible.</p>

jlelane1992: <p>I’ll give that a shot and reach back out here if I run into more problems. Thanks!</p>