-
Notifications
You must be signed in to change notification settings - Fork 471
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
I encountered an error while deploying with docker:
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. Please use `ldd` on linux, `dumpbin` on windows and `otool`to check if all the dependency of the native library is satisfied. Generally you could find the libraries under your output folder.
4. Try to compile llama.cpp yourself to generate a libllama library, then use `LLama.Native.NativeLibraryConfig.WithLibrary` to specify it at the very beginning of your code. For more informations about compilation, please refer to LLamaSharp repo on github.
at LLama.Native.NativeApi..cctor()
--- End of inner exception stack trace ---
at LLama.Native.NativeApi.llama_log_set(LLamaLogCallback logCallback)
at AiModelService.Utils.LLamaFactory.InitAllModels() in D:\WorkCode\YkfAi\src\AiModelService\Utils\LLamaFactory.cs:line 32
at AiModelService.AppInitializer.Init() in D:\WorkCode\YkfAi\src\AiModelService\AppInitializer.cs:line 14
enter the docker container:
root@8e362e937e24:/app/runtimes/linux-x64/native# ldd libllama.so
./libllama.so: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ./libllama.so)
./libllama.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./libllama.so)
./libllama.so: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./libllama.so)
linux-vdso.so.1 (0x00007ffcc97d9000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f475b0ea000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f475afa6000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f475af8c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f475adb8000)
/lib64/ld-linux-x86-64.so.2 (0x00007f475b455000)
my base image is: mcr.microsoft.com/dotnet/aspnet:7.0.13
by searching documents, i know : mcr.microsoft.com/dotnet/aspnet:7.0.13 is based on Debian11,
Debian11 not support GLIBC_2.33,
Debian12 can support GLIBC_2.33,
Refer to: https://hub.docker.com/_/microsoft-dotnet-aspnet/?tab=description
upgrade to mcr.microsoft.com/dotnet/aspnet:7.0.13-bookworm-slim-amd64
And then docker run it again,
docker exit (132)
No error output or log !
Project PackageReference:
<PackageReference Include="LLamaSharp" Version="0.8.0" />
<PackageReference Include="LLamaSharp.Backend.Cpu" Version="0.8.0" />
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
✅ Done