From 2cf98c669c119d9c4d5b87e81d3c741389b0aaee Mon Sep 17 00:00:00 2001 From: utox39 Date: Fri, 16 May 2025 13:42:40 +0200 Subject: [PATCH] fix(macos): fix NoMatchingService error for intel macs when trying to retrieve gpu frequency --- src/macos/hardware.zig | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/macos/hardware.zig b/src/macos/hardware.zig index 9f8dff1..7ac6fab 100644 --- a/src/macos/hardware.zig +++ b/src/macos/hardware.zig @@ -282,7 +282,16 @@ pub fn getGpuInfo(allocator: std.mem.Allocator) !GpuInfo { } } - const gpu_freq_mhz = try getAppleSiliconGpuFreq(); + // Get cpu architecture + const arch: []u8 = try getCpuArch(allocator); + defer allocator.free(arch); + + var gpu_freq_mhz: f64 = 0.0; + + if (std.mem.eql(u8, arch, "arm64")) { + gpu_freq_mhz = try getAppleSiliconGpuFreq(); + } + const gpu_freq_ghz = @floor(gpu_freq_mhz) / 1000; gpu_info.gpu_freq = gpu_freq_ghz;