unsloth/studio/backend/utils/hardware
LeoBorcherding 0539621fa1 fix(studio): set HIP_VISIBLE_DEVICES in apply_gpu_ids for ROCm training workers
Training workers are spawned via multiprocessing spawn before detect_hardware()
runs, so IS_ROCM is still False. If the user never set HIP_VISIBLE_DEVICES in
their shell, _inherits_rocm_visibility is also False, leaving the worker with
only CUDA_VISIBLE_DEVICES set. On ROCm hosts the HIP runtime honors
HIP_VISIBLE_DEVICES over CUDA_VISIBLE_DEVICES, so the worker saw the full
device list and torch raised "no usable HIP accelerator" on some setups.

Fall back to probing torch.version.hip (a build-time attribute, safe to read
before GPU init) to detect ROCm when neither IS_ROCM nor inherited env vars
are available. Mirrors the existing fix in llama_cpp.py for llama-server
subprocess GPU pinning.

Fixes https://github.com/unslothai/unsloth/issues/5180
2026-05-05 21:33:45 -07:00
..
__init__.py Add AMD ROCm/HIP support across installer and hardware detection (#4720) 2026-04-10 01:56:12 -07:00
amd.py Add native GGUF intake to Studio (#5246) 2026-05-04 11:46:18 +02:00
hardware.py fix(studio): set HIP_VISIBLE_DEVICES in apply_gpu_ids for ROCm training workers 2026-05-05 21:33:45 -07:00
nvidia.py Add native GGUF intake to Studio (#5246) 2026-05-04 11:46:18 +02:00
VRAM_ESTIMATION.md [Studio] multi gpu finetuning/inference via "balanced_low0/sequential" device_map (#4602) 2026-03-30 02:33:15 -07:00
vram_estimation.py [Studio] multi gpu finetuning/inference via "balanced_low0/sequential" device_map (#4602) 2026-03-30 02:33:15 -07:00