GithubHelp home page GithubHelp logo

Godot game engine example about llamasharp HOT 7 OPEN

adammikulis avatar adammikulis commented on September 22, 2024
Godot game engine example

from llamasharp.

Comments (7)

eublefar avatar eublefar commented on September 22, 2024 1

end-user of the plugin may not always have an Nvidia gpu

You can add CPU backend by default and add some comments where to get CUDA backend.

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on September 22, 2024 1

end-user of the plugin may not always have an Nvidia gpu

@adammikulis Maybe you could include both cpu and cuda native libraries and use LLama.Native.NativeLibraryConfig to select the backend dynamically at the beginning of the program. Note that installing both cpu and cuda backends is supported in master branch but not v0.10.0. If you want to use v0.10.0, please keep those files manually.

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on September 22, 2024

@eublefar @Xsanf Maybe you'll be interested in this issue. I hope this mention didn't disturb you. :)

from llamasharp.

eublefar avatar eublefar commented on September 22, 2024

I am not familiar with Godot, but maybe you could just download all NuGet dependencies and add them to the plugin manually?
You can just click Download package on nuget page, rename it's extension to zip and extract the dlls from there.
I am not sure if it will cause assembly conflicts tho.

from llamasharp.

adammikulis avatar adammikulis commented on September 22, 2024

Thanks @eublefar, I was wondering the best way to extract those files (aside from going through an existing build). I've added them to the plugin folder and will try to manually reference them in the project. I'm wondering if PR #603 (SetDllImportResolver based loading) will help with this, as the end-user of the plugin may not always have an Nvidia gpu. It seems like either way the user will need a .csproj file, making this more suitable as a template but unable to be added to the Godot AssetLib as a typical plugin.

from llamasharp.

adammikulis avatar adammikulis commented on September 22, 2024

Thank you for the help! I've made some significant updates to my Godot add-on that bring it closer to being a useful example project. At this point I'm just trying to resolve the issue of properly referring to my backends in my .csproj.

I was able to successfully refer to a locally downloaded LLamaSharp.dll by adding a path reference to my .csproj (within an ItemGroup) but I am unable to get the Assemblies to recognize the Cuda backend I've manually added. Am I using the correct name for it? I also tried LLama and LLama.Native.

<Reference Include="llama"> <HintPath>addons\mind_game\libs\runtimes\win-x64\native\cuda12\llama.dll</HintPath> <Private>True</Private> </Reference>

image

I am calling NativeLibraryConfig.Instance.WithCuda(); as soon as the project scene loads, so I don't think that's the problem.

from llamasharp.

AsakusaRinne avatar AsakusaRinne commented on September 22, 2024

runtimes\win-x64\native\cuda12\llama.dll is the correct path, but I'm not sure whether its prefix is correct. Since you've already had an specific path of native library, you can also use NativeLibraryConfig.Instance.WithLibrary.

BTW, it might be a stupid question but may I ask whether .NET runtime higher than coreapp 3.1 could be used in godot?

from llamasharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.