Skip to content

fix: select integrated GPUs and allow PARAKEET_DEVICE to name a device#20

Merged
mudler merged 1 commit into
masterfrom
fix/igpu-device-selection
Jun 7, 2026
Merged

fix: select integrated GPUs and allow PARAKEET_DEVICE to name a device#20
mudler merged 1 commit into
masterfrom
fix/igpu-device-selection

Conversation

@localai-bot
Copy link
Copy Markdown
Collaborator

What

Fixes #17.

Two related backend-selection issues:

  1. Integrated GPUs were ignored. Device selection only accepted GGML_BACKEND_DEVICE_TYPE_GPU, so integrated GPUs (Ryzen APUs and similar, reported as GGML_BACKEND_DEVICE_TYPE_IGPU) were skipped and the engine fell back to CPU. The auto-pick now matches both discrete and integrated GPU devices.

  2. PARAKEET_DEVICE could only say cpu. It now has three forms:

    • cpu (or CPU) forces CPU, as before.
    • a device name like CUDA0, Vulkan1, Metal (case-insensitive) selects that specific registry device by name.
    • unset auto-picks the first GPU/IGPU device.

    An unknown name logs and falls back to CPU instead of failing. use_sched is now derived from the chosen device type, so any non-CPU device still offloads unsupported ops to CPU via the scheduler.

Tests

  • Adds tests/test_backend_device.cpp covering the env-var fallback paths (cpu, unknown name, case-insensitive CPU). These run on a CPU-only build, so they work in CI without a GPU.
  • Full suite: 57/57 pass (model-dependent tests skip without fixtures).

Note on validation

The IGPU code path itself could not be exercised on the dev host (a KVM guest where the AMD iGPU is not passed through; only a bochs virtual VGA is present, no render node / /dev/kfd). The fix compiles, and the device-selection and CPU-fallback logic are covered by the new test. Real IGPU validation needs a host where the integrated GPU is exposed.

🤖 Generated with Claude Code

Backend device selection only accepted GGML_BACKEND_DEVICE_TYPE_GPU, so
integrated GPUs (Ryzen APUs and similar, reported as
GGML_BACKEND_DEVICE_TYPE_IGPU) were skipped and the engine fell back to
CPU on those machines.

The auto-pick now matches both discrete and integrated GPU devices.
PARAKEET_DEVICE also gains a third form: besides "cpu" (force CPU) and
being unset (auto-pick the first GPU/IGPU), it can now name a specific
registry device such as "CUDA0" or "Vulkan1" (case-insensitive). An
unknown name logs and falls back to CPU instead of failing. use_sched is
now derived from the chosen device type so any non-CPU device still
offloads unsupported ops to CPU.

Adds a regression test covering the env-var fallback paths (cpu, unknown
name, case-insensitive CPU), which run on a CPU-only build, and documents
the new behavior in the README.

Closes #17

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mudler mudler merged commit e270af7 into master Jun 7, 2026
7 of 8 checks passed
@mudler mudler mentioned this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IGPUs are ignored

2 participants