Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions source/api_cc/src/DataModifierTF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ void DipoleChargeModifierTF::init(const std::string& model,
0.9);
options.config.mutable_gpu_options()->set_allow_growth(true);
DPErrcheck(DPSetDevice(gpu_rank % gpu_num));
std::string str = "/gpu:";
str += std::to_string(gpu_rank % gpu_num);
std::string str = "/gpu:0";
// See
// https://github.com/tensorflow/tensorflow/blame/8fac27b486939f40bc8e362b94a16a4a8bb51869/tensorflow/core/protobuf/config.proto#L80
options.config.mutable_gpu_options()->set_visible_device_list(
std::to_string(gpu_rank % gpu_num));
graph::SetDefaultDevice(str, graph_def);
}
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
Expand Down
7 changes: 5 additions & 2 deletions source/api_cc/src/DeepPotTF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,11 @@ void DeepPotTF::init(const std::string& model,
0.9);
options.config.mutable_gpu_options()->set_allow_growth(true);
DPErrcheck(DPSetDevice(gpu_rank % gpu_num));
std::string str = "/gpu:";
str += std::to_string(gpu_rank % gpu_num);
std::string str = "/gpu:0";
// See
// https://github.com/tensorflow/tensorflow/blame/8fac27b486939f40bc8e362b94a16a4a8bb51869/tensorflow/core/protobuf/config.proto#L80
Comment thread
njzjz marked this conversation as resolved.
options.config.mutable_gpu_options()->set_visible_device_list(
std::to_string(gpu_rank % gpu_num));
graph::SetDefaultDevice(str, graph_def);
}
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
Expand Down
7 changes: 5 additions & 2 deletions source/api_cc/src/DeepTensorTF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ void DeepTensorTF::init(const std::string &model,
0.9);
options.config.mutable_gpu_options()->set_allow_growth(true);
DPErrcheck(DPSetDevice(gpu_rank % gpu_num));
std::string str = "/gpu:";
str += std::to_string(gpu_rank % gpu_num);
std::string str = "/gpu:0";
// See
// https://github.com/tensorflow/tensorflow/blame/8fac27b486939f40bc8e362b94a16a4a8bb51869/tensorflow/core/protobuf/config.proto#L80
options.config.mutable_gpu_options()->set_visible_device_list(
std::to_string(gpu_rank % gpu_num));
graph::SetDefaultDevice(str, graph_def);
}
#endif // GOOGLE_CUDA || TENSORFLOW_USE_ROCM
Expand Down