Add path to find llama.dll for MAUItags/0.11.0
| @@ -135,6 +135,15 @@ namespace LLama.Native | |||||
| { | { | ||||
| return -1; | return -1; | ||||
| } | } | ||||
| //Ensuring cuda bin path is reachable. Especially for MAUI environment. | |||||
| string cudaBinPath = Path.Combine(cudaPath, "bin"); | |||||
| if (Directory.Exists(cudaBinPath)) | |||||
| { | |||||
| AddDllDirectory(cudaBinPath); | |||||
| } | |||||
| version = GetCudaVersionFromPath(cudaPath); | version = GetCudaVersionFromPath(cudaPath); | ||||
| } | } | ||||
| else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) | else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) | ||||
| @@ -26,6 +26,9 @@ namespace LLama.Native | |||||
| llama_max_devices(); | llama_max_devices(); | ||||
| } | } | ||||
| [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] | |||||
| private static extern int AddDllDirectory(string NewDirectory); | |||||
| /// <summary> | /// <summary> | ||||
| /// Get the maximum number of devices supported by llama.cpp | /// Get the maximum number of devices supported by llama.cpp | ||||
| /// </summary> | /// </summary> | ||||