# Pytorch extension causes crash (Slicer 5.12.2 on Ubuntu 22.04)

**URL:** <https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710>\
**Category:** Support\
**Created:** [July 22, 2026, 9:45am UTC](https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710 "2026-07-22T09:45:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![shai-ikko](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shai-ikko/32/15765_2.png) [@shai-ikko](https://discourse.slicer.org/u/shai-ikko)\
**Post date:** [July 22, 2026, 9:45am UTC](https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710/1 "2026-07-22T09:45:37Z")

</div>

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](https://gist.github.com/shai-ikko/e833d8219b20e14c5c2108176cda17c0) , 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.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 22, 2026, 2:10pm UTC](https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710/2 "2026-07-22T14:10:43Z")

</div>

It would be good to have this in the extension repo issues: [https://github.com/fepegar/SlicerPyTorch](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`)

> **[Get Started](https://pytorch.org/get-started/locally/)**
>
> Set up PyTorch easily with local installation or supported cloud platforms.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [July 22, 2026, 3:04pm UTC](https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710/3 "2026-07-22T15:04:42Z")

</div>

@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…

---

<div class="post-metadata">

**Author:** ![shai-ikko](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shai-ikko/32/15765_2.png) [@shai-ikko](https://discourse.slicer.org/u/shai-ikko)\
**Post date:** [July 23, 2026, 7:44am UTC](https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710/4 "2026-07-23T07:44:09Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/4/b4eefaaf90c3fa7c57dfa50d5adca25bc639c345.png)

---

<div class="post-metadata">

**Author:** ![shai-ikko](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shai-ikko/32/15765_2.png) [@shai-ikko](https://discourse.slicer.org/u/shai-ikko)\
**Post date:** [July 23, 2026, 7:53am UTC](https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710/5 "2026-07-23T07:53:43Z")

</div>

The installation actually did succeed.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/7/a7ece3bd15d89e09df404735886729c45381122a.png)

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

I can import torchvision without crashing from `PythonSlicer`.

```python-repl
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'

```

---

<div class="post-metadata">

**Author:** ![shai-ikko](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shai-ikko/32/15765_2.png) [@shai-ikko](https://discourse.slicer.org/u/shai-ikko)\
**Post date:** [July 23, 2026, 8:58am UTC](https://discourse.slicer.org/t/pytorch-extension-causes-crash-slicer-5-12-2-on-ubuntu-22-04/47710/6 "2026-07-23T08:58:41Z")

</div>

> [@pieper](#):
>
> It would be good to have this in the extension repo issues: [GitHub - fepegar/SlicerPyTorch: This extension contains only a module with some tools to install PyTorch inside Slicer, using the best possible version. · GitHub](https://github.com/fepegar/SlicerPyTorch)

[Torchvision crashes Slicer on Ubuntu · Issue #24 · fepegar/SlicerPyTorch · GitHub](https://github.com/fepegar/SlicerPyTorch/issues/24) Thanks
