You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] AMD Strix Halo APU: model loading incorrectly restricted to system RAM (22 GB) instead of GPU memory (110 GB free) #6834
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:
_amd_apu_wants_unified_memory() (line 2031) returns True for gfx1150/gfx1151 architectures
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
The GPU memory check is completely bypassed — even though ROCm reports 110 GB free
# Line 5361-5366: the problematic logicifmodel_sizeisnotNoneandself._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:
raiseRuntimeError(_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
Check GPU memory first (via torch.cuda.mem_get_info())
If GPU memory is sufficient, load model into GPU memory
Only fall back to system RAM check when GPU memory is insufficient or on WSL
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:ifmodel_sizeisnotNoneandself._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.
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.
@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.
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.
Activity
fix(studio): use GPU-reported free memory for unified-memory APU fit …
jerrydong1988 commentedon Jul 24, 2026
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().availablenow returns a number large enough to pass the check inllama_cpp.py:5361-5366.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.SergeBertrand commentedon Aug 14, 2026
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
lizi-meng commentedon Aug 14, 2026
@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.
prusswan commentedon Aug 29, 2026
This is still happening on latest Studio. Had to keep to Vulkan which loads the model into VRAM first.
danielhanchen commentedon Sep 9, 2026
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 Dockerdocker exec <container> unsloth-studio-update.