Conversation
Cherry-picked pyqlsa's ROCm implementation (commits 7e6f796, e2343fe) and applied fixes on top: - Fix ROCm app incorrectly named "cuda" in nix/apps.nix (would shadow CUDA) - Fix mkPython passing boolean `false` instead of string `"none"` for gpuSupport - Fix flake description still referencing v0.12.2 instead of v0.14.2 - Fix README Podman ROCm example referencing latest-cuda instead of latest-rocm - Fix ROCm torchaudio missing FFmpeg/sox ignore deps (matching CUDA pattern) - Resolve all TODO/XXX review comments left by pyqlsa - Update CHANGELOG, CLAUDE.md, and README with ROCm documentation - Fix CHANGELOG footer links (missing v0.14.2 link, Unreleased pointing to v0.12.2) Closes #27 Co-authored-by: pyqlsa <26353308+pyqlsa@users.noreply.github.com>
Greptile SummaryThis PR adds comprehensive AMD ROCm GPU support to comfyui-nix, enabling AMD GPU acceleration via pre-built PyTorch wheels (ROCm 7.1, tested on gfx1100/7900 XTX). Major changes:
Implementation quality:
The refactor from boolean to enum is a clean architectural improvement that avoids future boolean parameter proliferation. Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| .github/workflows/build.yml | Added ROCm variant to CI matrix with proper build parallelism limits and manifest creation |
| flake.nix | Replaced boolean cudaSupport with enum gpuSupport and added ROCm packages and dev shell |
| nix/modules/comfyui.nix | Replaced boolean cuda option with enum gpuSupport for CUDA/ROCm/none selection |
| nix/python-overrides.nix | Added ROCm PyTorch wheel overrides (torch, torchvision, torchaudio) with proper autopatchelf configuration |
| nix/versions.nix | Added PyTorch ROCm 7.1 wheel URLs and hashes for torch 2.10.0, torchvision 0.25.0, torchaudio 2.10.0 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User: nix run .#rocm] --> B{gpuSupport Parameter}
B -->|"none"| C[CPU PyTorch from nixpkgs]
B -->|"cuda"| D[CUDA PyTorch 2.5.1 + cu124 wheels]
B -->|"rocm"| E[ROCm PyTorch 2.10.0 + rocm7.1 wheels]
E --> F[nix/python-overrides.nix]
F --> G[torch wheel from pytorch.org]
F --> H[torchvision wheel]
F --> I[torchaudio wheel]
G --> J[autoPatchelfHook]
H --> J
I --> J
J --> K[ROCm libs: xz, zstd, bzip2]
J --> L[Ignore bundled libs: libamdhip64, libMIOpen, etc.]
E --> M[NixOS Module]
M --> N{services.comfyui.gpuSupport}
N -->|"rocm"| O[pkgs.comfy-ui-rocm]
N -->|"cuda"| P[pkgs.comfy-ui-cuda]
N -->|"none"| Q[pkgs.comfy-ui]
O --> R[systemd service with rocminfo in path]
E --> S[Docker Image]
S --> T[comfy-ui:rocm]
T --> U[--device /dev/kfd --device /dev/dri]
E --> V[CI Pipeline]
V --> W[Build with max-jobs 1, cores 2]
W --> X[Push to ghcr.io/utensils/comfyui-nix:latest-rocm]
Last reviewed commit: 6d9a281
|
🥳 |
Contributor
|
I can validate that |
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.
Summary
nix run .#rocmapp,dockerImageRocm, NixOS modulegpuSupport = "rocm"option, andnix develop .#rocmdev shellcudaSupportboolean withgpuSupportenum ("cuda","rocm","none") across flake, packages, and NixOS moduleghcr.io/utensils/comfyui-nix:latest-rocm)Cherry-picked from @pyqlsa's draft PR #28 (preserving authorship), with bug fixes and cleanup applied on top.
Closes #27
Changes from PR #28
cudainnix/apps.nix(would shadow the actual CUDA app)mkPythonpassing booleanfalseinstead of string"none"forgpuSupportlatest-cudainstead oflatest-rocmautoPatchelfIgnoreMissingDeps(matching CUDA pattern)[0.14.2]link,[Unreleased]pointing to v0.12.2)Credit
ROCm implementation by @pyqlsa — thank you! Their commits are preserved with original authorship.
cc @pyqlsa @mr-bo-jangles
Test plan
nix flake checkpasses (ruff, pyright, nixfmt, shellcheck, package build)nix build .— CPU default buildsnix build .#cuda— CUDA variant builds (regression check)nix build .#rocm— ROCm variant buildsnix run .#rocm— hardware test on AMD GPU (needs @pyqlsa to verify on 7900 XTX)