# Error While using 'Total Segmentator'

**URL:** <https://discourse.slicer.org/t/error-while-using-total-segmentator/26925>\
**Category:** Support\
**Created:** [December 26, 2022, 3:07pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925 "2022-12-26T15:07:32Z")\
**Posts on this page:** 16\
**Page:** 2

<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:** [January 14, 2023, 1:25am UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/22 "2023-01-14T01:25:13Z")

</div>

@rbumm  
Does total segmentator require cuDNN beyond regular cuda installation? I am getting this error message on Ubuntu 22.04 with Slicer 5.2.1. Cuda 12.0 is installed, and pytorch extension installed cu118 enabled torch.

```auto
Traceback (most recent call last):
  File "/home/exouser/Slicer/bin/Python/slicer/util.py", line 2961, in tryWithErrorDisplay
    yield
  File "/home/exouser/Slicer/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py", line 258, in onApplyButton
    self.logic.process(self.ui.inputVolumeSelector.currentNode(), self.ui.outputSegmentationSelector.currentNode(),
  File "/home/exouser/Slicer/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py", line 647, in process
    self.logProcessOutput(proc)
  File "/home/exouser/Slicer/NA-MIC/Extensions-31317/TotalSegmentator/lib/Slicer-5.2/qt-scripted-modules/TotalSegmentator.py", line 556, in logProcessOutput
    raise CalledProcessError(retcode, proc.args, output=proc.stdout, stderr=proc.stderr)
subprocess.CalledProcessError: Command '['/home/exouser/Slicer/bin/../bin/PythonSlicer', '/home/exouser/Slicer/lib/Python/bin/TotalSegmentator', '-i', '/tmp/Slicer-exouser/ __SlicerTemp__ 2023-01-14_01+20+25.853/total-segmentator-input.nii', '-o', '/tmp/Slicer-exouser/ __SlicerTemp__ 2023-01-14_01+20+25.853/segmentation', '--ml', '--task', 'total', '--fast']' returned non-zero exit status 1.

```

and then there is this error on the module pane:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/9/d926d8afd5048e9656fc092f20d11982e874bd4d.jpeg)

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [January 14, 2023, 1:45am UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/23 "2023-01-14T01:45:19Z")

</div>

Hi

I think you need CUDA 11.6 or 11.7

> **[PyTorch](https://pytorch.org/get-started/locally/)**
>
> An open source machine learning framework that accelerates the path from research prototyping to production deployment.

Hope it helps

---

<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:** [January 14, 2023, 1:49am UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/24 "2023-01-14T01:49:01Z")

</div>

Thanks I already got the cuda part taken care of. PyTorch worked fine. The issue was indeed the missing cuDNN library, which is not part of the CUDA package and you actually have to register with Nvidia, agree to their terms and download it. [https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html)

I can confirm that after installing it (cuDNN8.7.0), everything it worked fine. It is shame though that Nvidia makes getting cuDNN so hard.

---

<div class="post-metadata">

**Author:** ![rbumm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rbumm/32/9404_2.png) [@rbumm](https://discourse.slicer.org/u/rbumm)\
**Post date:** [January 14, 2023, 8:44am UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/25 "2023-01-14T08:44:31Z")

</div>

@muratmaga great that it works now, on my windows systems cudnn and it´s folders seem to be present automatically on every Python where TotalSegmentator is installed, and there has never be the need for separate downloads. Would be interesting to find out why it was necessary on your system …

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 14, 2023, 4:26pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/26 "2023-01-14T16:26:08Z")

</div>

I use Windows, too, and I don’t remember ever having to manually install cuDNN either. Nobody else has reported this issue until now either. So, probably this manual cuDNN installation is only needed on certain Linux systems.

---

<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:** [January 14, 2023, 4:43pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/27 "2023-01-14T16:43:07Z")

</div>

I’ve run into this before too. The Nvidia cuDNN instructions clearly say you need to get it via the developer program for both windows and linux: [Installation Guide - NVIDIA Docs](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#download-windows)).

But apparently this is bundled in pytorch: [How to check if torch uses cuDNN - #3 by timonbimon - PyTorch Forums](https://discuss.pytorch.org/t/how-to-check-if-torch-uses-cudnn/21933/3)

> “if you want to use pytorch with an NVIDIA GPU, all you need to do is install pytorch binaries and start using it. We ship with everything in-built (pytorch binaries include CUDA, CuDNN, NCCL, MKL, etc.).”

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 14, 2023, 4:48pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/28 "2023-01-14T16:48:55Z")

</div>

@muratmaga is it possible that your CUDA version is not 11.6 or 11.7?

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [January 14, 2023, 5:10pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/29 "2023-01-14T17:10:09Z")

</div>

> [@muratmaga](#):
>
> Ubuntu 22.04 with Slicer 5.2.1. Cuda 12.0 is installed,

Latest Cuda (Cuda 12) is not supported with latest PyTorch binaries.

> **[PyTorch for Cuda 12](https://discuss.pytorch.org/t/pytorch-for-cuda-12/169447/2)**
>
> You should be able to build PyTorch from source using CUDA 12.0, but the binaries are not ready yet (and the nightlies with CUDA 11.8 were just added ~2 weeks ago). If you decide to build from source, note that a few fixes still need to land...

---

<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:** [January 15, 2023, 3:19am UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/30 "2023-01-15T03:19:09Z")

</div>

> [@jamesobutler](#):
>
> Latest Cuda (Cuda 12) is not supported with latest PyTorch binaries

That’s interesting because I used the pytorch extension to install and it clearly brought torch with cuda (11.8) but without the cudnn.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 15, 2023, 1:01pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/31 "2023-01-15T13:01:07Z")

</div>

@muratmaga Have you installed CUDA? Which version? What CUDA version do you see in pytorch util module in Slicer (cuNNN)?

---

<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:** [January 15, 2023, 5:14pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/32 "2023-01-15T17:14:55Z")

</div>

Yes, Cuda 12.0 is installed on this machine. This is what torch reports in Slicer through python:

```auto
>>> torch. __version__'1.13.1+cu117'

```

(I thought it was 118, but were mistaken).

And this is from pyutils  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/b/5b7a29e02bf84735fd5e0b3f7c1e8e719ef8512d.png)

---

<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:** [January 15, 2023, 5:29pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/33 "2023-01-15T17:29:48Z")

</div>

> [@muratmaga](#):
>
> Yes, Cuda 12.0 is installed on this machine. This is what torch reports in Slicer through python:

A bit more clarification.

I wasn’t aware that pytorch extension (through light the torch) bring all the necessary cuda/cudnn and stuff internally, without requiring the OS based manual installation. I can confirm that this works (and much more simply. yay).

However, if you do have CUDA manually installed and it is path is listed on your LD\_LIBRARY\_PATH, this seems to interfere with the pyTorch util detection, and you will need to provide the cuDNN manually.

Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 15, 2023, 8:41pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/34 "2023-01-15T20:41:09Z")

</div>

Thanks for the clarification. Do you mean that on linux you don’t event need to install CUDA, but only the NVIDIA drivers?

---

<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:** [January 15, 2023, 10:13pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/35 "2023-01-15T22:13:04Z")

</div>

Yep! That’s what the link @pieper cited said, and I can confirm it is indeed the case.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 16, 2023, 7:01pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/36 "2023-01-16T19:01:33Z")

</div>

3 posts were split to a new topic: [Use AMD ROCm for TotalSegmentator](https://discourse.slicer.org/t/use-amd-rocm-for-totalsegmentator/27270)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 15, 2023, 8:49pm UTC](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925/37 "2023-02-15T20:49:29Z")

</div>

A post was merged into an existing topic: [Total segmentor module showing errors](https://discourse.slicer.org/t/total-segmentor-module-showing-errors/27834/3)

[Previous page](https://discourse.slicer.org/t/error-while-using-total-segmentator/26925.md?page=1)
