Skip to content

[BUG FIX] Pick the Ollama package by GPU hardware, not by installed binaries - #10472

Open
Eric-Fernald wants to merge 3 commits into
omacom:quattrofrom
Eric-Fernald:ollama-gpu-detection
Open

Eric-Fernald wants to merge 3 commits into
omacom:quattrofrom
Eric-Fernald:ollama-gpu-detection

Conversation

@Eric-Fernald

@Eric-Fernald Eric-Fernald commented Sep 6, 2026 •

Copy link
Copy Markdown

The Ollama install menu chose ollama-cuda whenever nvidia-smi was on PATH. nvidia-utils is routinely pulled onto AMD/Intel machines as an opengl-driver/vulkan-driver provider, so AMD owners got ollama-cuda plus the ~3 GB CUDA tree. The ollama-rocm branch was dead: it looked for rocminfo, which a stock Omarchy install never places on disk.

Detect by PCI vendor instead:

  • Reuse omarchy-hw-nvidia for the CUDA branch.
  • Add omarchy-hw-amd, reading sysfs the same way, for the ROCm branch.
  • Otherwise fall back to CPU-only ollama.

Package selection by hardware

Detection is by PCI vendor ID and display class in sysfs. NVIDIA is checked first, then AMD, so NVIDIA wins on mixed machines (matching the old precedence).

GPU hardware Package
NVIDIA only ollama-cuda
NVIDIA + AMD (e.g. AMD iGPU + NVIDIA dGPU laptop) ollama-cuda
NVIDIA + Intel ollama-cuda
AMD only (discrete or integrated) ollama-rocm
AMD + Intel ollama-rocm
Intel only ollama (CPU)
No PCI GPU (some VMs, Apple Silicon) ollama (CPU)

Installed packages (nvidia-utils, ROCm, etc.) have no effect on the choice.

Known limitation: ROCm officially supports only some AMD parts, so an APU-only laptop gets ollama-rocm and Ollama may fall back to CPU at runtime. This is still an improvement over the previous behavior, which never selected ollama-rocm on any AMD machine.

Tests: new test/shell.d/hw-amd-test.sh covers discrete/integrated Radeon, hybrid, NVIDIA-only, Intel-only, an AMD audio function, and no devices.

Fixes #10380

… on PATH. `nvidia-utils` is routinely pulled onto AMD/Intel machines as an `opengl-driver`/`vulkan-driver` provider, so AMD owners got `ollama-cuda` plus the ~3 GB CUDA tree. The `ollama-rocm` branch was dead: it looked for `rocminfo`, which a stock Omarchy install never places on disk.

Detect by PCI vendor instead:
- Reuse `omarchy-hw-nvidia` for the CUDA branch.
- Add `omarchy-hw-amd`, reading sysfs the same way, for the ROCm branch.
- Otherwise fall back to CPU-only `ollama`.

NVIDIA still wins on a mixed machine, matching the old precedence (AMD iGPU + NVIDIA dGPU laptops want CUDA).

Tests: new `test/shell.d/hw-amd-test.sh` covers discrete/integrated Radeon, hybrid, NVIDIA-only, Intel-only, an AMD audio function, and no devices.

Fixes omacom#10380
@Eric-Fernald Eric-Fernald changed the title Pick the Ollama package by GPU hardware, not by installed binaries [FIX] Pick the Ollama package by GPU hardware, not by installed binaries Sep 11, 2026
@Eric-Fernald Eric-Fernald changed the title [FIX] Pick the Ollama package by GPU hardware, not by installed binaries [BUG FIX] Pick the Ollama package by GPU hardware, not by installed binaries Sep 11, 2026
@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
It landed as 100644, so the menu's `elif omarchy-hw-amd` hit "Permission denied" and every AMD machine fell through to CPU-only ollama, and the new hw-amd test failed its first case. Its siblings are all 100755.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and run on a disposable Omarchy worker. The bug is real and this is the right-sized fix for it, with one problem, which I've fixed on your branch.

The problem: bin/omarchy-hw-amd was committed without its executable bit (mode 100644; its omarchy-hw-* siblings are all 100755). In the menu action, elif omarchy-hw-amd hit "Permission denied", so every AMD machine fell through to CPU-only ollama and ollama-rocm was still never picked. test/shell.d/hw-amd-test.sh also failed its first case. I pushed 12ca2b8 (Make omarchy-hw-amd executable), a mode change only.

What was run: I ran the install.ai.ollama action from omarchy-menu.jsonc against fake sysfs devices, with nvidia-smi on PATH as in #10380:

  • On quattro: AMD, NVIDIA and Intel all get ollama-cuda.
  • At 12ca2b8: AMD gets ollama-rocm, NVIDIA gets ollama-cuda and Intel gets ollama.
  • With the executable bit removed again: AMD falls back to ollama.

hw-amd-test.sh passes 7 of 7, hw-nvidia-test.sh, hw-hybrid-gpu-test.sh, menu-test.sh and remove-ai-test.sh pass, and ./test/cli passes 112 of 112.

Second opinion: Codex Medium reviewed the same diff. It agreed that the problem is real and the fix proportionate, though its independence from my review isn't guaranteed. It confirmed that the vendor and class matching is right (the HDMI audio function is excluded and NVIDIA wins on hybrids) and that nothing else still uses the old nvidia-smi/rocminfo logic. It raised one point, which the description already lists as a known limitation: any AMD display device gets ollama-rocm, including Radeons that ROCm doesn't support. ollama-rocm depends on ollama, so those machines still run on the CPU, but they download the ROCm runtime for nothing. Narrowing the choice to ROCm-supported GPUs is a scope decision rather than a defect, so I left it alone.

Waiting on: the maintainer, to decide whether every AMD GPU getting ollama-rocm is acceptable as it stands. Nothing is needed from you. This fixes #10380. #11691 rewrites the same menu row (it moves the selection into omarchy-install-ai-ollama but keeps the nvidia-smi check), so whichever lands second will need the detection carried across.

@greptile-apps

greptile-apps Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Changes how the system picks GPU drivers for Ollama.

The PR appears safe to merge based on the reviewed changes.

Summary

The PR selects the Ollama package by PCI GPU vendor rather than installed utilities. Since the previous review, it adds action-level tests for NVIDIA, AMD, hybrid, and Intel-only machines.

Reviews (2) · Last reviewed commit: "The detector tests alone would pass if t..."

Comment thread test/shell.d/hw-amd-test.sh Resolved
NVIDIA, which would put ollama-rocm on hybrid laptops with an NVIDIA
dGPU and an AMD iGPU. Run the shipped action against PCI fixtures with
the real detectors and a stubbed installer to cover CUDA, ROCm, CPU,
and the mixed-GPU case.
@omarchybot omarchybot removed verified Omarchy Triage has verified that this issue is ready for final review bug Something isn't working labels Oct 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Your new commit (a0f93db) only adds tests, and I read it: it runs the menu's install.ai.ollama action on fake PCI devices, with the real detectors and a stubbed omarchy-install-app. The four cases cover NVIDIA, AMD, a hybrid with an AMD iGPU and an NVIDIA dGPU, and Intel-only. They pin the NVIDIA-before-AMD order that makes the hybrid case come out as ollama-cuda. I did not run it on a worker this time, so the earlier result covers 12ca2b8 and not this head. That is also why verified came off.

Classification is unsettled. I classified this as a bug: on quattro, any machine with nvidia-smi on PATH gets ollama-cuda, which is what #10380 reports on an AMD card, and ollama-rocm is never picked. Codex Medium, which classifies independently, called it an enhancement. Two models have to agree before a class label goes on, so I took bug off and added nothing in its place.

Waiting on: the maintainer, to settle whether this is a bug fix or a feature. Once that's decided, the new head gets the same worker run as 12ca2b8. Nothing is needed from you.

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.

Ollama install menu picks CUDA/CPU on AMD systems: nvidia-smi presence ≠ NVIDIA GPU, and the rocminfo branch never fires

2 participants