Skip to content

Commit 8130841

Browse files
committed
clean-up white space -- fix for cuda version from env variable when working with nvidia/cuda containers
1 parent 3e38c06 commit 8130841

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

LLama/Native/Load/SystemInfo.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ public static SystemInfo Get()
4141

4242
return new SystemInfo(platform, GetCudaMajorVersion(), GetVulkanVersion());
4343
}
44-
4544
#region Vulkan version
4645
private static string? GetVulkanVersion()
4746
{
@@ -65,7 +64,6 @@ public static SystemInfo Get()
6564
// Return null if we failed to get the Vulkan version
6665
return null;
6766
}
68-
6967
private static string? GetVulkanSummary()
7068
{
7169
// Note: on Linux, this requires `vulkan-tools` to be installed. (`sudo apt install vulkan-tools`)
@@ -96,7 +94,6 @@ public static SystemInfo Get()
9694
return null;
9795
}
9896
}
99-
10097
static string? ExtractVulkanVersionFromSummary(string vulkanSummary)
10198
{
10299
// We have three ways of parsing the Vulkan version from the summary (output is a different between Windows and Linux)
@@ -199,22 +196,18 @@ private static int GetCudaMajorVersion()
199196
}
200197
}
201198
}
202-
203199
if (string.IsNullOrEmpty(version))
204200
return -1;
205201

206202
return ExtractMajorVersion(ref version);
207203
}
208-
209204
private static int ExtractMajorVersion(ref string version)
210205
{
211206
version = version.Split('.')[0];
212207
if (int.TryParse(version, out var majorVersion))
213208
return majorVersion;
214-
215209
return -1;
216210
}
217-
218211
private static string GetCudaVersionFromPath(string cudaPath)
219212
{
220213
try
@@ -237,12 +230,11 @@ private static string GetCudaVersionFromPath(string cudaPath)
237230
return string.Empty;
238231
}
239232
}
240-
241233
// Put it here to avoid calling NativeApi when getting the cuda version.
242234
[DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
243235
internal static extern int AddDllDirectory(string NewDirectory);
244236

245237
private const string cudaVersionFile = "version.json";
246238
#endregion
247239
}
248-
}
240+
}

0 commit comments

Comments
 (0)