-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uv_cpu_info fails on Darwin ARM64 #2911
Comments
Related: nodejs/node#34238 - that PR is currently floating a libuv patch to work around this issue. |
The hw.cpufrequency sysctl seems to be missing on darwin/arm64 (Apple Silicon) but it should be okay to report 0, that's why we ignore errors from this commit onward. Fixes: libuv#2911
I've opened #2912 with a possible workaround. Can you take a look? cc @evanlucas |
This switches uv_cpu_info from using sysctlbyname to using IOKit to get the speed of the processors. macOS on ARM does not currently have the hw.cpufrequency sysctl. We are able to reliable get the clock frequency on all architectures by using IOKit. Fixes: libuv#2911
I opened #2914 in addition. cc @bnoordhuis @Keno |
Are there any other known issues on Apple Silicon? In other words, do we think it's OK to claim support in the next release? |
No known issues on our end with libuv, though our test suite is not 100% functional yet on Apple Silicon, so we may have missed something. |
With V8 8.5, node's full test suite passes as well. From what I've seen, this was the only thing that didn't work. |
This switches uv_cpu_info from using sysctlbyname to using IOKit to get the speed of the processors. macOS on ARM does not currently have the hw.cpufrequency sysctl. We are able to reliable get the clock frequency on all architectures by using IOKit. Fixes: libuv#2911 PR-URL: libuv#2914 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
The hw.cpufrequency sysctl seems to be missing on darwin/arm64 (Apple Silicon) but it should be okay to report 0, that's why we ignore errors from this commit onward. Fixes: libuv#2911
The hw.cpufrequency sysctl seems to be missing on darwin/arm64 (Apple Silicon) but it should be okay to report 0, that's why we ignore errors from this commit onward. Refs: libuv#2912 Fixes: libuv#2911
This reverts commit 87f0765. This has been reported to be unnecessary, and also returns the wrong answer (off by exactly 100x), so it is not particularly useful. This also reverts the bugfixes to the original PR: Revert "darwin: fix iOS compilation and functionality" This reverts commit 1addf9b. Revert "macos: fix the cfdata length in uv__get_cpu_speed (libuv#3356)" This reverts commit 1e70749. Revert "darwin: fix -Wsometimes-uninitialized warning" This reverts commit 6085bce. Revert "macos: fix memleaks in uv__get_cpu_speed" This reverts commit d2482ae. Fixes: libuv#3642 Then work around missing hw.cpufrequency sysctl: The hw.cpufrequency sysctl seems to be missing on darwin/arm64 (Apple Silicon) but it should be okay to report 0, that's why we ignore errors from this commit onward. Then, we can simply hard-code the sysctl hw.cpufrequency for ARM64 to the expected value, so users won't notice. Refs: libuv#2912 Fixes: libuv#2911 (cherry picked from the sequence of commits: 6868d80, eb645ea, 6c65326, 25f9730)
This reverts commit 87f0765. This has been reported to be unnecessary, and also returns the wrong answer (off by exactly 100x), so it is not particularly useful. This also reverts the bugfixes to the original PR: Revert "darwin: fix iOS compilation and functionality" This reverts commit 1addf9b. Revert "macos: fix the cfdata length in uv__get_cpu_speed (libuv#3356)" This reverts commit 1e70749. Revert "darwin: fix -Wsometimes-uninitialized warning" This reverts commit 6085bce. Revert "macos: fix memleaks in uv__get_cpu_speed" This reverts commit d2482ae. Fixes: libuv#3642 Then work around missing hw.cpufrequency sysctl: The hw.cpufrequency sysctl seems to be missing on darwin/arm64 (Apple Silicon) but it should be okay to report 0, that's why we ignore errors from this commit onward. Then, we can simply hard-code the sysctl hw.cpufrequency for ARM64 to the expected value, so users won't notice. Refs: libuv#2912 Fixes: libuv#2911 (cherry picked from the sequence of commits: 6868d80, eb645ea, 6c65326, 25f9730)
This reverts commit 87f0765. This has been reported to be unnecessary, and also returns the wrong answer (off by exactly 100x), so it is not particularly useful. This also reverts the bugfixes to the original PR: Revert "darwin: fix iOS compilation and functionality" This reverts commit 1addf9b. Revert "macos: fix the cfdata length in uv__get_cpu_speed (libuv#3356)" This reverts commit 1e70749. Revert "darwin: fix -Wsometimes-uninitialized warning" This reverts commit 6085bce. Revert "macos: fix memleaks in uv__get_cpu_speed" This reverts commit d2482ae. Fixes: libuv#3642 Then work around missing hw.cpufrequency sysctl: The hw.cpufrequency sysctl seems to be missing on darwin/arm64 (Apple Silicon) but it should be okay to report 0, that's why we ignore errors from this commit onward. Then, we can simply hard-code the sysctl hw.cpufrequency for ARM64 to the expected value, so users won't notice. Refs: libuv#2912 Fixes: libuv#2911 (cherry picked from the sequence of commits: 6868d80, eb645ea, 6c65326, 25f9730)
This reverts commit 87f0765 and implements a work-around instead. This has been reported to be unnecessary, and also returns the wrong answer (off by exactly 100x), so it is not particularly useful. This also reverts the bugfixes to the original PR: Revert "darwin: fix iOS compilation and functionality" This reverts commit 1addf9b. Revert "macos: fix the cfdata length in uv__get_cpu_speed (#3356)" This reverts commit 1e70749. Revert "darwin: fix -Wsometimes-uninitialized warning" This reverts commit 6085bce. Revert "macos: fix memleaks in uv__get_cpu_speed" This reverts commit d2482ae. The expected behavior on failure to read this info is to report 0 (for example https://github.com/libuv/libuv/blob/8975c05d199558b0cc2e98f26ce33c6090d1 d7a1/src/unix/linux.c#L834), which is which was not the case before this PR for macos. However hw.cpufrequency sysctl seems to be missing on darwin/arm64 (Apple Silicon), so we instead hardcode a plausible value. This value matches what the mach kernel will report when running Rosetta apps. Fixes: #3642 Fixes: #2911 Refs: #2912
Darwin ARM64 appears to be missing the
hw.cpufrequency
sysctl, causing uv_cpu_info to fail.I'm thinking this might just be an oversight, so I've submitted a ticket with Apple (FB7917120),
but I figured it would be worth filing an issue here as well to track the issue.
The text was updated successfully, but these errors were encountered: