mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-06-23 16:29:25 +08:00
On AMD APUs (and other integrated GPUs) the "VRAM" reported by torch.cuda.mem_get_info() is the GTT/shared aperture carved out of host RAM, not a dedicated board. ComfyUI starts such devices in NORMAL_VRAM and later sums device VRAM plus system RAM when sizing the model-load budget, so on a UMA part the same physical RAM is counted twice and the inflated budget triggers HIGH_VRAM / gpu-only placement that OOMs the shared pool. Detecting integrated GPUs alone is not enough: integrated parts vary widely in how memory is split. Some (large BIOS UMA carveout, e.g. Strix Halo) report most memory as dedicated mem_info_vram_total, where HIGH_VRAM is right; others report a small VRAM carveout with the bulk in GTT, where SHARED is right. Demoting every integrated GPU to SHARED would regress the dedicated-heavy configs. Key the demotion on the amdgpu mem_info_vram_total vs mem_info_gtt_total ratio: only when an integrated GPU's shared (GTT) pool is at least as large as its dedicated VRAM do we switch it to VRAMState.SHARED. Dedicated-heavy integrated parts and discrete GPUs keep NORMAL_VRAM. When the sysfs totals cannot be read (e.g. NVIDIA Tegra, which has no dedicated VRAM) the device is treated as shared-heavy, matching its true unified memory. Fixes #14274 Signed-off-by: liminfei-amd <91481003+liminfei-amd@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| audio_encoders | ||
| background_removal | ||
| cldm | ||
| comfy_types | ||
| extra_samplers | ||
| image_encoders | ||
| k_diffusion | ||
| ldm | ||
| sd1_tokenizer | ||
| t2i_adapter | ||
| taesd | ||
| text_encoders | ||
| weight_adapter | ||
| bg_removal_model.py | ||
| cli_args.py | ||
| clip_config_bigg.json | ||
| clip_model.py | ||
| clip_vision_config_g.json | ||
| clip_vision_config_h.json | ||
| clip_vision_config_vitl_336_llava.json | ||
| clip_vision_config_vitl_336.json | ||
| clip_vision_config_vitl.json | ||
| clip_vision_siglip2_base_naflex.json | ||
| clip_vision_siglip_384.json | ||
| clip_vision_siglip_512.json | ||
| clip_vision.py | ||
| conds.py | ||
| context_windows.py | ||
| controlnet.py | ||
| deploy_environment.py | ||
| diffusers_convert.py | ||
| diffusers_load.py | ||
| float.py | ||
| gligen.py | ||
| hooks.py | ||
| latent_formats.py | ||
| lora_convert.py | ||
| lora.py | ||
| memory_management.py | ||
| model_base.py | ||
| model_detection.py | ||
| model_management.py | ||
| model_patcher.py | ||
| model_prefetch.py | ||
| model_sampling.py | ||
| multigpu.py | ||
| nested_tensor.py | ||
| ops.py | ||
| options.py | ||
| patcher_extension.py | ||
| pinned_memory.py | ||
| pixel_space_convert.py | ||
| quant_ops.py | ||
| rmsnorm.py | ||
| sample.py | ||
| sampler_helpers.py | ||
| samplers.py | ||
| sd1_clip_config.json | ||
| sd1_clip.py | ||
| sd.py | ||
| sdxl_clip.py | ||
| supported_models_base.py | ||
| supported_models.py | ||
| utils.py | ||