Skip to content

[Bug] AMD Strix Halo APU: model loading incorrectly restricted to system RAM (22 GB) instead of GPU memory (110 GB free) #6834

Closed

Description

@jerrydong1988

Description

On AMD Strix Halo (Radeon 8060S, gfx1151) with 128 GB unified memory and bare-metal Windows + ROCm, Unsloth Studio refuses to load a 21.3 GB GGUF model with the error:

This model needs about 22 GB but only about 19 GB of memory is available. On a unified-memory APU the weights load into system RAM

However, the GPU has 110 GB free (torch.cuda.mem_get_info() reports 115.8 GB total). The model should be loaded into GPU memory, not restricted to system RAM.

Root Cause

In studio/backend/core/inference/llama_cpp.py:

  1. _amd_apu_wants_unified_memory() (line 2031) returns True for gfx1150/gfx1151 architectures
  2. When True, lines 5361-5366 force the model to be checked against system RAM (psutil.virtual_memory().available) and refuse loading if it doesn't fit
  3. The GPU memory check is completely bypassed — even though ROCm reports 110 GB free
# Line 5361-5366: the problematic logic
if model_size is not None and self._amd_apu_wants_unified_memory(gpu_indices):
    _ram_msg = self._apu_ram_shortfall_message(
        model_size, self._available_system_memory_mib()  # ← system RAM, not GPU!
    )
    if _ram_msg:
        raise RuntimeError(_ram_msg)

Why this is wrong

On bare-metal Windows with ROCm, the GPU has direct access to unified memory. The model can and should be loaded into GPU memory via --no-mmap or Vulkan backend. The system RAM check is only appropriate for:

  • WSL (where the VM has a RAM cap)
  • Systems without ROCm GPU access

On this system:

  • GPU memory: 115.8 GB total, 110 GB free ✅
  • System RAM: 34 GB total, 22 GB free ❌ (BIOS allocated ~94 GB to GPU)

Unsloth should use GPU memory when it's available, not force system RAM.

Expected behavior

  1. Check GPU memory first (via torch.cuda.mem_get_info())
  2. If GPU memory is sufficient, load model into GPU memory
  3. Only fall back to system RAM check when GPU memory is insufficient or on WSL

Environment

  • CPU/GPU: AMD Strix Halo (Radeon 8060S, gfx1151), 128 GB unified memory
  • OS: Windows 10, bare-metal (not WSL)
  • ROCm: 7.13.99004 (pip SDK)
  • torch: 2.11.0+rocm7.13.0
  • Unsloth: latest (2026-07-03)

Workaround

Our own llama.cpp builds (Vulkan + HIP) load the same GGUF model successfully on this hardware, using GPU memory directly.

Activity

  1. added a commit that references this issue on Jul 15, 2026
    75da8f8
  2. jerrydong1988 commented on Jul 24, 2026

    @jerrydong1988
    Author

    Workaround confirmed — proof the issue is in the Python logic

    After adjusting BIOS UMA buffer to give 127 GB to system RAM and 1 GB to GPU, the model loads and runs successfully. The same llama.cpp binary, the same GGUF model, the same ROCm runtime — the only difference is that psutil.virtual_memory().available now returns a number large enough to pass the check in llama_cpp.py:5361-5366.

    # This check is the only blocker:
    if model_size is not None and self._amd_apu_wants_unified_memory(gpu_indices):
        _ram_msg = self._apu_ram_shortfall_message(
            model_size, self._available_system_memory_mib()  # ← system RAM, not GPU
        )

    The GPU has 110+ GB free via torch.cuda.mem_get_info() regardless of BIOS setting, but the code never looks at GPU memory on APUs — it forces a system RAM check and refuses to load even when GPU memory is abundant.

    Suggestion

    On bare-metal Windows with ROCm, check GPU memory (torch.cuda.mem_get_info()) first. Only fall back to system RAM when GPU memory is insufficient. The current logic assumes WSL-like constraints that don't apply to bare-metal Windows APU setups.

  3. SergeBertrand commented on Aug 14, 2026

    @SergeBertrand

    Hello

    I’m sharing the fix that works for me on a Beelink GTR9 AMD AI Max+ 395 (8060s, gfx1151, 128 GB, 32/96).
    Hermes + Qwen3.6 solved my memory loading issue under Windows 11 x64. It was actually Hermes that first pointed out this issue #6834 while browsing GitHub.

    Title: Fix #6834: Exclude gfx1151 (Strix Halo) from is_integrated shortcut to use VRAM first

    Body: On bare-metal Windows with ROCm, the driver reports props.is_integrated = True for gfx1151 (Radeon 8060S / Strix Halo).
    This causes _rocm_classify_unified_memory to return (gcn_arch, True) immediately at line 1522, forcing Unsloth to check the model size against available system RAM instead of the dedicated VRAM pool (~96 GB), even when that VRAM is completely free.

    The Fix: Modified studio/backend/core/training/worker.py (line ~1521) to exclude "gfx1151" from the is_integrated shortcut return:

    Before:

    if getattr(props, "is_integrated", 0):
    return gcn_arch, True

    After:

    if getattr(props, "is_integrated", 0):
    # gfx1151 has a full VRAM pool on bare-metal Windows/ROCm;
    # is_integrated=True there is misleading — it should use GPU memory first.
    return gcn_arch, gcn_arch != "gfx1151"

    Result:

    Before: Model loads into system RAM (e.g., ~20 GB limit) → This model needs about 20 GB but only about 20 GB of memory is available
    After: Model loads into dedicated VRAM (~96 GB available) → Loads successfully and runs at expected speeds.
    Note: This specifically targets gfx1151 (Strix Halo). Other APUs like gfx1150/gfx1152 remain unaffected by this change.

    I’m not sure whether this code is really relevant for developers, but while we wait for an official fix, it works (as far as I can tell).
    It allows me to fully use the VRAM under Windows 11 x64, with 95.8 GB available, and I can load DeepSeek-V4-Flash-0731-GGUF · UD-IQ1_S (83 GB) without any issues.

    I don’t have the skills to discuss this topic in depth with you; I just hope this will allow you to make the most of Unsloth. I’ve only just discovered it, and I’m really enjoying it.

    Many sincere thanks to the project’s developers

    BR

  4. lizi-meng commented on Aug 14, 2026

    @lizi-meng

    @SergeBertrand Thank you this works! It's so frustrating that even the latest release (0.1.800-beta) did not fix this issue. I have not been able to load any models in Windows or Linux ever since I installed it when AMD support was added. Now I can finally load models on Strix Halo!

    Update: even with the workaround, I can only load small models (<30gb). I could not load models bigger than 70gb.

  5. prusswan commented on Aug 29, 2026

    @prusswan

    This is still happening on latest Studio. Had to keep to Vulkan which loads the model into VRAM first.

  6. danielhanchen commented on Sep 9, 2026

    @danielhanchen
    Member

    Fixed! The unified memory preflight on Strix Halo is advisory now, it warns instead of refusing, and an unmapped launch is switched to a pageable one so the load proceeds with full GPU offload. The RAM number in the notice is still misleading, that's cosmetic.

    To update: the desktop app updates itself (Settings > General), otherwise unsloth studio update, or in Docker docker exec <container> unsloth-studio-update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions