Skip to content

[BUG]: Linux-arm64 crashes with a TypeInitializationException #1192

Description

@BartjeD

Description

When attempting to run a LLamasharp API on linux-arm64, compiled als a self-contained runtime: I get a runtime error for type initialization, which says the CPU library is missing.

But I'm very sure it's installed. And of course the API works locally on Windows 11, without using a GPU.

Exception:
System.TypeInitializationException: The type initializer for 'LLama.Native.NativeApi' threw an exception. ---> LLama.Exceptions.RuntimeError: The native library cannot be correctly loaded. It could be one of the following reasons: 1. No LLamaSharp backend was installed. Please search LLamaSharp.Backend and install one of them. 2. You are using a device with only CPU but installed cuda backend. Please install cpu backend instead. 3. One of the dependency of the native library is missed

I checked the release build files, for the given API.
To be sure that the cpu lib ggml library is present, which it seems to be:
Image

Is ARM-64 supported? Do I need to install any libraries on the hosting environment?

Reproduction Steps

Run CPU only instance on linux-arm64, it will fail with LLama runtime error: `System.TypeInitializationException.... see above.

Environment & Configuration

  • Operating system: Debian 12
  • .NET runtime version: .net 9, 9.0.101
  • LLamaSharp version: 0.24.0
  • CUDA version (if you are using cuda backend): n/a
  • CPU & GPU device: arm64 Ampere Altra

Known Workarounds

N/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleStale issue will be autoclosed soon

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions