Skip to content

feat: detect AMD/ROCm GPUs and install ROCm PyTorch for extensions#235

Open
samuk10 wants to merge 2 commits into
lightningpixel:mainfrom
samuk10:feat/detect-rocm-amd
Open

feat: detect AMD/ROCm GPUs and install ROCm PyTorch for extensions#235
samuk10 wants to merge 2 commits into
lightningpixel:mainfrom
samuk10:feat/detect-rocm-amd

Conversation

@samuk10

@samuk10 samuk10 commented Jul 26, 2026

Copy link
Copy Markdown

What & why

Modly's GPU detection (detectGpuInfo in electron/main/ipc-handlers.ts) only probes nvidia-smi. On an AMD machine there is no NVIDIA GPU, so it reports accelerator: 'cpu' and the extension installer passes the default torch_flavor: 'cuda' — extensions then either fail to install PyTorch or install a CPU build, and the AMD GPU sits unused.

Pure-PyTorch extensions like Hunyuan3D 2 Mini already support ROCm in their setup.py (torch_flavor == "rocm" → ROCm wheel index), but the app never passes that flag, so the branch is unreachable today.

The fix

Add detectRocmGpu() (Linux-only): when ROCm userspace is installed (/opt/rocm or rocminfo present) and rocminfo reports an AMD GPU agent (gfx*), and no NVIDIA GPU is present, pass torch_flavor: 'rocm' to the extension's setup.py.

  • No change for NVIDIA users (the ROCm branch only triggers when gpuSm === 0).
  • No change for macOS / Apple Silicon.
  • Minimal: one new helper + one field in the existing runExtensionSetup args (no signature or call-site changes).

Tested

AMD Radeon RX 7600 (gfx1102), Ubuntu 26.04, ROCm 6.3:

  • Setup log now shows [setup] -> PyTorch + ROCm 7.2 (previously fell through to cu118/CPU and failed on Python 3.14).
  • Hunyuan3D 2 Mini installs, loads on the GPU, and generates meshes end-to-end.

Docs

Adds docs/rocm-amd-setup.md — a step-by-step guide covering the two environment prerequisites (Python 3.12 to avoid the 3.14 PyTorch wheel gap; ROCm via TheRock, which officially supports gfx1102), how to run, and which extensions work on AMD — including why TripoSG doesn't (its diso dependency is a CUDA-only C++ extension).

🤖 Generated with Claude Code

samuk10 and others added 2 commits July 26, 2026 13:02
When no NVIDIA GPU is present but ROCm userspace is installed and rocminfo reports an AMD GPU (gfx*), pass torch_flavor='rocm' to extension setup.py so PyTorch is installed from the ROCm wheel index instead of falling through to CUDA/CPU. Enables pure-PyTorch extensions (e.g. Hunyuan3D Mini) on AMD GPUs like the Radeon RX 7600 (gfx1102).

Co-Authored-By: Claude <noreply@anthropic.com>
Step-by-step for running Modly's pure-PyTorch extensions on AMD GPUs via ROCm: Python 3.12 (avoid the 3.14 wheel gap), ROCm/TheRock (gfx1102 supported), and the new app-side ROCm detection. Notes which extensions work on AMD and which (TripoSG/disso) do not.

Co-Authored-By: Claude <noreply@anthropic.com>
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