Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit eb28d51

Browse files
fix: cache data for gpu information (#1959)
* fix: wrap vulkan gpu function * fix: init * fix: cpu usage * fix: build windows * fix: buld macos --------- Co-authored-by: vansangpfiev <sang@jan.ai>
1 parent 4eba4ee commit eb28d51

File tree

3 files changed

+235
-164
lines changed

3 files changed

+235
-164
lines changed

engine/utils/hardware/cpu_info.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ inline CPU GetCPUInfo() {
1616
return CPU{};
1717
auto cpu = res[0];
1818
cortex::cpuid::CpuInfo inst;
19+
20+
#if defined(__linux__)
21+
float usage = 0;
22+
for (auto const& c : res) {
23+
usage += c.currentUtilisation();
24+
}
25+
usage = usage / res.size() * 100;
26+
#else
1927
float usage = GetCPUUsage();
28+
#endif
2029
// float usage = 0;
2130
return CPU{.cores = cpu.numPhysicalCores(),
2231
.arch = std::string(GetArch()),

0 commit comments

Comments
 (0)