Skip to content

Commit eb0808f

Browse files
Converted LOG(FATAL) into regular errors to prevent the process from crashing
on error. PiperOrigin-RevId: 166257105
1 parent 9f84bc2 commit eb0808f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tensorflow/core/common_runtime/gpu/gpu_device.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,10 @@ Status BaseGPUDeviceFactory::CreateGPUDevice(const SessionOptions& options,
671671
}
672672

673673
int64 total_memory, available_memory;
674-
CHECK(se->DeviceMemoryUsage(&available_memory, &total_memory));
674+
if (!se->DeviceMemoryUsage(&available_memory, &total_memory)) {
675+
return errors::Unknown(
676+
strings::StrCat("Failed to query available memory for GPU ", gpu_id));
677+
}
675678

676679
int64 allocated_memory;
677680
double config_memory_fraction =

tensorflow/core/common_runtime/gpu/gpu_util.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ Status GPUUtil::Sync(Device* gpu_device) {
354354
}
355355
dev_info->stream->BlockHostUntilDone();
356356
if (!dev_info->stream->ok()) {
357-
LOG(FATAL) << "GPU sync failed";
357+
return errors::Internal("GPU sync failed");
358358
}
359359
return Status::OK();
360360
}
@@ -367,7 +367,7 @@ Status GPUUtil::SyncAll(Device* gpu_device) {
367367
}
368368
if (!dev_info->stream->parent()->SynchronizeAllActivity() ||
369369
!dev_info->stream->ok()) {
370-
LOG(FATAL) << "GPU sync failed";
370+
return errors::Internal("GPU sync failed");
371371
}
372372
return Status::OK();
373373
}

0 commit comments

Comments
 (0)