ollama - ✅(Solved) Fix Ollama on Windows on ARM trying to load wrong dlls [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#15095Fetched 2026-04-08 01:41:24
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
cross-referenced ×1labeled ×1subscribed ×1

Fix Action

Fixed

PR fix notes

PR #15097: windows: avoid probing x64 cpu variant dlls on arm64

Description (problem / solution / changelog)

Fixes #15095

On Windows ARM64, backend discovery probes CPU variant DLLs first (e.g. haswell/sse42/x64), which can trigger repeated wrong-architecture load failures.

This change detects Windows ARM64 and, for the CPU backend, loads the base ggml-cpu.dll directly instead of scanning CPU variant DLLs. That avoids loading x64 CPU variant DLLs on WoA and removes noisy load errors.

Changed files

  • ml/backend/ggml/ggml/src/ggml-backend-reg.cpp (modified, +42/-0)

Code Example

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-alderlake.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-haswell.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-icelake.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-sandybridge.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-skylakex.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-sse42.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-x64.dll: %1 ist keine zul�ssige Win32-Anwendung.

---
RAW_BUFFERClick to expand / collapse

What is the issue?

When you run Ollama on a Windows on ARM device, it still tries to load certain libraries that it shouldn't and can't load:

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-alderlake.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-haswell.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-icelake.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-sandybridge.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-skylakex.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-sse42.dll: %1 ist keine zul�ssige Win32-Anwendung.

dl_load_library unable to load library C:\Users\Tourniquet\AppData\Roaming\ollama\v.0.18.3\lib\ollama\ggml-cpu-x64.dll: %1 ist keine zul�ssige Win32-Anwendung.

Relevant log output

OS

No response

GPU

No response

CPU

No response

Ollama version

No response

extent analysis

Fix Plan

The fix involves modifying the library loading mechanism to skip incompatible libraries on Windows on ARM devices.

  • Check the CPU architecture before loading libraries.
  • Skip loading libraries that are not compatible with the current CPU architecture.

Example code snippet in Python:

import platform
import ctypes

def load_library(lib_name):
    # Check if the system is Windows on ARM
    if platform.system() == 'Windows' and platform.machine() == 'ARM64':
        # Skip loading libraries that are not compatible with ARM64
        if 'x64' in lib_name or 'alderlake' in lib_name or 'haswell' in lib_name or 'icelake' in lib_name or 'sandybridge' in lib_name or 'skylakex' in lib_name or 'sse42' in lib_name:
            return None
    try:
        # Load the library using ctypes
        return ctypes.CDLL(lib_name)
    except OSError:
        # Handle the case where the library cannot be loaded
        return None

# Example usage:
lib_name = 'ggml-cpu-arm.dll'
lib = load_library(lib_name)
if lib:
    # Library loaded successfully
    print(f"Loaded library: {lib_name}")
else:
    # Library could not be loaded
    print(f"Failed to load library: {lib_name}")

Verification

To verify that the fix worked, run the modified code on a Windows on ARM device and check that it no longer attempts to load incompatible libraries.

Extra Tips

  • Make sure to update the library loading mechanism to handle different CPU architectures and operating systems.
  • Consider using a more robust library loading mechanism, such as using a configuration file to specify the libraries to load for each platform.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING