-
Notifications
You must be signed in to change notification settings - Fork 371
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
How to publish a self-contained, single runtime, with multiple backends? #977
Comments
Unfortunately this is a known issue with the way the packages are built at the moment - for some reason the final publish step flattens the hierarchy and you get the error about duplicate files. Ideally the files need to be kept in the correct hierarchy (as you suggested). Would you be interested in working on a PR for this? |
@martindevans Sorry for the late reply on this, and happy new year. What I ended up doing temporarily is taking the runtime references out of my project and instead, manually copying the runtime libs to my publish output like the above structure, but that still didn't work. I also had to make a code change in NativeLibraryUtils.cs TryFindPath: I think this change is backwards compatible with using the runtime package references, but I'm not 100% sure. If I have time I'll investigate this more. |
I would make that change a couple of lines up, so you have: var candidate = Path.GetFullPath(Path.Combine(path, filename)); |
Will this change still work with your changes planned for the January update? If so I can make a PR. Thanks. |
I think it should yes - for the next update we're making as few changes to the loading system as possible. |
Description
This may be a bug or a feature request, I'm not sure.
I'm building a project for Windows which needs to support CPU and CUDA backends. In .csproj I have:
I need to publish a self-contained redistributable, so I do the following:
I get "error NETSDK1152: Found multiple publish output files with the same relative path" because it's trying to copy avx\ggml.dll, avx2\ggml.dll, avx512\ggml.dll, etc. to the same publish directory.
I can add this to the .csproj file to build without the error:
But then you end up with only one ggml.dll, one llama.dll, etc. and it's not clear or predictable which one you end up getting.
I noticed that whisper.net, a very similar project which wraps whisper.cpp, uses a different solution. It keeps the runtime libraries in separate folders even after the publish step, so this conflict doesn't occur. I.e. you end up with:
etc.
If there isn't some setting or feature I'm missing, maybe it is necessary to take a similar approach to what they're doing?
Thanks.
The text was updated successfully, but these errors were encountered: