ROCm / Strix Halo (gfx1151): HIPBLAS_STATUS_ALLOC_FAILED in torch.linalg.solve during UV Unwrap (parameterize.py)
- Dominant language
- Python
- Stars
- 133k
- Forks
- 15.7k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 158
Description
### Custom Node Testing
- [x] I have tried disabling custom nodes and the issue persists (see [how to disable custom nodes](https://docs.comfy.org/troubleshooting/custom-node-issues#step-1%3A-test-with-all-custom-nodes-disabled) if you need help)
### Expected Behavior
Environment:
OS: Linux
GPU / Platform: AMD Strix Halo / Ryzen AI Max 395 (gfx1151)
VRAM / Unified Memory: 128 GB Unified RAM (GTT)
PyTorch / ROCm Version: PyTorch with ROCm 7.2.3
During the UV Unwrap / LSCM parametrization step in comfy_extras/mesh3d/uv_unwrap/parameterize.py, torch.linalg.solve(AtA, Atb) fails with HIPBLAS_STATUS_ALLOC_FAILED when called on GPU via ROCm.
Even with 128 GB Unified Memory (where total memory usage is around ~12 GB), hipblasDgetrfBatched fails to allocate memory for the sparse LSCM linear system matrix. This happens even on smaller decimated meshes (~2.5M vertices / 5.2M faces or lower depending on weld_distance).
Error Log:
```
[INFO] [GetMeshInfo]
Vertices: 2,518,076 (2.52M)
Faces: 5,282,018 (5.28M)
Attributes: none
[ERROR] !!! Exception during processing !!! CUDA error: HIPBLAS_STATUS_ALLOC_FAILED when calling `hipblasDgetrfBatched( handle, n, dA_array, ldda, ipiv_array, info_array, batchsize)`
File "/home/aadmin/ComfyUI/comfy_extras/nodes_mesh_postprocess.py", line 2723, in execute
vmapping, indices, uvs = _uv_unwrap(...)
File "/home/aadmin/ComfyUI/comfy_extras/nodes_mesh_postprocess.py", line 2594, in _uv_unwrap
lscm_uv = _uv_param.lscm_charts_batch(...)
File "/home/aadmin/ComfyUI/comfy_extras/mesh3d/uv_unwrap/parameterize.py", line 338, in lscm_charts_batch
x = torch.linalg.solve(AtA, Atb).cpu().numpy()
RuntimeError: CUDA error: HIPBLAS_STATUS_ALLOC_FAILED when calling `hipblasDgetrfBatched( handle, n, dA_array, ldda, ipiv_array, info_array, batchsize)`
```
if I change :
In comfy_extras/mesh3d/uv_unwrap/parameterize.py (line 338):
# Change this:
# x = torch.linalg.solve(AtA, Atb).cpu().numpy()
# To this:
x = torch.linalg.solve(AtA.cpu(), Atb.cpu()).numpy()
it works fine.
But in fact I have 128GB gtt vram.
So I don't understand why it throws a HIPBLAS_STATUS_ALLOC_FAILED error.
### Actual Behavior
provided in description
### Steps to Reproduce
provided in description
### Debug Logs
```powershell
provided in description
```
### Other
_No response_
Contributor guide
Research direction
Start with comfy_extras/mesh3d/uv_unwrap/parameterize.py at line 338, then trace its call from comfy_extras/nodes_mesh_postprocess.py lines 2594 and 2723. Run the reported UV unwrap on the AMD Strix Halo setup and compare the GPU solve with the working CPU solve; done means the mesh completes without HIPBLAS_STATUS_ALLOC_FAILED while preserving the unwrap result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100