Comfy-Org / Comfy-Org/ComfyUI

ComfyUI misdetects vram as shared when running on intel macs with dedicated gpu, causing out of memory error

Open
#1,860 2 comments 0 reactions 0 assignees View on GitHub
User Support
Dominant language
Python
Stars
133k
Forks
15.7k
Avg merge
1d 7h
Merged PRs (30d)
158

Description

I got an mac pro with Radeon RX 5700 gpu, so I tried to conduct tests. ComfyUI misdetects vram as shared when running on intel macs with dedicated gpu.
Pytorch is nightly version installed with `pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu`

Here is the wrong part: (look at the word **shared**)
```
(venv) rarogcmex@iMacPro-Denis ComfyUI % python main.py --normalvram --force-fp32 --auto-launch
Total VRAM 32768 MB, total RAM 32768 MB
Forcing FP32, if this improves things please report it.
Set vram state to: SHARED
Device: mps
VAE dtype: torch.float32
Using sub quadratic optimization for cross attention, if you have memory or speed issues try using: --use-split-cross-attention
Starting server
```
I'm not wondering that I got OoM error when I launched SDXL model:
`RuntimeError: MPS backend out of memory (MPS allocated: 11.40 GB, other allocations: 1.77 GB, max allowed: 13.57 GB). Tried to allocate 1024.00 MB on private pool. Use PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 to disable upper limit for memory allocations (may cause system failure).`
Old stable diffusion models fits 8gb and they produce results.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.