Skip to content

Commit

Permalink
fix: load engine linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sangjanai authored and namchuai committed Dec 11, 2024
1 parent 4a839b4 commit f1ec971
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion engine/services/engine_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -759,15 +759,17 @@ void EngineService::RegisterEngineLibPath() {
}
auto engine_dir_path = engine_dir_path_res.value().first;
auto custom_engine_path = engine_dir_path_res.value().second;
auto cuda_path = file_manager_utils::GetCudaToolkitPath(ne);

auto dylib = std::make_unique<cortex_cpp::dylib>(engine_dir_path.string(),
"engine");

auto cuda_path = file_manager_utils::GetCudaToolkitPath(ne);
// init
auto func = dylib->get_function<EngineI*()>("get_engine");
auto engine = func();
std::vector<std::filesystem::path> paths{};
paths.push_back(std::move(cuda_path));
paths.push_back(std::move(engine_dir_path));
auto register_opts = EngineI::RegisterLibraryOption{
.paths = paths,
};
Expand Down
7 changes: 6 additions & 1 deletion engine/utils/config_yaml_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ CortexConfig CortexConfigMgr::FromYaml(const std::string& path,
!node["proxyUsername"] || !node["proxyPassword"] ||
!node["verifyPeerSsl"] || !node["verifyHostSsl"] ||
!node["verifyProxySsl"] || !node["verifyProxyHostSsl"] ||
!node["sslCertPath"] || !node["sslKeyPath"] || !node["noProxy"]);
!node["supportedEngines"] || !node["sslCertPath"] ||
!node["sslKeyPath"] || !node["noProxy"]);

CortexConfig config = {
.logFolderPath = node["logFolderPath"]
Expand Down Expand Up @@ -172,6 +173,10 @@ CortexConfig CortexConfigMgr::FromYaml(const std::string& path,
: default_cfg.sslCertPath,
.sslKeyPath = node["sslKeyPath"] ? node["sslKeyPath"].as<std::string>()
: default_cfg.sslKeyPath,
.supportedEngines =
node["supportedEngines"]
? node["supportedEngines"].as<std::vector<std::string>>()
: default_cfg.supportedEngines,
};
if (should_update_config) {
l.unlock();
Expand Down

0 comments on commit f1ec971

Please sign in to comment.