@@ -41,7 +41,6 @@ public static SystemInfo Get()
41
41
42
42
return new SystemInfo ( platform , GetCudaMajorVersion ( ) , GetVulkanVersion ( ) ) ;
43
43
}
44
-
45
44
#region Vulkan version
46
45
private static string ? GetVulkanVersion ( )
47
46
{
@@ -65,7 +64,6 @@ public static SystemInfo Get()
65
64
// Return null if we failed to get the Vulkan version
66
65
return null ;
67
66
}
68
-
69
67
private static string ? GetVulkanSummary ( )
70
68
{
71
69
// Note: on Linux, this requires `vulkan-tools` to be installed. (`sudo apt install vulkan-tools`)
@@ -96,7 +94,6 @@ public static SystemInfo Get()
96
94
return null ;
97
95
}
98
96
}
99
-
100
97
static string ? ExtractVulkanVersionFromSummary ( string vulkanSummary )
101
98
{
102
99
// 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()
199
196
}
200
197
}
201
198
}
202
-
203
199
if ( string . IsNullOrEmpty ( version ) )
204
200
return - 1 ;
205
201
206
202
return ExtractMajorVersion ( ref version ) ;
207
203
}
208
-
209
204
private static int ExtractMajorVersion ( ref string version )
210
205
{
211
206
version = version . Split ( '.' ) [ 0 ] ;
212
207
if ( int . TryParse ( version , out var majorVersion ) )
213
208
return majorVersion ;
214
-
215
209
return - 1 ;
216
210
}
217
-
218
211
private static string GetCudaVersionFromPath ( string cudaPath )
219
212
{
220
213
try
@@ -237,12 +230,11 @@ private static string GetCudaVersionFromPath(string cudaPath)
237
230
return string . Empty ;
238
231
}
239
232
}
240
-
241
233
// Put it here to avoid calling NativeApi when getting the cuda version.
242
234
[ DllImport ( "kernel32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
243
235
internal static extern int AddDllDirectory ( string NewDirectory ) ;
244
236
245
237
private const string cudaVersionFile = "version.json" ;
246
238
#endregion
247
239
}
248
- }
240
+ }
0 commit comments