Skip to content

[Bug] AMD Ryzen AI install bug #8335

Closed

Description

@lejeunecedric

Note: Please do not remove the questions. Answer beside them.

  1. Did you update? pip install --upgrade unsloth unsloth_zoo no

  2. Colab or Kaggle or local / cloud local

  3. Number GPUs used, use nvidia-smi 1

  4. Which notebook? Please link!

  5. Which Unsloth version, TRL version, transformers version, PyTorch version? unsloth 2026.8.10

  6. Which trainer? SFTTrainer, GRPOTrainer etc

Put Minimal code to reproduce error here ###Remove Hugging Face token###
###Please make sure to check formatting properly, edit if needed.###
AMD Ryzen AI 395 MAX not recognized at setup.

Root cause (an upstream bug in unsloth 2026.8.10, not your machine): install.ps1 correctly detects your AMD Radeon 8060S (gfx1151) and installs ROCm torch, but the bundled studio/setup.ps1's AMD WMI fallback had a PowerShell scalar-unroll bug:
$wmiGpus = if ($healthyGpus.Count -gt 0) { $healthyGpus } else { $amdGpus }

With exactly one AMD GPU, $healthyGpus unrolls to a scalar CimInstance, and a scalar's .Count is $null under Windows PowerShell 5.1 (which the CLI uses). So $null -gt 0 = false → setup reports "gpu none (chat-only/GGUF)", concludes the venv's ROCm torch is "stale" (torch rocm != required cpu), and aborts telling you to "re-run install.ps1" — an infinite loop.

Fix: wrap the if-expression in @(...) (the same pattern the Intel scan in that file already uses):
$wmiGpus = @(if ($healthyGpus.Count -gt 0) { $healthyGpus } else { $amdGpus })
Since install.ps1 rebuilds the venv every run (overwriting any patch), I made a patched copy that re-applies this one-line hotfix inside the fresh venv right before studio setup: C:\Users\Demo\AppData\Local\Temp\opencode\install-fixed.ps1.

Result (exit 0):
- Setup now sees gpu AMD ROCm (gfx1151)
- torch 2.11.0+rocm7.13.0 (HIP 7.13), torchvision/torchaudio matched
- llama.cpp gfx1151 prebuilt installed and validated
- unsloth launcher on PATH (~\.unsloth\studio\bin), desktop shortcut created
- The fix persists in the installed setup.ps1, so studio update will also work
Start it with: unsloth studio -p 8888

Activity

  1. ahmad110abbas commented on Aug 10, 2026

    @ahmad110abbas

    Wrap the expression in @(...) so PowerShell forces it to remain an array:

    $wmiGpus = @(if ($healthyGpus.Count -gt 0) { $healthyGpus } else { $amdGpus })

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions