|
@@ -59,8 +59,7 @@ namespace GpuCgServer
|
|
|
var exeFile = Path.Combine(exePath, exeName);
|
|
|
if (!File.Exists(exeFile))
|
|
|
throw new Exception($"文件[{exeFile}]不存在");
|
|
|
- Stopwatch sw = new Stopwatch();
|
|
|
- sw.Start();
|
|
|
+
|
|
|
Process p = new Process();
|
|
|
p.StartInfo.WorkingDirectory = exePath;
|
|
|
p.StartInfo.FileName = exeFile;
|
|
@@ -69,6 +68,8 @@ namespace GpuCgServer
|
|
|
p.StartInfo.RedirectStandardError = true;
|
|
|
p.StartInfo.RedirectStandardOutput = true;
|
|
|
p.StartInfo.UseShellExecute = false;
|
|
|
+ Stopwatch sw = new Stopwatch();
|
|
|
+ sw.Start();
|
|
|
p.Start();
|
|
|
var succeed = p.WaitForExit(timeoutSeconds * 1000);
|
|
|
if (!succeed)
|
|
@@ -77,6 +78,10 @@ namespace GpuCgServer
|
|
|
}
|
|
|
var res = p.StandardOutput.ReadToEnd();
|
|
|
sw.Stop();
|
|
|
+ if (sw.ElapsedMilliseconds < 800)
|
|
|
+ {
|
|
|
+ throw new Exception("没有GPU");
|
|
|
+ }
|
|
|
List<GpuCgResponseDto> list = new List<GpuCgResponseDto>();
|
|
|
//3:-0.000*-0.00054.553+72.917*0.000*37.756+-72.917*0.000*37.671+
|
|
|
if (res.Length<3)
|