From 19993eff100fc8041bbab974105d494561845352 Mon Sep 17 00:00:00 2001 From: Guangda Lai Date: Tue, 16 Jan 2018 15:33:35 -0800 Subject: Log all valid visible cuda gpu id in one line. PiperOrigin-RevId: 182121746 --- tensorflow/core/common_runtime/gpu/gpu_device.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.cc b/tensorflow/core/common_runtime/gpu/gpu_device.cc index f7b733aa00..0e5b6b7ef8 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_device.cc @@ -1297,9 +1297,15 @@ Status BaseGPUDeviceFactory::GetValidDeviceIds( "TF_MIN_GPU_MULTIPROCESSOR_COUNT."; continue; } - LOG(INFO) << "Adding visible gpu device " << visible_gpu_id; ids->push_back(visible_gpu_id); } + if (!ids->empty()) { + std::vector raw_ids(ids->size()); + std::transform(ids->begin(), ids->end(), raw_ids.begin(), + [](CudaGpuId id) -> int { return id.value(); }); + LOG(INFO) << "Adding visible gpu devices: " + << str_util::Join(raw_ids, ", "); + } return Status::OK(); } -- cgit v1.2.3