Skip to content

v0.8.1 -- Unable to utilize CUDA in any way #345

@Onkitova

Description

@Onkitova

Hello and thank you for the great project!

I am trying to utilize GPU (windows 11 + Nvidia 2060S with the most recent driver and CUDA 12.3) with example console project from the repo. Unfortunately, despite
NativeLibraryConfig.Instance.WithCuda().WithLogs();
it automatically loads just avx2 version:
image

If I am trying to manually adjust example project code with changing
NativeLibraryConfig.Instance.WithCuda().WithLogs();
to
NativeLibraryConfig.Instance.WithLibrary(@"C:\Users\Username\Desktop\LLamaSharp-master\LLamaSharp-master\LLama.Examples\bin\Debug\net6.0\runtimes\win-x64\native\cuda12\libllama.dll");
I am getting an exception:

System.TypeInitializationException: 'The type initializer for 'LLama.Native.NativeApi' threw an exception.'

RuntimeError: Failed to load the native library [C:\Users\Username\Desktop\LLamaSharp-master\LLamaSharp-master\LLama.Examples\bin\Debug\net6.0\runtimes\win-x64\native\cuda12\libllama.dll] you specified.

Same goes for cuda11 version. Just for the sake of info: if I am trying to manually feed avx2 version of libllama.dll with exact NativeLibraryConfig.Instance.WithLibrary(%PATH%) thing -- everything loads and works fine.

Any ideas in which direction to dig to solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions