File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,15 @@ private static int GetCudaMajorVersion()
135
135
{
136
136
return - 1 ;
137
137
}
138
+
139
+ //Ensuring cuda bin path is reachable. Especially for MAUI environment.
140
+ string cudaBinPath = Path . Combine ( cudaPath , "bin" ) ;
141
+
142
+ if ( Directory . Exists ( cudaBinPath ) )
143
+ {
144
+ AddDllDirectory ( cudaBinPath ) ;
145
+ }
146
+
138
147
version = GetCudaVersionFromPath ( cudaPath ) ;
139
148
}
140
149
else if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ public static void llama_empty_call()
26
26
llama_max_devices ( ) ;
27
27
}
28
28
29
+ [ DllImport ( "kernel32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
30
+ private static extern int AddDllDirectory ( string NewDirectory ) ;
31
+
29
32
/// <summary>
30
33
/// Get the maximum number of devices supported by llama.cpp
31
34
/// </summary>
You can’t perform that action at this time.
0 commit comments