Repository navigation
Description
Note: Please do not remove the questions. Answer beside them.
- Did you update?
pip install --upgrade unsloth unsloth_zooYES ColaborKaggleor local / cloud LOCAL- Number GPUs used, use
nvidia-smi2 but only discreet should be used - Which notebook? Please link! desktop, self built
- Which Unsloth version, TRL version, transformers version, PyTorch version?
- Which trainer?
SFTTrainer,GRPOTraineretc
Put Minimal code to reproduce error here ###Remove Hugging Face token###
###Please make sure to check formatting properly, edit if needed.###🦥 You can also ask via our Reddit page: https://reddit.com/r/unsloth/
Environment:
- OS: Windows 11
- Unsloth Studio (latest, updated via
unsloth studio update) - Hardware: dual-GPU system — AMD integrated graphics (
AMD Radeon(TM) Graphics) + AMD Radeon AI PRO R9700 (gfx1201, discrete, 32GB VRAM) - llama.cpp backend: linked via
UNSLOTH_LOCAL_LLAMA_CPP_DIRto an officialllama-b10173-bin-win-hip-radeon-x64release (confirmed via--versionand presence ofggml-hip.dll) - Model:
unsloth/Qwen3.6-27B-MTP-GGUF(UD-Q6_K_XL)
Description:
On a system with both an iGPU and a discrete AMD GPU visible via ROCm, Studio's device auto-selection for llama-server loads appears to choose based on raw reported free memory, without accounting for whether the binary actually supports that device's architecture. The iGPU reports a larger "free" figure (because it shares system RAM) and wins the selection, but the linked HIP build doesn't have compiled kernels for the iGPU's architecture, producing a hard crash rather than a graceful skip/fallback to the working discrete GPU.
Log evidence:
Startup correctly detects both devices:
Hardware detected: ROCm (HIP 7.13.99004) -- AMD Radeon(TM) Graphics
ROCm devices (2):
[0] AMD Radeon(TM) Graphics
[1] AMD Radeon AI PRO R9700
At model load, selection logic picks device 0 based on free memory alone:
"GGUF size: 24.2 GB, mmproj: 0.9 GB, est. KV cache: 6.2 GB, ... GPUs free: [(0, 36243), (1, 32473)], selected: [0], fit: False"
(Device 0's 36243 MB "free" is shared system RAM reported by the iGPU; device 1, the R9700, has its full 32473 MB genuinely free and is architecturally correct for the linked HIP build.)
Every retry strategy Studio attempted failed identically, confirming the device selection — not the model, vision projector, flash attention, or MTP — is the root cause:
try0 (fit off): exit 3221226505, "ROCm error: device kernel image is invalid", current device: 0
try1 (fit on): exit 3221226505, same error, current device: 0
retry (flash-attn off): exit 3221226505, same error, current device: 0
retry (no --mmproj, text-only): exit 3221226505, same error, current device: 0
retry (no speculative decoding): exit 3221226505, same error, current device: 0
Final surfaced error:
"llama-server crashed at startup on both the vision and text-only attempts -- a GPU driver/runtime initialization crash, not a model or vision-projector problem. This often means an unsupported secondary GPU..."
Additional context:
- Setting
$env:ROCR_VISIBLE_DEVICES = "1"in the Studio launch script did not change device selection — no"Applied gpu_ids: CUDA_VISIBLE_DEVICES=..."line appears anywhere in the affected logs, and both ROCm devices are still enumerated at startup, suggesting Studio's internalgpu_idsselection logic runs independently of/overrides this environment variable for the llama-server launch path. - No GPU/device-selection control was found in Studio's UI (checked the model's Run/Configuration panel and Settings → System → Live monitor / GPU devices — both are read-only or lack a device picker).
Settings → System → GPU devicesonly lists one device (AMD Radeon(TM) Graphics, GPU 0) despite the backend correctly detecting two — possibly a related display bug in the same selection logic.
Suggested fix: Either (a) don't select a device purely by reported free memory on ROCm multi-GPU systems — check architecture/compute-capability compatibility with the linked llama.cpp build first, or catch the "device kernel image is invalid" failure mode and retry on the next candidate device before surfacing an error, or (b) expose a manual GPU/device override in the UI so users on asymmetric multi-GPU (iGPU + dGPU) systems aren't dependent on the heuristic and don't have to disable a device system-wide as a workaround.
Confirmation: Disabling the iGPU in Windows Device Manager (Device Manager → Display adapters → AMD Radeon(TM) Graphics → Disable) resolves the issue completely. With only the R9700 visible to ROCm, the model loads successfully and generates at ~36 t/s — matching expected throughput with MTP speculative decoding active. This confirms the iGPU was being selected instead of the R9700, and that no model/vision-projector/flash-attention/MTP factor was involved — purely a device-selection defect.
Activity
eslam-ahmed43 commentedon Jul 30, 2026
Hi, I would like to work on this issue if it is still available. I will look into it and open a PR when ready.
fix(studio): retry llama-server on remaining GPUs after a 'device ker…
Studio: carry the ROCm arch gate into the embed launch and the crash …
Studio: pin the arch gate's survivors when the fit owns placement (un…
Studio: gate the manual-split launch and drop tensor mode on the CPU …
Studio: finish the gate's env handoff on the CPU and narrowed arms (u…
Studio: re-run the APU RAM preflight for the arch-crash retry (unslot…
Studio: leave an unmappable GPU mask alone when the arch gate pins (u…
Studio: finish the proactive arch gate's handoff onto the survivors (u…
Detect the Radeon AI PRO R9700 (gfx1201): it carries neither 9070 nor…
Studio: match HIP's other kernel-image error in the arch-crash retry (u…
Studio: restore the Model Memory record for the arch-crash respawn (u…
15 remaining items
Read ROCm VRAM through amd-smi so the backend keeps no HIP context
Read ROCm VRAM through amd-smi so the backend keeps no HIP context
Read ROCm VRAM through amd-smi so the backend keeps no HIP context
Read ROCm VRAM through amd-smi so the backend keeps no HIP context
Read ROCm VRAM through amd-smi so the backend keeps no HIP context
Read ROCm VRAM through amd-smi so the backend keeps no HIP context
fix(amd): read ROCm VRAM through amd-smi so the backend keeps no HIP …
Replace the warning after an arch fallback, and page an unmapped over…
Studio: warn instead of refusing to load a model bigger than VRAM plu…
Say why Studio could not enumerate a GPU, instead of just logging [] (#…
Studio: keep an AMD dGPU and a Vulkan choice through install and update
Studio: keep an AMD dGPU and a Vulkan choice through install and update
Studio: stop on a CUDA kernel-image crash in the recovery launches too
Studio: keep CUDA 12 llama.cpp prebuilts off drivers older than CUDA …
Studio: prefer discrete GPUs over unified-memory APUs in automatic GG…