Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Cannot load the backend on MACOS #785

Open
AsakusaRinne opened this issue Jun 5, 2024 · 1 comment
Open

[BUG]: Cannot load the backend on MACOS #785

AsakusaRinne opened this issue Jun 5, 2024 · 1 comment
Labels
backend bug Something isn't working

Comments

@AsakusaRinne
Copy link
Collaborator

Description

When running examples on my MAC notebook, it got the correct path of the native library but failed to load it.

Here's the output of uname -a of my notebook.

Darwin U-0R7TCJJH-2327.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:46 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6020 arm64

Its processor is M2 Pro and system is Ventura 13.2.1.

Here's the full logs.

[llama Debug]: Loading library: 'llama'
[llama Info]: Detected OS Platform: 'OSX'
[llama Debug]: Detected OS string: 'osx-arm64'
[llama Debug]: Detected extension string: '.dylib'
[llama Debug]: Detected prefix string: 'lib'
[llama Info]: NativeLibraryConfig Description:
- LibraryName: LLama
- Path: ''
- PreferCuda: True
- PreferredAvxLevel: NoAVX
- AllowFallback: True
- SkipCheck: False
- SearchDirectories and Priorities: { ./ }
[llama Info]: NativeLibraryConfig Description:
- LibraryName: LLama
- Path: ''
- PreferCuda: True
- PreferredAvxLevel: NoAVX
- AllowFallback: True
- SkipCheck: False
- SearchDirectories and Priorities: { ./ }
[llama Debug]: Got relative library path 'runtimes/osx-arm64/native/libllama.dylib' from local with (NativeLibraryName: LLama, UseCuda: False, AvxLevel: None), trying to load it...
[llama Debug]: Found full path file '/Users/liuyaohui/Downloads/llama_test/bin/Debug/net8.0/runtimes/osx-arm64/native/libllama.dylib' for relative path 'runtimes/osx-arm64/native/libllama.dylib'
[llama Info]: Failed Loading '/Users/liuyaohui/Downloads/llama_test/bin/Debug/net8.0/runtimes/osx-arm64/native/libllama.dylib'
[llama Warning]: No library was loaded before calling native apis. This is not an error under netstandard2.0 but needs attention with net6 or higher.
Unhandled exception. System.TypeInitializationException: The type initializer for 'LLama.Native.NativeApi' threw an exception.

Reproduction Steps

Perhaps only I can reproduce it, just run the examples.

Environment & Configuration

  • Operating system: MACOS (Ventura 13.2.1)
  • .NET runtime version: .NET 8
  • LLamaSharp version: 0.13.0
  • CUDA version (if you are using cuda backend): -
  • CPU & GPU device: Apple M2 Pro

Known Workarounds

No response

@AsakusaRinne AsakusaRinne added bug Something isn't working backend labels Jun 5, 2024
@AsakusaRinne
Copy link
Collaborator Author

@SignalRT I know little about MAC and have no idea about how to move forward to dig it out now. Could you please give me some suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant