@@ -158,12 +158,8 @@ bool HardwareService::Restart(const std::string& host, int port) {
158158 v += g;
159159 }
160160 CTL_INF (" LD_LIBRARY_PATH: " << v);
161- auto data_path = file_manager_utils::GetEnginesContainerPath ();
162- auto llamacpp_path = data_path / " cortex.llamacpp/" ;
163- auto trt_path = data_path / " cortex.tensorrt-llm/" ;
164- if (!std::filesystem::exists (llamacpp_path)) {
165- std::filesystem::create_directory (llamacpp_path);
166- }
161+ auto llamacpp_path = file_manager_utils::GetCudaToolkitPath (kLlamaRepo );
162+ auto trt_path = file_manager_utils::GetCudaToolkitPath (kTrtLlmRepo );
167163
168164 auto new_v = trt_path.string () + " :" + llamacpp_path.string () + " :" + v;
169165 setenv (name, new_v.c_str (), true );
@@ -219,7 +215,10 @@ bool HardwareService::SetActivateHardwareConfig(
219215 // Need to update, proceed
220216 for (auto & e : res.value ()) {
221217 e.activated = activate (e.software_id );
222- hw_db.UpdateHardwareEntry (e.uuid , e);
218+ auto res = hw_db.UpdateHardwareEntry (e.uuid , e);
219+ if (res.has_error ()) {
220+ CTL_WRN (res.error ());
221+ }
223222 }
224223 }
225224 ahc_ = ahc;
@@ -243,11 +242,14 @@ void HardwareService::UpdateHardwareInfos() {
243242 for (auto const & gpu : gpus) {
244243 // ignore error
245244 // Note: only support NVIDIA for now, so hardware_id = software_id
246- hw_db.AddHardwareEntry (HwEntry{.uuid = gpu.uuid ,
247- .type = " gpu" ,
248- .hardware_id = std::stoi (gpu.id ),
249- .software_id = std::stoi (gpu.id ),
250- .activated = true });
245+ auto res = hw_db.AddHardwareEntry (HwEntry{.uuid = gpu.uuid ,
246+ .type = " gpu" ,
247+ .hardware_id = std::stoi (gpu.id ),
248+ .software_id = std::stoi (gpu.id ),
249+ .activated = true });
250+ if (res.has_error ()) {
251+ CTL_WRN (res.error ());
252+ }
251253 }
252254
253255 auto a = hw_db.LoadHardwareList ();
0 commit comments