When I try to install pytorch through the PyTorch Utils module, I get an error saying no matching distribution found for torch. I have CUDA11.7 and have the newest version of the pytorch module for slicer installed. I’m able to use pytorch outside of slicer just fine, so not sure what the issue is here.
SlicerPyTorch uses the tool light-the-torch to choose a matching distribution. You could try using it yourself in Slicer’s python console and see if there’s a more informative error.
Or skip light-the-torch and copy the desried pip install command from here based on the cuda version, etc. that you want. Then in Slicer’s python console do
slicer.util.pip_install("<your pip install command>")
just omitting the initial “pip install” from the command string.
This worked thanks!! However, it’s running with the CPU. Do you have any tips on getting it running with CUDA? It seems to not be finding my CUDA installation.
Light-the-torch works very robustly. If it cannot find your graphics driver/CUDA then something is wrong/unusual about your system configuration.
What operating system do you use?
What GPU model do you have?
Do you have multiple graphics card in your computer (e.g., NVIDIA discrete GPU + integrated Intel Graphics)? Have you set in your NVIDIA settings to use the high-performance GPU for 3D Slicer (SlicerApp-real.exe)?
What pytorch and NVIDIA driver is reported in PyTorch Utils module?
What do you see if you type
import torch; torch.has_cuda into the Python console in Slicer?
I’m sure it’s something with my system’s configuration. I’ve had issues with all sorts of things using python.
I’m on Windows 10 with a NVIDIA Quadro P4000. I don’t believe I have multiple graphics cards and haven’t touched the NVIDIA settings (not sure where those are). The PyTorch Utils module is still telling me to install PyTorch, but when I click on that button it says “Pytorch 1.13.1+cpu already installed correctly”. Torch.has_cuda returns false.