-
Notifications
You must be signed in to change notification settings - Fork 70
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
Apple Silicon Support #3290
Comments
(Added indexing to your list for ease of reference.) Lines 16 to 19 in f5dda2d
2 is already the case; we run without the intrinsics in debug to check that the non-intrinsics code works too, so they are behind PRINCIPIA_USE_SSE3_INTRINSICS .
Re. 3 we should probably do a round of dependency catchup at some point. Re.
Those (SSE2) intrinsics are used to get vector instructions (and FMA on Windows). My understanding is that Rosetta2 will translate those to their neon equivalents, so you will get a performance penalty from getting rid of them. It is unclear to me that you would get anything resembling an improvement unless you use the corresponding neon intrinsics too. |
Benchmarks seem to indicate that dropping the intrinsics and running natively has some wins and some losses (comp.txt). I'll add intrinsics to the arm code and see what I get. Regarding 2, merely including |
I am going to throw a bucket of cold water on some of the ideas here. First, some background. As far as I am concerned macOS has been by far the most labor-intensive platform to support. We don't have easy access to a mac, and we are not familiar with that operating system, so just releasing was a constant pain until we put in place Azure pipelines. It doesn't help that, unlike Windows and Linux there is apparently no way for a user to upgrade their C++ library, so we are stuck in C++14 and must provide cheesy compatibility libraries. Until you started contributing and answering user questions (thanks a lot for that!), we were effectively unable to support user or to address macOS-specific issues (performance, in particular). That was not nice. Now to the specific ideas mentioned in your original message:
|
I will add, re. 6, that I am working on a new (and much faster) method for trajectory plotting which, among other things, involves allocating an array on the C# side, passing a pointer to it to the C++ side (in a C# |
I've actually got a handful of M1 macs now, but I think I agree that until KSP runs on Apple Silicon natively that Principia shouldn't really think about it. Cross process communication is usually janky and brittle. That may mean that it always runs under Rosetta2 if KSP never gets updated. I'd stick with fixing the cpuid_test. |
Fair enough. I'll close this once #3291 is in. |
Principia should have some level of support for M1 Macs.
Right now Principia successfully runs under Rosetta2 translation (but cpuid_test fails).
Ideally, Principia would run natively. In order for this to happen, it first has to be compiled natively. This is a matter of setting the right build flags and hiding Intel intrinsics behind
#if
guards (I have done this locally).However, building Principia as a native binary is not enough: native code cannot be run from a translated process, so no arm code can be loaded from KSP (which is x86_64 only). The solution for this is to launch a separate Principia process (I have not attempted this yet); the exact approach would depend on benchmark results.
#if
guards.(Please assign this to me)
The text was updated successfully, but these errors were encountered: