From 239ca986437c9f107af9faadb10a4542a824778a Mon Sep 17 00:00:00 2001 From: Leo Borcherding Date: Fri, 20 Mar 2026 03:48:45 -0500 Subject: [PATCH] fix: detect AMD/no-NVIDIA GPU early in Windows installer and guard unsloth.exe existence (#4478) * fix(install.ps1): detect AMD/no-NVIDIA GPU early and guard unsloth.exe existence When a user has an AMD GPU (no nvidia-smi), uv's --torch-backend=auto resolves to CPU torch, which constrains the solver to unsloth==2024.8. That ancient release has no unsloth.exe CLI entry point, so the subsequent & \ studio setup call throws a confusing PowerShell 'module could not be loaded' CommandNotFoundException instead of a clear error. Two fixes: - Detect nvidia-smi early; if no NVIDIA GPU is found, print a clear error explaining AMD/Intel GPUs are unsupported and exit before wasting time installing the wrong package version. - Guard Test-Path \ before invoking it, so any future case where the CLI entry point is missing produces a readable error instead of a cryptic PowerShell exception. Fixes: unsloth_studio\Scripts\unsloth.exe CommandNotFoundException on AMD GPU systems (Windows). * fix(install.ps1): correct GPU support message - AMD is Linux-only via ROCm * Slim down to just the unsloth.exe existence guard Remove the early NVIDIA GPU detection gate -- Studio supports Windows and Mac without a GPU (finetuning is simply disabled). The GPU gate was blocking legitimate non-NVIDIA users from installing. Keep only the Test-Path guard on unsloth.exe before invoking it. This turns the confusing PowerShell CommandNotFoundException into a clear error message pointing at the likely cause (older unsloth version resolved by the package solver that does not include the Studio CLI). * Fix quickstart link in unsloth.exe guard message --------- Co-authored-by: LeoBorcherding Co-authored-by: Daniel Han --- install.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/install.ps1 b/install.ps1 index 6bf37e39db..02baa97b97 100644 --- a/install.ps1 +++ b/install.ps1 @@ -98,6 +98,13 @@ function Install-UnslothStudio { # CUDA Toolkit, Node.js, and other dependencies automatically via winget. Write-Host "==> Running unsloth studio setup..." $UnslothExe = Join-Path $VenvName "Scripts\unsloth.exe" + if (-not (Test-Path $UnslothExe)) { + Write-Host "[ERROR] unsloth CLI was not installed correctly." -ForegroundColor Red + Write-Host " Expected: $UnslothExe" -ForegroundColor Yellow + Write-Host " This usually means an older unsloth version was installed that does not include the Studio CLI." -ForegroundColor Yellow + Write-Host " Try re-running the installer or see: https://github.com/unslothai/unsloth?tab=readme-ov-file#-quickstart" -ForegroundColor Yellow + return + } & $UnslothExe studio setup if ($LASTEXITCODE -ne 0) { Write-Host "[ERROR] unsloth studio setup failed (exit code $LASTEXITCODE)" -ForegroundColor Red