[GH-ISSUE #9139] Intel libggml-cpu-alderlake.so and so on are built on arm64 architecture #31704

Closed
opened 2026-04-22 12:25:10 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @vt-alt on GitHub (Feb 15, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9139

Originally assigned to: @jmorganca on GitHub.

What is the issue?

Currently (on v0.5.11) Intel microarchitecture libs are built on arm64 too.
But this does not seem useful.

[00:00:07] -- CMAKE_SYSTEM_PROCESSOR: aarch64
[00:00:07] -- Including CPU backend
[00:00:07] -- ARM detected
[00:00:07] -- Performing Test GGML_COMPILER_SUPPORTS_FP16_FORMAT_I3E
[00:00:07] -- Performing Test GGML_COMPILER_SUPPORTS_FP16_FORMAT_I3E - Failed
[00:00:07] -- ARM feature FMA enabled
[00:00:07] -- Adding CPU backend variant ggml-cpu-sandybridge:  
[00:00:07] -- ARM detected
[00:00:07] -- ARM feature FMA enabled
[00:00:07] -- Adding CPU backend variant ggml-cpu-haswell:  
[00:00:07] -- ARM detected
[00:00:07] -- ARM feature FMA enabled
[00:00:07] -- Adding CPU backend variant ggml-cpu-skylakex:  
[00:00:07] -- ARM detected
[00:00:07] -- ARM feature FMA enabled
[00:00:07] -- Adding CPU backend variant ggml-cpu-icelake:  
[00:00:07] -- ARM detected
[00:00:07] -- ARM feature FMA enabled
[00:00:07] -- Adding CPU backend variant ggml-cpu-alderlake:  
[00:00:07] -- ARM detected
[00:00:07] -- ARM feature FMA enabled
[00:00:07] -- Adding CPU backend variant ggml-cpu-sapphirerapids:  
[00:00:07] -- Looking for a CUDA compiler
[00:00:07] -- Looking for a CUDA compiler - NOTFOUND
[00:00:07] -- Looking for a HIP compiler
[00:00:07] -- Looking for a HIP compiler - NOTFOUND
[00:00:07] -- Configuring done (1.3s)

I thought maybe this is my mistake but you build the same way too:

host-189:~$ wget https://github.com/ollama/ollama/releases/download/v0.5.11/ollama-linux-arm64.tgz
host-189:~$ less ollama-linux-arm64.tgz
...
-rwxr-xr-x runner/runner     594128 2025-02-14 06:57 lib/ollama/libggml-base.so
-rwxr-xr-x runner/runner     397056 2025-02-14 06:57 lib/ollama/libggml-cpu-alderlake.so
-rwxr-xr-x runner/runner     397056 2025-02-14 06:57 lib/ollama/libggml-cpu-haswell.so
-rwxr-xr-x runner/runner     397056 2025-02-14 06:57 lib/ollama/libggml-cpu-icelake.so
-rwxr-xr-x runner/runner     397056 2025-02-14 06:57 lib/ollama/libggml-cpu-sandybridge.so
-rwxr-xr-x runner/runner     397056 2025-02-14 06:57 lib/ollama/libggml-cpu-sapphirerapids.so
-rwxr-xr-x runner/runner     397056 2025-02-14 06:57 lib/ollama/libggml-cpu-skylakex.so

Relevant log output


OS

Linux

GPU

Other

CPU

ARM64

Ollama version

v0.5.11

Originally created by @vt-alt on GitHub (Feb 15, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9139 Originally assigned to: @jmorganca on GitHub. ### What is the issue? Currently (on v0.5.11) Intel microarchitecture libs are built on arm64 too. But this does not seem useful. ``` [00:00:07] -- CMAKE_SYSTEM_PROCESSOR: aarch64 [00:00:07] -- Including CPU backend [00:00:07] -- ARM detected [00:00:07] -- Performing Test GGML_COMPILER_SUPPORTS_FP16_FORMAT_I3E [00:00:07] -- Performing Test GGML_COMPILER_SUPPORTS_FP16_FORMAT_I3E - Failed [00:00:07] -- ARM feature FMA enabled [00:00:07] -- Adding CPU backend variant ggml-cpu-sandybridge: [00:00:07] -- ARM detected [00:00:07] -- ARM feature FMA enabled [00:00:07] -- Adding CPU backend variant ggml-cpu-haswell: [00:00:07] -- ARM detected [00:00:07] -- ARM feature FMA enabled [00:00:07] -- Adding CPU backend variant ggml-cpu-skylakex: [00:00:07] -- ARM detected [00:00:07] -- ARM feature FMA enabled [00:00:07] -- Adding CPU backend variant ggml-cpu-icelake: [00:00:07] -- ARM detected [00:00:07] -- ARM feature FMA enabled [00:00:07] -- Adding CPU backend variant ggml-cpu-alderlake: [00:00:07] -- ARM detected [00:00:07] -- ARM feature FMA enabled [00:00:07] -- Adding CPU backend variant ggml-cpu-sapphirerapids: [00:00:07] -- Looking for a CUDA compiler [00:00:07] -- Looking for a CUDA compiler - NOTFOUND [00:00:07] -- Looking for a HIP compiler [00:00:07] -- Looking for a HIP compiler - NOTFOUND [00:00:07] -- Configuring done (1.3s) ``` I thought maybe this is my mistake but you build the same way too: ``` host-189:~$ wget https://github.com/ollama/ollama/releases/download/v0.5.11/ollama-linux-arm64.tgz host-189:~$ less ollama-linux-arm64.tgz ... -rwxr-xr-x runner/runner 594128 2025-02-14 06:57 lib/ollama/libggml-base.so -rwxr-xr-x runner/runner 397056 2025-02-14 06:57 lib/ollama/libggml-cpu-alderlake.so -rwxr-xr-x runner/runner 397056 2025-02-14 06:57 lib/ollama/libggml-cpu-haswell.so -rwxr-xr-x runner/runner 397056 2025-02-14 06:57 lib/ollama/libggml-cpu-icelake.so -rwxr-xr-x runner/runner 397056 2025-02-14 06:57 lib/ollama/libggml-cpu-sandybridge.so -rwxr-xr-x runner/runner 397056 2025-02-14 06:57 lib/ollama/libggml-cpu-sapphirerapids.so -rwxr-xr-x runner/runner 397056 2025-02-14 06:57 lib/ollama/libggml-cpu-skylakex.so ``` ### Relevant log output ```shell ``` ### OS Linux ### GPU Other ### CPU ARM64 ### Ollama version v0.5.11
GiteaMirror added the bug label 2026-04-22 12:25:10 -05:00
Author
Owner

@vt-alt commented on GitHub (Feb 15, 2025):

I think the problem is in this statement:

if((NOT CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
    OR (NOT CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch64|ARM64|ARMv[0-9]+"))
    set(GGML_CPU_ALL_VARIANTS ON)
endif()

If CMAKE_OSX_ARCHITECTURES is undefined (perhaps when this is not OSX) due to NOT and OR this immediately results in TRUE and GGML_CPU_ALL_VARIANTS is enabled. (Negative logic is sometimes hard to follow and error prone.)

<!-- gh-comment-id:2660987170 --> @vt-alt commented on GitHub (Feb 15, 2025): I think the problem is in this statement: ```cmake if((NOT CMAKE_OSX_ARCHITECTURES MATCHES "arm64") OR (NOT CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm|aarch64|ARM64|ARMv[0-9]+")) set(GGML_CPU_ALL_VARIANTS ON) endif() ``` If `CMAKE_OSX_ARCHITECTURES` is undefined (perhaps when this is not OSX) due to `NOT` and `OR` this immediately results in `TRUE` and `GGML_CPU_ALL_VARIANTS` is enabled. (Negative logic is sometimes hard to follow and error prone.)
Author
Owner

@vt-alt commented on GitHub (Feb 18, 2025):

Thanks for the fix!

<!-- gh-comment-id:2667050444 --> @vt-alt commented on GitHub (Feb 18, 2025): Thanks for the fix!
Author
Owner

@mgiessing commented on GitHub (Feb 19, 2025):

@jmorganca @mxyng

This happened to me as well working on ppc64le architecture

[...]
-- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF
-- CMAKE_SYSTEM_PROCESSOR: ppc64le
-- Including CPU backend
-- PowerPC detected
-- Adding CPU backend variant ggml-cpu-sandybridge: -mcpu=power10 
-- PowerPC detected
-- Adding CPU backend variant ggml-cpu-haswell: -mcpu=power10 
-- PowerPC detected
-- Adding CPU backend variant ggml-cpu-skylakex: -mcpu=power10 
-- PowerPC detected
-- Adding CPU backend variant ggml-cpu-icelake: -mcpu=power10 
-- PowerPC detected
-- Adding CPU backend variant ggml-cpu-alderlake: -mcpu=power10 
-- PowerPC detected
-- Adding CPU backend variant ggml-cpu-sapphirerapids: -mcpu=power10 
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - NOTFOUND
-- Looking for a HIP compiler
-- Looking for a HIP compiler - NOTFOUND
-- Configuring done (0.7s)
-- Generating done (0.0s)

Could we instead change the conditional check if we are on an x86 system like this?

if((CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
    OR (NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|i[3-6]86|x86|AMD64|Win64"))
    set(GGML_CPU_ALL_VARIANTS ON)
endif()  

Thank you!

Edit: Forgot the already merged part

<!-- gh-comment-id:2668668291 --> @mgiessing commented on GitHub (Feb 19, 2025): @jmorganca @mxyng This happened to me as well working on ppc64le architecture ```bash [...] -- Warning: ccache not found - consider installing it for faster compilation or disable this warning with GGML_CCACHE=OFF -- CMAKE_SYSTEM_PROCESSOR: ppc64le -- Including CPU backend -- PowerPC detected -- Adding CPU backend variant ggml-cpu-sandybridge: -mcpu=power10 -- PowerPC detected -- Adding CPU backend variant ggml-cpu-haswell: -mcpu=power10 -- PowerPC detected -- Adding CPU backend variant ggml-cpu-skylakex: -mcpu=power10 -- PowerPC detected -- Adding CPU backend variant ggml-cpu-icelake: -mcpu=power10 -- PowerPC detected -- Adding CPU backend variant ggml-cpu-alderlake: -mcpu=power10 -- PowerPC detected -- Adding CPU backend variant ggml-cpu-sapphirerapids: -mcpu=power10 -- Looking for a CUDA compiler -- Looking for a CUDA compiler - NOTFOUND -- Looking for a HIP compiler -- Looking for a HIP compiler - NOTFOUND -- Configuring done (0.7s) -- Generating done (0.0s) ``` Could we instead change the conditional check if we are on an x86 system like this? ```bash if((CMAKE_OSX_ARCHITECTURES AND NOT CMAKE_OSX_ARCHITECTURES MATCHES "arm64") OR (NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|i[3-6]86|x86|AMD64|Win64")) set(GGML_CPU_ALL_VARIANTS ON) endif() ``` Thank you! Edit: Forgot the already merged part
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#31704