Unverified Commit af89df8c authored by SparkSnail's avatar SparkSnail Committed by GitHub
Browse files

Fix gpu detector in localTrainingService (#1068)

parent 5af01545
...@@ -105,12 +105,16 @@ class GPUScheduler { ...@@ -105,12 +105,16 @@ class GPUScheduler {
} }
private async updateGPUSummary(): Promise<void> { private async updateGPUSummary(): Promise<void> {
const cmdresult: cpp.childProcessPromise.Result = let gpuMetricPath = path.join(this.gpuMetricCollectorScriptFolder, 'gpu_metrics');
await execTail(path.join(this.gpuMetricCollectorScriptFolder, 'gpu_metrics')); if (fs.existsSync(gpuMetricPath)) {
if (cmdresult && cmdresult.stdout) { const cmdresult: cpp.childProcessPromise.Result = await execTail(gpuMetricPath);
this.gpuSummary = <GPUSummary>JSON.parse(cmdresult.stdout); if (cmdresult && cmdresult.stdout) {
} else { this.gpuSummary = <GPUSummary>JSON.parse(cmdresult.stdout);
this.log.error('Could not get gpu metrics information!'); } else {
this.log.error('Could not get gpu metrics information!');
}
} else{
this.log.warning('gpu_metrics file does not exist!')
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment