-
Notifications
You must be signed in to change notification settings - Fork 357
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
Unable to run example Project #323
Comments
If you clone this repo and run the example project does it work, or do you get the same error? |
Trying now, standby |
Could it be because I am running .NET 8.0? Examples are 7.0 (still working on running the example from the project) |
The most possible reason is that your cpu does not support avx2. We've fixed it in #316 but it was after v0.8.0. If you found it's not clear to run the examples, please feel free to tell us to improve them. |
The example semi-ran |
Ok, please let us know if you cannot run the examples successfully. The support for non-avx2 cpu will be included in the next release. |
The examples are running, do we have an eta on the next release? |
Perhaps this weekend, it's related with a major bug fix I'm working on now. I'd recommend you to work with master branch first because there's little difference between building from source and using nuget packages. :) Besides, if you do prefer to use nuget package, there's still a quick fix for your problem with v0.8.0:
|
If i work off the master branch do i have to compile it myself? |
Please add LLamaSharp as a dependency of your project, then LLamaSharp will be compiled automatically when you compiled your project. |
one more question, I'm sorry to keep bothering you. is this correct? string libPath = "./libllama.dll";
NativeLibraryConfig.Default.WithLibrary(libPath); I get error:
|
I get this with the .so version too. |
Works with the dotnet-sdk-7.0 package, not with 8 |
So in dotnet8 native library cannot be loaded while everything goes well in dotnet 7? |
Likewise, I can't get the example projects to load. Either in 7.0 or 8.0 - LlamaSharp used to work great for me in older versions. |
One of the things that has changed from 7->8 is that llamasharp will try to autodetect certain CPU features (AVX512) and use a better binary if it detects them. So it's possible that's failing for you. To diagnose this:
NativeLibraryConfig.Default.Logging = true
NativeApi.llama_empty_call(); |
I have exact same issue as the author - I can use LlamaSharp without any issues when I use the LLamaSharp.Backend.Cpu Version 0.8.1 nuget package, but when I instead use LLamaSharp.Backend.Cuda12 nuget package Version 0.8.1, I get the error described in this post (using Llama 2 7b chat: Now I just added the 2 lines of codes (I have an NativeLibraryConfig.Instance.WithLogs(true);
NativeApi.llama_empty_call(); I did try building the libllama.dll and referencing it in the beginning of the code like this: NativeLibraryConfig.Instance.WithLibrary("G:\\libllama.dll"); EDIT: I managed to get it working by installing CUDA Toolkit: I then saw a related issue regarding this, which might be preventing this exception after PR: |
Has this been resolved with the release of v0.9.1? |
I'll close this for now, since the issue was hopefully resolved in 0.9.1. Please don't hesitate to re-open if you're still having issues! |
@martindevans Please reopen this issue. |
Checking I understand the issue correctly:
Is that correct? |
It's weird because with cuda it should select |
I have the same issue. It works with CPU, but not with GPU CUDA12. I have tested in .Net 6 and .Net 8. LlamaSharp Version: 0.13.0 GPU: RTX 4090 OS: Windows 11 "One of the dependency of the native library is missed. " Dumpbin gave this output: Microsoft (R) COFF/PE Dumper Version 14.39.33523.0 Dump of file \runtimes\win-x64\native\cuda12\llama.dll File Type: DLL Image has the following dependencies:
Summary
EDIT: It started working after installing the NVIDIA CUDA Toolkit. |
I tried to duplicate the example project in the README, but every time i run it, i get the following error
I have LLamaSharp.Backend.Cpu installed
Here is my code I am using
The text was updated successfully, but these errors were encountered: