From a749056018ea901870ec3b68f423e923c44217b1 Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Wed, 8 Jan 2025 10:42:57 +0800 Subject: [PATCH] restore gpu information printing code --- source/api_cc/src/DeepPotPD.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/api_cc/src/DeepPotPD.cc b/source/api_cc/src/DeepPotPD.cc index 88ebf3add8..8de8ffe5f8 100644 --- a/source/api_cc/src/DeepPotPD.cc +++ b/source/api_cc/src/DeepPotPD.cc @@ -106,7 +106,6 @@ void DeepPotPD::init(const std::string& model, throw deepmd::deepmd_exception("Given inference model: " + model + " do not exist, please check it."); } - const char* use_cuda_toolkit = std::getenv("USE_CUDA_TOOLKIT"); gpu_enabled = (use_cuda_toolkit && (std::string(use_cuda_toolkit) == "1")); config->SetModel(pdmodel_path, pdiparams_path); @@ -114,9 +113,11 @@ void DeepPotPD::init(const std::string& model, if (!gpu_enabled) { config->DisableGpu(); config_fl->DisableGpu(); + std::cout << "load model from: " << model << " to cpu " << std::endl; } else { config->EnableUseGpu(4096, 0); config_fl->EnableUseGpu(4096, 0); + std::cout << "load model from: " << model << " to gpu:" << gpu_id << std::endl; } // NOTE: Both set to 1 now.