GPU not detected Total Segmentation

Dear support,
I’m using TotalSegmentator on a desktop pc with the following hardware features:
Processore: 3,2 GHz Intel Xeon W 16 core
Scheda video: AMD Radeon Pro Vega II 32 GB
Ram: 384 GB 2933 MHz DDR4
Mac OS: Sequoia 15.1.1 (24B91).

No gpu was detected when we apply totalSegmentation. We have two questions about this question:

  1. There is a way to use our GPU or to fix this issue in MacOs environment?
  2. We have a desktop pc with the same features in a Windows environment. Is there a simpler solution for this environment?
    Thanks

TotalSegmentator appears to have added the option for MPS where your Mac Pro AMD Radeon Pro Vega II card supports the mps backend for PyTorch.

It does seem to be a bit on the untested and new side as the following place in the readme hasn’t been updated to reflect the mps option although you can see that --device does allow the “mps” option.

The SlicerTotalSegmentator utilizes the TotalSegmentator python package, but will need to be updated to handle the MPS option as right now if it doesn’t detect a CUDA compatible GPU it will use CPU. See the following code that would need to be updated.

It appears that the MPS backend for PyTorch originally came out for PyTorch 2 with fixes and improvements over time. Since you are on an Intel Mac, you will be stuck on PyTorch 2.2.x as the latest since developers dropped support for it and were instead only going to support macOS on Apple Silicon.

Would you be willing to complete the code changes for SlicerTotalSegmentator and update the documentation for the TotalSegmentator package for your MPS use case? A majority of Slicer users are on Windows, so there has been less of a need for macOS specific tasks. Alternatively, a Windows machine with a CUDA enabled driver would be the easiest environment to immediately begin using.

Thanks a lot for reply. Considering the case of desktop pc with the mentioned hardware features, it is possible to use our GPU with an emulator or other alternative that enables to detect Cuda-compatible GPU and to perform total segmentator with default CONFIGURATION ( NO FORCE CPU)?
THANKS

You could probably use your GPU if you switched from macOS to Linux and then used the ROCm variant of PyTorch, but you are going down the even more less commonly used pathway.

PyTorch is heavily focused on Nvidia GPUs or using the MPS backend on macOS.