Pytorch extension causes crash (Slicer 5.12.2 on Ubuntu 22.04)

Hi,

I’m having trouble with the PyTorch extension. On a fresh Slicer 5.12.2 installation, I install the extension, open it, and tell it to install pytorch using the default (automatic) backend. The installation supposedly succeeds, and the application (the whole Slicer) crashes.

After this, if I open this Slicer, and navigate to the pytorch extension, the app crashes.

I put a log file from the app at Slicer log file · GitHub , after I set the Python console logging level to “Debug” before doing all of this. In this run, I also clicked “uninstall pytorch” first, although it was a fresh installation, in hope to clean up any leftovers from previous installations that might live outside the app folder.

I will be happy to provide further input, and will be happy to take any help in debugging it.

It would be good to have this in the extension repo issues: https://github.com/fepegar/SlicerPyTorch

We have troubles from time to time with PyTorch, but I don’t think anyone has a magic formula to keep up with all the changes.

Can you try the pytorch local install instructions with Slicer’s python? (PythonSlicer -m pip)

@shai-ikko it looks like it is bringing cuda 13.0.

  1. Does your Nvidia driver support cuda 13.0 (this shouldn’t be the case)
  2. Does it help if you try to install 12.8? (uninstall 13.0 and then manually choose cu128 fromt he availablity list).

That’s as far as I can suggest. Otherwise as @pieper said it is a game of whack a mole until you find a combination that works…

Thanks for the suggestion. The Nvidia driver does seem to support cuda 13.0.

The installation actually did succeed.

But importing torchvision crashes the app. I will try again and report.

I can import torchvision without crashing from PythonSlicer.

Python 3.12.10 (main, Jul 15 2026, 15:05:10) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torchvision
>>> torchvision.__version__
'0.28.0+cu130'
>>> torchvision.version.cuda
13000
>>> torchvision.version.git_version
'8fb87713a24951e639c494b0f2a8a81b5f8e33a6'

Torchvision crashes Slicer on Ubuntu · Issue #24 · fepegar/SlicerPyTorch · GitHub Thanks