You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running a local instance of LlamaSharp 0.20.0 with the same version of the Cpu backend, both of which are the latest in Nuget.
On my dev machine it works fine, but on a production server (same Windows Server 2022 OS, same CPU i7 12700, same memory 32gb) it breaks while initialising the Llama backend:
Note that it has got past the llama_empty_call() line successfully.
The exception text is:
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
C# code calling in is breaking on the first ModelParams reference:
stringmodelPath=@"c:\llamamodels\sha256-6a0746a1ec1aef3e7ec53868f220ff6e389f6f8ef87a01d77c96807de94ca2aa";// this came with ollamavarparameters=newModelParams(modelPath){ContextSize=1024,GpuLayerCount=0};
Its quite hard to understand why it works on my dev machine and not on a similar production box. I made sure both are running the same version of .net 8 but this looks like its in the c++ anyway.
Here's the call stack placed in the console after the error:
Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Repeat 2 times:
--------------------------------
at LLama.Native.NativeApi.llama_backend_init()
--------------------------------
at LLama.Native.NativeApi..cctor()
at LLama.Native.NativeApi.llama_max_devices()
at LLama.Abstractions.TensorSplitsCollection..ctor()
at LLama.Common.ModelParams..ctor(System.String)
at LlamaTest.Program+<AI1>d__5.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
at LlamaTest.Program.AI1()
at LlamaTest.Program+<Main>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
at LlamaTest.Program.Main(System.String[])
at LlamaTest.Program.<Main>(System.String[])
and in the event log there are two separate entries:
Application: LlamaCS2.exe
CoreCLR Version: 8.0.824.36612
.NET Version: 8.0.8
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
at LLama.Native.NativeApi.llama_backend_init()
at LLama.Native.NativeApi.llama_backend_init()
at LLama.Native.NativeApi..cctor()
at LLama.Native.NativeApi.llama_max_devices()
at LLama.Abstractions.TensorSplitsCollection..ctor()
at LLama.Common.ModelParams..ctor(System.String)
at LlamaTest.Program+<AI1>d__5.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
at LlamaTest.Program.AI1()
at LlamaTest.Program+<Main>d__0.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon ByRef)
at LlamaTest.Program.Main(System.String[])
at LlamaTest.Program.<Main>(System.String[])
The text was updated successfully, but these errors were encountered:
Description
I'm running a local instance of LlamaSharp 0.20.0 with the same version of the Cpu backend, both of which are the latest in Nuget.
On my dev machine it works fine, but on a production server (same Windows Server 2022 OS, same CPU i7 12700, same memory 32gb) it breaks while initialising the Llama backend:
Note that it has got past the llama_empty_call() line successfully.
The exception text is:
System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
C# code calling in is breaking on the first ModelParams reference:
Its quite hard to understand why it works on my dev machine and not on a similar production box. I made sure both are running the same version of .net 8 but this looks like its in the c++ anyway.
Here's the call stack placed in the console after the error:
and in the event log there are two separate entries:
and
The text was updated successfully, but these errors were encountered: