-
Notifications
You must be signed in to change notification settings - Fork 34
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
Doesn't work on macOS Monterey. #22
Comments
I’ve noticed this on Sonoma on a Apple Silicon Mac as well. In fact tests on this repo catch the error:
|
Seems like Apple Silicon may not support this call (and core pinning may be less useful on this architecture due to all cores sharing a unified cache?). So I guess I’ll just log a warning for now. |
Having the same issue on the M1 Max with Ventura 13.2.1. Is there any other way to achieve the same thing? |
Apple Silicon likely doesn't support thread affinity due to its heterogeneous architecture, which consists of performance and efficiency cores. |
I have an Intel Mac, set_for_current always return false too. " CPU binding is not supported on MacOS due to the lack of the necessary interface from Apple." |
Has anyone had any luck with a workaround? I would like to simulate a program running a single core machine for some testing. I know CPU affinity isn't an ideal way to do this (it is an affinity, not a guarantee, after all), but it would be nice at least for development-time experimentation, and I'd really like to avoid having to resort to a VM to make it happen. |
Hi,
I've tried the library successfully on Linux but on my development machine running macOS Monterey (version 12.6.3) it doesn't work with version 0.8.0 or 0.8.1 of this crate.
The
Vec
of available cores returned bycore_affinity::get_core_ids()
does contain the core I'm trying to pin to but thebool
returned fromcore_affinity::set_for_current(core_id)
is false.Are there any tricks I need to apply on Mac?
Kind regards,
Nicholas
The text was updated successfully, but these errors were encountered: