Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
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
4 changes: 2 additions & 2 deletions engine/services/hardware_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ bool HardwareService::SetActivateHardwareConfig(
activated_ids.push_back(std::pair(e.software_id, e.priority));
}
}
std::sort(activated_ids.begin(), activated_ids.end());
std::sort(ahc_gpus.begin(), ahc_gpus.end());
std::sort(activated_ids.begin(), activated_ids.end(),
[](auto& p1, auto& p2) { return p1.second < p2.second; });
if (ahc_gpus.size() != activated_ids.size()) {
need_update = true;
} else {
Expand Down
5 changes: 4 additions & 1 deletion engine/utils/hardware/cpu_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

namespace cortex::hw {
inline CPU GetCPUInfo() {
auto cpu = hwinfo::getAllCPUs()[0];
auto res = hwinfo::getAllCPUs();
if (res.empty())
return CPU{};
auto cpu = res[0];
cortex::cpuid::CpuInfo inst;
return CPU{.cores = cpu.numPhysicalCores(),
.arch = std::string(GetArch()),
Expand Down