Subject: [PATCH] Fix Darwin sysctl calls for PPC compatibility The original code used x86-specific sysctl names that don't exist on PowerPC macOS: - vm.page_free_count: Use vm_stat command instead (universal) - machdep.tsc.frequency: Use hw.cpufrequency instead (works on PPC) --- src/device.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/device.cpp b/src/device.cpp index 6c9118a..af0e6e0 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -401,9 +401,13 @@ _cl_device_id::_cl_device_id() : name = trim(run_command("/usr/sbin/sysctl hw.model | awk '{ for(i=2;i/dev/null | awk '{ print $NF }'")); + if (max_clock_frequency == 0) + max_clock_frequency = parse_int(run_command("/usr/sbin/sysctl hw.cpufrequency_max 2>/dev/null | awk '{ print $NF }'")); } #ifdef FREEOCL_OS_WINDOWS else if (ostype == "Windows")