diff options
author | 2018-01-16 15:33:35 -0800 | |
---|---|---|
committer | 2018-01-16 15:37:26 -0800 | |
commit | 19993eff100fc8041bbab974105d494561845352 (patch) | |
tree | bc42179964f60bb599d439e182d0c10d5209be30 | |
parent | 0790db6fa2d084ef103c5601aecccf84cd3bd47c (diff) |
Log all valid visible cuda gpu id in one line.
PiperOrigin-RevId: 182121746
-rw-r--r-- | tensorflow/core/common_runtime/gpu/gpu_device.cc | 8 |
1 files changed, 7 insertions, 1 deletions
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<int> 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(); } |