Skip to content

[Bug] AMD: training auto-selection picks a gfx1036 iGPU the torch wheel has no kernels for — "CUDA error: invalid kernel file" #8792

Closed

Description

@LeoBorcherding

Same defect as #7624 / #7669, in the training path instead of llama-server. #7670 fixed the inference half on this exact machine; training still fails on current main.

Environment

What happens

Every training run dies at model load, twice in the same session:

{"event": "Applied gpu_ids: CUDA_VISIBLE_DEVICES='0,1' (rocm)"}
{"event": "Using device_map='balanced' (2 GPU(s) visible)"}
{"level": "error", "event": "Training error: CUDA error: invalid kernel file
Search for `hipErrorInvalidKernelFile' in https://rocm.docs.amd.com/projects/HIP/en/latest/index.html ...
Device-side assertion tracking was not enabled by user."}

Startup detects both devices correctly:

Hardware detected: ROCm (HIP 7.13.99004) -- AMD Radeon RX 7700 XT
ROCm devices (2):
  [0] AMD Radeon RX 7700 XT
  [1] AMD Radeon(TM) Graphics

The UI surfaces the raw HIP text as the run error, so the Train page shows a wall of AMD_SERIALIZE_KERNEL advice rather than saying this GPU cannot run this build.

Cause

auto_select_gpu_ids ranks visible GPUs by free VRAM and never asks what the installed torch wheel was built for. The iGPU stays in the selection, device_map="balanced" puts layers on it, and the wheel has no gfx1036 code object. torch.cuda.get_arch_list() is the wheel's own answer and is not used anywhere in the tree.

The llama.cpp gate from #7670 cannot cover this: mapped_targets describes the llama.cpp bundle, not the PyTorch wheel, and the two can cover different archs on the same host.

Workaround: $env:HIP_VISIBLE_DEVICES = "0" before launching, same as #7669. It hides the iGPU from every ROCm app, not just Studio.

Reported on Discord by the same user who reported #7669 and confirmed #7670's fix on this hardware.

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