Skip to content

Add ROCm support for AMD GPUs - #28

Open
Truth129 wants to merge 1 commit into
fepegar:mainfrom
Truth129:main
Open

Truth129 wants to merge 1 commit into
fepegar:mainfrom
Truth129:main

Conversation

@Truth129

@Truth129 Truth129 commented Nov 13, 2026 •

Copy link
Copy Markdown

Add automatic ROCm (AMD GPU) detection on Linux

Depends on Slicer/light-the-torch#180. Without it, ROCm installs fail because light-the-torch looks for the ROCm dependencies of torch (triton-rocm, rocm, rocm-sdk-*) on PyPI, which only has placeholder packages with those names.

Changes

  • Detect AMD GPUs from the amdgpu kernel driver (/sys/class/kfd/kfd/topology/nodes/*/properties). No system ROCm installation is needed, because PyTorch ROCm wheels include or install the ROCm runtime.
  • New "AMD GPU" row in the module UI that shows the GPU architecture (e.g. gfx1201) or "not found".
  • With "automatic": if an AMD GPU is found and there is no NVIDIA driver, the ROCm backends are passed to light-the-torch, which installs the newest one with available wheels (or falls back to CPU). If an NVIDIA GPU is present, CUDA is still preferred.
  • "show all compatible" also lists the ROCm backends when an AMD GPU is found.

Note: Existing Slicer installs with an older light-the-torch need to uninstall it once so it gets reinstalled from main.

Tested (Slicer 5.13 nightly, Linux, Radeon gfx1201)

  • AMD only: torch 2.15.0+rocm10.0 and torchvision 0.29.2+rocm10.0 resolve correctly
  • AMD and NVIDIA: CUDA is selected
  • No AMD GPU: the UI row shows "not found" and the install behaves as before

@Truth129
Truth129 marked this pull request as ready for review November 13, 2026 15:09
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.

1 participant