-
Using NuGetForUnity, I've installed the LLamaSharp package and the Cuda12 Windows backend. This backend has the CPU backend as a dependency so that installs too. Clearly all the native libraries are recognized by Unity as evidenced by all the "Multiple plugins with the same name 'llama'", etc. errors. I can run my project and get LLamaSharp to work fine with the CPU. I can run LLamaSharp on a GPU fine outside of Unity. But I can't seem to run LLamaSharp on Unity with the GPU. I've scoured this project's discussion board and issue list for help but it mostly seems to be outdated due to the fast-moving nature of this project. I know there is a LLamaSharpForUnity git example, but that is 2 years old. Despite that, I tried using the method described in the readme and still no luck. I've tried removing all the native libraries but the cuda 12 windows dlls, and while that gets rid of the "Multiple plugins" error messages, LLamaSharp give me the native backend error and does not work. I looked into the NativeLibaryConfig methods but I've basically tried everything I could on my own and I'm stuck hence the reason for this post. Am I missing something simple? How does LLamaSharp determine what backend to use upon bootstrapping? Any help is greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I got it working by doing the following steps:
And this'll use the backend you downloaded -- the only one available. No So yeah if you use git with multiple people with multiple OS's, consider the following:
And, either do some Unity magic for 100% automation, or just let your teammates know they need to run the bash script first. |
Beta Was this translation helpful? Give feedback.
I got it working by doing the following steps:
NuGetForUnity
package via git linkLLamaSharp
and the backend of my choiceggml-cpu.dll
over from theBackend.Cpu
folder to the actual backend's folderBackend.Cpu
folder completelyNuGetForUnity
to prevent it from re-downloading theCpu
backend as dependency.And this'll use the backend you downloaded -- the only one available. No
WithLibary()
norWithCuda()
needed!If you wanna ship to multiple platforms, just use different configs before building and ship with the appropriate DLLs.
It's only a little problematic if other people in your team use different OS's.
So yeah…