Skip to content

Add torchvulkan fallback - #27

Open
BishopWolf wants to merge 2 commits into
fepegar:mainfrom
BishopWolf:add-torchvulkan-fallback
Open

BishopWolf wants to merge 2 commits into
fepegar:mainfrom
BishopWolf:add-torchvulkan-fallback

Conversation

@BishopWolf

@BishopWolf BishopWolf commented Nov 5, 2026 •

Copy link
Copy Markdown

Closes #26

This successfully adds a torchvulkan gpu to my Slicer, the ci tests all pass. For the final merge commit I will remove the Vulkan button so the "Install PyTorch" button will be completely automatic, now is deliberately separate for testing.

Capture d'écran_20261105_094912

However I can't test it fully since TotalSegmentator must be made aware of the vulkan device, it currently fails to detect it.

Capture d'écran_20261105_095244

BishopWolf and others added 2 commits November 5, 2026 09:34
CUDA is the only GPU backend PyTorch can use, so systems with an AMD, Intel, or
Apple GPU compute on the CPU even when a Vulkan driver is available. Install the
experimental torchvulkan backend only in that case: the PyTorch version required
by torchvulkan is selected when PyTorch is installed, an incompatible PyTorch is
never changed without asking the user for an upgrade, and computation falls back
to the CPU when torchvulkan cannot be installed or loaded. The module now reports
the Vulkan status and getDevice() returns the Vulkan device when it is usable.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Made and reviewed in a real Slicer environment.

Assisted by : DeepSeek 4.1 Flash 10/17
@BishopWolf

Copy link
Copy Markdown
Author

@lassoan
I have modified locally the TotalSegmentator extension so it uses the vulkan device and it really works! it works so well that I may send a PR there if you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add torchvulkan as fallback when no cuda is present

1 participant