Skip to content

[Bug] UUID-form CUDA_VISIBLE_DEVICES silently hides the per-model GPU picker on a healthy multi-GPU CUDA host #8873

Closed

Description

@Pawls

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

  1. Did you update? pip install --upgrade unsloth unsloth_zoo — Yes. Studio-managed venv: unsloth 2026.8.18, unsloth_zoo 2026.8.12, Studio 2026.8.15.
  2. Colab or Kaggle or local / cloud — Local, Unsloth Desktop on Windows 11 Home (10.0.26200).
  3. Number GPUs used, use nvidia-smi — 2x NVIDIA GeForce RTX 3090 (24 GB each), driver 610.62.
  4. Which notebook? Please link! — N/A, this is the Studio/Desktop model settings UI.
  5. Which Unsloth version, TRL version, transformers version, PyTorch version? — unsloth 2026.8.18, unsloth_zoo 2026.8.12, TRL 0.23.1, transformers 5.5.0, PyTorch 2.10.0+cu130.
  6. Which trainer? SFTTrainer, GRPOTrainer etc — N/A, inference/model-config only.

Summary

On a two-GPU CUDA host, the per-model GPUs picker (GPU Memory → GPUs, in model-config-page.tsx) never renders if CUDA_VISIBLE_DEVICES is set using GPU UUID entries instead of numeric indices. The control is not disabled or annotated — it is absent, so there is no way to discover that a GPU pin is possible or why it is unavailable.

Both cards are detected correctly everywhere else: the header tile reads 48 GiB VRAM, and the startup banner enumerates both devices. Only the pin control disappears.

nvidia-smi works fine on this host, and its output alone is sufficient to supply physical indices — but the UUID mask causes that working inventory to be discarded before it is used.

Environment

  • OS: Windows 11 Home 10.0.26200
  • GPUs: 2x RTX 3090, driver 610.62
  • CUDA_VISIBLE_DEVICES (Machine scope): GPU-d18a14b7-70a4-61bd-56f1-371055dfbb50,GPU-2f902962-578c-0f96-69a5-3e18679211d7
  • Backend: CUDA, llama.cpp (not Vulkan; _backend_lacks_gpu_lib() is False)

The UUID order matches PCI bus order exactly, so this mask is a pure no-op in terms of device selection:

index, uuid, name, pci.bus_id
0, GPU-d18a14b7-70a4-61bd-56f1-371055dfbb50, NVIDIA GeForce RTX 3090, 00000000:01:00.0
1, GPU-2f902962-578c-0f96-69a5-3e18679211d7, NVIDIA GeForce RTX 3090, 00000000:04:00.0

Steps to reproduce

  1. On a multi-GPU CUDA host, set CUDA_VISIBLE_DEVICES to the GPUs' UUIDs (GPU-<uuid>,GPU-<uuid>) rather than 0,1.
  2. Launch Unsloth Desktop.
  3. Open any GGUF model's settings (Model hub → On Device → a model → settings; or the sidebar model config).
  4. Set GPU Memory to Manual so the placement controls expand.
  5. Observe: VRAM Budget and GPU Layers render, then the panel goes straight to Chat Template. There is no GPUs section.
  6. Set CUDA_VISIBLE_DEVICES=0,1, restart Studio, repeat — the GPUs section now appears with one toggle per card.

Root cause

Traced against the installed source:

  1. _get_parent_visible_gpu_spec() cannot map a UUID mask to numeric IDs, so it yields numeric_ids: None.
  2. nvidia.get_backend_visible_gpu_info(None, …) early-returns at backend/utils/hardware/nvidia.py:206 with available: False, index_kind: "unresolved" — before running nvidia-smi, whose --query-gpu=index,uuid output would resolve the mask.
  3. Because that result is not available, get_backend_visible_gpu_info() in backend/utils/hardware/hardware.py:3551 falls through to the torch fallback. There parent_visible_ids is [], so backend/utils/hardware/hardware.py:3562-3565 sets index_kind = "relative".
  4. In frontend/src/hooks/use-gpu-info.ts, toGpuDevices() sets pinnable only when index_kind === "physical" (or vulkan), so both devices come back pinnable: false.
  5. pinnableGpuContext() (frontend/src/hooks/gpu-selection.ts) sees fewer than 2 pinnable devices and returns ids: [].
  6. model-config-page.tsx:373 computes showGpuPicker = (gpuContext.ids?.length ?? 0) > 1 → false, and the section at model-config-page.tsx:475 is never rendered.

Reproduced directly against the backend, same machine, only the env var differing:

from utils.hardware import get_backend_visible_gpu_info
get_backend_visible_gpu_info()["index_kind"]
# CUDA_VISIBLE_DEVICES=GPU-d18a14b7-...,GPU-2f902962-...  ->  'relative'
# CUDA_VISIBLE_DEVICES=0,1                                ->  'physical'

Expected behaviour

A UUID mask is a legitimate, documented NVIDIA configuration — it is the standard way to make device selection stable across PCIe reordering, so users are actively encouraged toward it. It should not silently remove functionality.

Two suggestions, in order of preference:

  1. Resolve UUIDs to physical indices. nvidia-smi --query-gpu=index,uuid --format=csv maps every UUID in the mask to a physical index in one call. nvidia.get_backend_visible_gpu_info() could resolve a non-numeric mask this way instead of returning unresolved, which would make UUID masks fully first-class and fix the picker with no user action. The visible_ordinal mapping already built for the numeric path applies unchanged once the UUIDs are translated.

  2. At minimum, explain the absence. If a mask genuinely cannot be resolved, render the GPUs section disabled with the reason, rather than omitting it. The current behaviour is indistinguishable from "this feature does not exist" — I concluded exactly that and went looking for a feature request before tracing the source.

The constraint is documented in the gpu_ids field description in backend/models/inference.py:97 ("physical IDs are unsupported when the parent visibility mask uses non-numeric or subdevice entries, including CUDA_VISIBLE_DEVICES with UUID/MIG entries"), but that text is not surfaced anywhere in the UI.

Workaround

Replace the UUID mask with numeric indices (CUDA_VISIBLE_DEVICES=0,1) and set CUDA_DEVICE_ORDER=PCI_BUS_ID to keep the indices stable, then restart Studio.

Activity

  1. rsd-darshan commented on Aug 15, 2026

    @rsd-darshan
    Contributor

    Opened a fix in #8917. Your trace of the root cause through _get_parent_visible_gpu_spec() -> get_backend_visible_gpu_info() -> use-gpu-info.ts -> gpu-selection.ts -> model-config-page.tsx was extremely helpful -- went with your preferred option 1 (resolve UUIDs via nvidia-smi rather than just surfacing the reason in the UI), since it fixes the picker with no user action needed and the workaround you documented (numeric CUDA_VISIBLE_DEVICES + CUDA_DEVICE_ORDER=PCI_BUS_ID) stops being necessary.

    Don't have multi-GPU hardware to confirm the picker actually renders end-to-end, so if you get a chance to test the branch once there's a build, that'd close the loop nicely.

  2. added a commit that references this issue on Sep 20, 2026
    8dd4818
  3. added a commit that references this issue on Oct 6, 2026
    5169487
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions