[PR #36] [MERGED] Add aarch64/ARM64 Linux build support #75

Closed
opened 2026-10-26 22:24:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-aimdo/pull/36
Author: @digital-shokunin
Created: 4/21/2026
Status: ✅ Merged
Merged: 4/27/2026
Merged by: @rattus128

Base: master ← Head: aarch64-support


📝 Commits (1)

  • ea2dadd Add aarch64/ARM64 Linux build support

📊 Changes

1 file changed (+35 additions, -5 deletions)

View changed files

📝 scripts/build-linux-aimdo.sh (+35 -5)

📄 Description

Summary

  • Detect host architecture at build time (uname -m) and select the appropriate funchook disassembler: capstone for aarch64 (as funchook recommends), distorm for x86_64
  • Auto-detect CUDA include and stub paths on aarch64 (sbsa-linux target), falling back to sensible defaults
  • Allow CUDA_INCLUDE_DIR and CUDA_STUB_DIR env var overrides for non-standard CUDA installations
  • No changes to x86_64 behavior — existing defaults are preserved

Motivation

Resolves #33. The aimdo.so binary is not included in the pip wheel for aarch64, so init_device() fails and ComfyUI falls back to the legacy ModelPatcher with unreliable VRAM estimates. This is particularly impactful on unified-memory devices like the NVIDIA DGX Spark (GB10) where the legacy patcher frequently offloads entire models to CPU despite having 120+ GB of usable VRAM.

Test environment

  • NVIDIA DGX Spark (GB10, compute capability 12.1)
  • Ubuntu 24.04 aarch64, CUDA 13.0, driver 580.142
  • gcc 13.3.0, cmake 3.28.3
  • funchook 1.1.3 with capstone disassembler
  • ComfyUI 0.19.3+ with comfy-aimdo 0.2.12

Build and runtime output:

aimdo: src-posix/cuda-funchooks.c:62:DEBUG:aimdo_setup_hooks: hooks successfully installed
aimdo: src/control.c:138:INFO:comfy-aimdo inited for GPU: NVIDIA GB10 (VRAM: 122566 MB)
DynamicVRAM support detected and enabled

Test plan

  • Native build on aarch64 (DGX Spark) — compiles without errors
  • init_device(0) returns True with active CUDA context
  • ComfyUI logs "DynamicVRAM support detected and enabled" on startup
  • Verify x86_64 build is unaffected (no aarch64 hardware change to x86 path)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-aimdo/pull/36 **Author:** [@digital-shokunin](https://github.com/digital-shokunin) **Created:** 4/21/2026 **Status:** ✅ Merged **Merged:** 4/27/2026 **Merged by:** [@rattus128](https://github.com/rattus128) **Base:** `master` ← **Head:** `aarch64-support` --- ### 📝 Commits (1) - [`ea2dadd`](https://github.com/Comfy-Org/comfy-aimdo/commit/ea2dadd827f02cef0a6070b57b6315d6a66805db) Add aarch64/ARM64 Linux build support ### 📊 Changes **1 file changed** (+35 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `scripts/build-linux-aimdo.sh` (+35 -5) </details> ### 📄 Description ## Summary - Detect host architecture at build time (`uname -m`) and select the appropriate funchook disassembler: **capstone** for aarch64 (as funchook recommends), **distorm** for x86_64 - Auto-detect CUDA include and stub paths on aarch64 (`sbsa-linux` target), falling back to sensible defaults - Allow `CUDA_INCLUDE_DIR` and `CUDA_STUB_DIR` env var overrides for non-standard CUDA installations - No changes to x86_64 behavior — existing defaults are preserved ## Motivation Resolves #33. The `aimdo.so` binary is not included in the pip wheel for aarch64, so `init_device()` fails and ComfyUI falls back to the legacy ModelPatcher with unreliable VRAM estimates. This is particularly impactful on unified-memory devices like the NVIDIA DGX Spark (GB10) where the legacy patcher frequently offloads entire models to CPU despite having 120+ GB of usable VRAM. ## Test environment - NVIDIA DGX Spark (GB10, compute capability 12.1) - Ubuntu 24.04 aarch64, CUDA 13.0, driver 580.142 - gcc 13.3.0, cmake 3.28.3 - funchook 1.1.3 with capstone disassembler - ComfyUI 0.19.3+ with comfy-aimdo 0.2.12 Build and runtime output: ``` aimdo: src-posix/cuda-funchooks.c:62:DEBUG:aimdo_setup_hooks: hooks successfully installed aimdo: src/control.c:138:INFO:comfy-aimdo inited for GPU: NVIDIA GB10 (VRAM: 122566 MB) DynamicVRAM support detected and enabled ``` ## Test plan - [x] Native build on aarch64 (DGX Spark) — compiles without errors - [x] `init_device(0)` returns `True` with active CUDA context - [x] ComfyUI logs "DynamicVRAM support detected and enabled" on startup - [ ] Verify x86_64 build is unaffected (no aarch64 hardware change to x86 path) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:24:20 +00:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-aimdo#75
No description provided.