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] GET to /api/system/hardware creates cuda context on gpu 0 #18732
Unsloth probes nvidia-smi, rejects the reading when its total memory differs from torch's total_memory by more than 1%. nvidia-smi reports 424 to 431mb per card as reserved. If they disagree by that amount, the gap is 2.6% on a 16GB card, so the probe always fails.
It also sets CUDA_DEVICE_ORDER=PCI_BUS_ID, so device 0 is the lowest PCI bus card, multi-gpu the issue always lands on that card.
Fixed! Studio compared the nvidia-smi total against PyTorch's total with a 1% tolerance, but nvidia-smi also counts the memory the driver reserves for itself (about 300 to 750 MiB), so on most cards the reading was rejected and Studio fell back to a torch call that opens a CUDA context on GPU 0. The tolerance now covers that reserved memory, so the hardware endpoint reads VRAM without touching the GPU. Fixed in #18734.
To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update.
If it's fixed for you, please close the issue; if not, reply here with what you see.
Activity
danielhanchen commentedon Nov 23, 2026
Fixed! Studio compared the nvidia-smi total against PyTorch's total with a 1% tolerance, but nvidia-smi also counts the memory the driver reserves for itself (about 300 to 750 MiB), so on most cards the reading was rejected and Studio fell back to a torch call that opens a CUDA context on GPU 0. The tolerance now covers that reserved memory, so the hardware endpoint reads VRAM without touching the GPU. Fixed in #18734.
To update: Unsloth Desktop will have an update banner. For Studio, use
unsloth studio update. For Docker, usedocker exec <container> unsloth-studio-update.If it's fixed for you, please close the issue; if not, reply here with what you see.
fix(studio): prevent /api/system/hardware from creating CUDA context …