[PR #110] [CLOSED] Fix VBAR reservation using requested size instead of VRAM capacity #121

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

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-aimdo/pull/110
Author: @tvukovic-amd
Created: 9/8/2026
Status: ❌ Closed

Base: master ← Head: fix/vbar-no-capacity-clamp


📝 Commits (2)

  • b326f4a Fix VBAR reservation using requested size instead of VRAM capacity
  • 2d4e2af Fix oversized VBAR allocations

📊 Changes

2 files changed (+15 additions, -4 deletions)

View changed files

📝 comfy_aimdo/model_vbar.py (+5 -1)
📝 src/model-vbar.c (+10 -3)

📄 Description

Summary

Fix --enable-dynamic-vram crash on Windows ROCm caused by GPU virtual address space exhaustion in comfy-aimdo VBAR allocation.

Problem

On Windows ROCm, --enable-dynamic-vram crashes with:

  OSError: exception: access violation reading 0x00000000000000E0

vbar_allocate clamps the virtual address reservation to vram_capacity (physical VRAM). When a model is larger than ~1/10 of device capacity, the clamp reserves the entire device capacity as address space instead of the requested size.

On large-VRAM devices, the clamped reservations can consume several times the actual model size in GPU virtual address space. Once exhausted, hipMemAddressReserve does not return hipErrorOutOfMemory — it access-violates at 0xE0.

Fix

Remove the vram_capacity clamp. Reserve exactly the page-rounded size the caller requested.

This PR should land together with the https://github.com/Comfy-Org/ComfyUI/pull/16174 that sizes VBARs from compute-dtype weight spans instead of model_size() * 10.


🔄 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/110 **Author:** [@tvukovic-amd](https://github.com/tvukovic-amd) **Created:** 9/8/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/vbar-no-capacity-clamp` --- ### 📝 Commits (2) - [`b326f4a`](https://github.com/Comfy-Org/comfy-aimdo/commit/b326f4a37d379bc9e1efa9e2e623266e46afd1f6) Fix VBAR reservation using requested size instead of VRAM capacity - [`2d4e2af`](https://github.com/Comfy-Org/comfy-aimdo/commit/2d4e2af3bcacd98892c8cebecd96294d1ff7cbc5) Fix oversized VBAR allocations ### 📊 Changes **2 files changed** (+15 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `comfy_aimdo/model_vbar.py` (+5 -1) 📝 `src/model-vbar.c` (+10 -3) </details> ### 📄 Description ## Summary Fix `--enable-dynamic-vram` crash on Windows ROCm caused by GPU virtual address space exhaustion in comfy-aimdo VBAR allocation. ## Problem On Windows ROCm, `--enable-dynamic-vram` crashes with: OSError: exception: access violation reading 0x00000000000000E0 `vbar_allocate` clamps the virtual address reservation to `vram_capacity` (physical VRAM). When a model is larger than ~1/10 of device capacity, the clamp reserves the *entire device capacity* as address space instead of the requested size. On large-VRAM devices, the clamped reservations can consume several times the actual model size in GPU virtual address space. Once exhausted, `hipMemAddressReserve` does not return `hipErrorOutOfMemory` — it access-violates at `0xE0`. ## Fix Remove the `vram_capacity` clamp. Reserve exactly the page-rounded size the caller requested. This PR should land together with the https://github.com/Comfy-Org/ComfyUI/pull/16174 that sizes VBARs from `compute-dtype` weight spans instead of `model_size() * 10`. --- <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:45 +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#121
No description provided.