HasTensorCores defaults to false on error

This commit is contained in:
N00MKRAD
2021-04-05 21:42:41 +02:00
parent a0e06bd306
commit 7e2c2e21f5

View File

@@ -82,15 +82,23 @@ namespace Flowframes.OS
public static bool HasTensorCores (int gpu = 0) public static bool HasTensorCores (int gpu = 0)
{ {
if (gpuList == null) try
Init(); {
if (gpuList == null)
Init();
if (gpuList == null) if (gpuList == null)
return false;
string gpuName = gpuList[gpu].FullName;
return (gpuName.Contains("RTX ") || gpuName.Contains("Tesla V") || gpuName.Contains("Tesla T"));
}
catch (Exception e)
{
Logger.Log($"HasTensorCores({gpu}) Error: {e.Message}", true);
return false; return false;
}
string gpuName = gpuList[gpu].FullName;
return (gpuName.Contains("RTX ") || gpuName.Contains("Tesla V") || gpuName.Contains("Tesla T"));
} }
} }
} }