feat: detect AMD/ROCm GPUs and install ROCm PyTorch for extensions#235
Open
samuk10 wants to merge 2 commits into
Open
feat: detect AMD/ROCm GPUs and install ROCm PyTorch for extensions#235samuk10 wants to merge 2 commits into
samuk10 wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Modly's GPU detection (
detectGpuInfoinelectron/main/ipc-handlers.ts) only probesnvidia-smi. On an AMD machine there is no NVIDIA GPU, so it reportsaccelerator: 'cpu'and the extension installer passes the defaulttorch_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/rocmorrocminfopresent) androcminforeports an AMD GPU agent (gfx*), and no NVIDIA GPU is present, passtorch_flavor: 'rocm'to the extension'ssetup.py.gpuSm === 0).runExtensionSetupargs (no signature or call-site changes).Tested
AMD Radeon RX 7600 (
gfx1102), Ubuntu 26.04, ROCm 6.3:[setup] -> PyTorch + ROCm 7.2(previously fell through to cu118/CPU and failed on Python 3.14).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 supportsgfx1102), how to run, and which extensions work on AMD — including why TripoSG doesn't (itsdisodependency is a CUDA-only C++ extension).🤖 Generated with Claude Code