[PR #84] [CLOSED] bugfix: Detect the vendor from torch's hip/cuda build variables #107

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

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-aimdo/pull/84
Author: @glop102
Created: 8/8/2026
Status: ❌ Closed

Base: master ← Head: fix/vendor-detect-source-builds


📝 Commits (1)

  • 97ca476 Detect the vendor from torch's hip/cuda build variables

📊 Changes

1 file changed (+13 additions, -0 deletions)

View changed files

📝 comfy_aimdo/control.py (+13 -0)

📄 Description

Checking for +rocm or +cu is not a stable way to detect which vendor build is in use. That suffix is only applied for official builds and if you just do a naive source build or have a slightly bespoke build system that builds from source, it will not contain that suffix. (Specifically building from nix and it does not contain it)

Having a local build of torch which does not have the suffix leads to not detecting rocm correctly, and so enabling --enable-dynamic-vram just errors out and falls back since it tries to use the wrong .so for nvidia which obviously fails to load. aimdo_find_loaded_module: failed to find an already-loaded module

torch/version.py already defines hip and cuda for the build it came from, and detect_vendor() is executing that exact file, so read them there.

Checked against a source-built ROCm torch and that the dynamic vram does work with my nix build version of comfyui and ROCM torch


🔄 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/84 **Author:** [@glop102](https://github.com/glop102) **Created:** 8/8/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/vendor-detect-source-builds` --- ### 📝 Commits (1) - [`97ca476`](https://github.com/Comfy-Org/comfy-aimdo/commit/97ca476cf5a523b618d059f26830c6fab7edf488) Detect the vendor from torch's hip/cuda build variables ### 📊 Changes **1 file changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `comfy_aimdo/control.py` (+13 -0) </details> ### 📄 Description Checking for +rocm or +cu is not a stable way to detect which vendor build is in use. That suffix is only applied for official builds and if you just do a naive source build or have a slightly bespoke build system that builds from source, it will not contain that suffix. (Specifically building from nix and it does not contain it) Having a local build of torch which does not have the suffix leads to not detecting rocm correctly, and so enabling --enable-dynamic-vram just errors out and falls back since it tries to use the wrong .so for nvidia which obviously fails to load. `aimdo_find_loaded_module: failed to find an already-loaded module` torch/version.py already defines hip and cuda for the build it came from, and detect_vendor() is executing that exact file, so read them there. Checked against a source-built ROCm torch and that the dynamic vram does work with my nix build version of comfyui and ROCM torch --- <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:37 +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#107
No description provided.