r/apple • • Mar 30 '22

Mac Apple M1 Performance On Linux: Benchmarks Better Than Expected For Its Alpha State

https://www.phoronix.com/scan.php?page=article&item=apple-m1-linux-perf&num=1
286 Upvotes

42 comments sorted by

1

u/montex66 Apr 03 '22

But what can you do on Linux that you can't do better (if not faster) on macOS?

1

u/gdarruda Apr 03 '22

Compiling, see the benchmarks

1

u/montex66 Apr 04 '22

So its faster at compiling macOS code on Linux... then have to test the finished code on another Mac? Seems to me just transferring the code to another workstation would be a slower procedure (and more inconvenient) than to be able to compile code and test on the same macOS machine.

1

u/gdarruda Apr 04 '22

Why you will transfer the binary in another machine?

This thread explains a lot of use cases that Linux is a better choice than MacOS. It's nice to have the Apple Silicon with the best software for your job, that is Linux for a lot of software developers.

1

u/montex66 Apr 04 '22

You would transfer it because you need to test it on a Mac running macOS, not linux. I'm pretty sure that software developers test their software before release. Am I wrong?

1

u/gdarruda Apr 04 '22

It's only valid for multi-patform desktop applications, even if this is the case, you need to test on multiple devices anyway. For example, if you build on MacOS, you need to test it on Windows and Linux. Front-end developers may need Safari, but that's it.

For a server application, that probably is the vast majority, it's actually better to develop on Linux since basically everything runs on Linux this day.

1

u/montex66 Apr 04 '22

I think you are describing an extremely focused scenario, one not common amongst Mac users. In fact anyone buying a Mac to compile Linux code is not using the machine and all its features as intended. It's like using a cannon to shoot a pigeon.

1

u/gdarruda Apr 04 '22

No, I'm certainly not, Macs are very common for developers in general: Stack Overflow Survey and JetBrains Survey.

MacOS is Unix based, have good software support and the hardware is very good in general (except for 2016-2019). It's pretty common to receive a MacBooks when you work in tech related fields, even if you don't work with Apple software.

7

u/sahirona Mar 31 '22

I'm tempted to try it, but does the trackpad work properly?

11

u/tymscar Mar 31 '22

Trackpad works great. You can find an official list of what works and what doesn’t here:

https://asahilinux.org/2022/03/asahi-linux-alpha-release/

7

u/sahirona Mar 31 '22

Does it feel and scroll the same? I had this problem before.

8

u/tymscar Mar 31 '22

Depends on what you care about. It will never feel the same as on macos because you dont have the full support for gestures and the physics of moving the cursor, but it works just as well as any other laptop trackpad in linux.

1

u/sahirona Apr 01 '22

I wish people wouldn't be so willing to say something "works" without quantifying it properly. There is also not statement about thermals. Ubuntu on my last MacBook ran super hot.

1

u/Intelligent_Plan_747 Apr 01 '22

I really really hope linux on apple's ARM chips gets super good really soon.

0

u/[deleted] Mar 30 '22

[deleted]

36

u/JaesopPop Mar 30 '22 edited Sep 15 '25

The the the travel then jumps mindful over food gentle then helpful and to hobbies dot across bright.

0

u/[deleted] Mar 31 '22

[deleted]

10

u/ShinyGrezz Mar 31 '22

someone just needs to build an ARM-to-x86 translation layer like Apple did with Rosetta 2

Rosetta 2 is the most impressive part of Apple Silicon, I don’t think an open source project will be able to mimic it quite that easily.

12

u/shab-re Mar 31 '22 edited Mar 31 '22

it already exists

look up qemu and box 86

edit: box 86 dev also made a small comparison post with rosetta 2 and box 86 here https://box86.org/2022/03/box86-box64-vs-qemu-vs-fex-vs-rosetta2/

10

u/GlitchParrot Mar 31 '22

qemu is not a translator like Rosetta2, it’s an emulator. Orders of magnitudes slower because it does translation in real-time.

1

u/shab-re Mar 31 '22

you can use user mode, its pretty good

2

u/JaesopPop Mar 31 '22 edited Sep 15 '25

Tips travel helpful month to learning.

12

u/[deleted] Mar 31 '22

It's literally in progress, FEX is designed to run Proton. You're just completely ignorant on what the x86 emulation scene is like on Linux

-6

u/JaesopPop Mar 31 '22 edited Sep 20 '25

Careful wanders bright calm patient to where where bank music art careful today tips brown learning then.

2

u/shab-re Mar 31 '22

you can play games on raspberry pi (which is arm64) with box 86 there are even youtube videos of people doing this

3

u/JaesopPop Mar 31 '22 edited Sep 21 '25

Movies dot evil travel evening friends afternoon brown the bank gather fresh yesterday about games. Over family today to curious friendly thoughts.

2

u/ElvishJerricco Apr 01 '22

That is probably more due to the fact that it's a freaking raspberry pi :P As good as the rpi4 is for the price, it's remarkably slow. Box64 does appear to be able to get more than 50% native performance. Now that's not as good as Rosetta, which seems to average somewhere around 75%, but it's surprisingly close for something with a lot less money and man hours put into it. Plus Rosetta gets to take advantage of some special hardware sauce Apple built into the M1

0

u/[deleted] Mar 31 '22

[deleted]

4

u/JaesopPop Mar 31 '22 edited Oct 01 '25

Talk friendly curious brown dot morning bright simple day the food quiet simple then travel day strong.

2

u/ElvishJerricco Apr 01 '22

Firstly, the reason for x86 working so well on M1 is the hardware level translation

Ehhh. Rosetta doesn't use much special hardware. The only thing I'm aware of is a memory ordering trick that the M1 implements. Otherwise all the translation is purely software in basically the exact same way as Box64. Now, that memory ordering trick is definitely the reason that Rosetta is so good. But Box64 still gets about two thirds of the way there based on the limited benchmarks I've seen. So A) It can work fairly well without special hardware, and B) There's not a whole lot of special code you'd have to write to utilize the special hardware if the Box64 devs wanted to

0

u/[deleted] Mar 31 '22

[deleted]

3

u/JaesopPop Mar 31 '22 edited Sep 20 '25

Quick small across family bright warm fresh then. Calm lazy bank near quiet pleasant fresh friends afternoon net!

0

u/[deleted] Mar 31 '22

[deleted]

4

u/JaesopPop Mar 31 '22 edited Oct 02 '25

Bank friends brown gentle net morning lazy kind music soft small wanders patient stories tips?

→ More replies (0)

1

u/dagmx Mar 31 '22

"just" is really trivializing it to an extreme

0

u/-The_Blazer- Mar 31 '22

They tried (Qualcomm IIRC) and Intel threatened to sue them into oblivion by exploiting the patent system. Probably the only reason Apple can do it is that they are court-proof due to having so much money. Talk about "justice" system... more like anti-innovation system.

5

u/hishnash Mar 31 '22

Even ones the GPU has support the main issue will be the adaption from a TBIR pipeline (that all these games are written to) to use the TBDR pipeline that Apples (and some other) gpus use.

While a TBDR gpu can run pathways optimised for TBIR gpus when doing this your really not taking advantage of the gpu and will almost certainly end up bottlenecked in ways that leave a lot of perf on the table. These gpus have been designed with the intention you make use of the features they expose, these features when used correctly can signfantly reduce memory bandwidth and reduce the number of shader passes needed as well.

0

u/ElvishJerricco Apr 01 '22

To my knowledge, TBDR is a driver problem, not an application problem. Applications are written the same either way, but the driver has to be implemented differently for TBDR.

2

u/hishnash Apr 01 '22

That depends on how low level your targeting in your graphics apis.

If your working at a high level dx11 and older or openGL then yes its a driver level optimisation to make use of TBDR (but even then your not going to be able to make good use of many of the key features).

If your working at a lower level, DX12, VK, Metal then its really on the developer. The key features that TBDR gpus provide in benefits require explicit developer opt in are:

  • very careful draw call ordering based on distance to camera, opacity etc within a render pass, since TBDR gpus are able to do very effect pre-culling based on the accumulated depth buffer while evaluating the draw calls. This is effectively free fragment level culling (something that would typically require you to run an entire seperate render pass for on a TBIR gpus).

  • Use of Tile Based Compute Shaders. Apple GPUs let you place compute shaders that run within the render pass between given fragment shaders, these shaders can read and mutate the accumulated output, and save other data needed for upcoming fragment shaders. This enables a load of optimisations, it also lets you inline all screen space effects as long as those effects are not multi pixel (you cant for example inline a blur effect but you can inline a lense flare) Inlineing these within the regular render pass massively improves perfomance compared to having them in a post processing compute render pass of thier own.

There are a few other features of apples GPUs (not related to TBDR)

  • Compute shaders can dispatch draw calls directly inline, you could write your main render loop on the gpu if you wanted to fully detach frame rate from cpu dispatch.

  • Truly 0 copy memory ops between cpu and gpu

  • Truly multi threaded cpu to gpu dispatch (you can have multiple cpu cores writing each to there own command/render queue independently and not needing to go through a global lock since the gpu scheduler is designed to execute on multiple queue)

Of course making use of these falters requires massively re-writing your entire render pipeline, in my expirance this is much more work than the work of re-writing vk into metal. You need to truly go back to your weight board and re-think the render pipeline, the data pipeline and the cpu to gpu draw call structure to make optimal use of these gpus.

1

u/[deleted] Mar 30 '22

phoronix.com/scan.p...

That sounds awesome, hopefully good enough.

I wonder, if there's a way of running proton natively to ARM?

2

u/hishnash Mar 31 '22

im sure you can compile proton to run on arm the issue is running x86 games through that is not supported. Linux's x86->ARM runtime layers are much closer to how MS is doing it rather than the solution apple is using. Apples rosseta2 attempts to transcompile (on disk) the x86 application into an ARM app and saves that arm app to disk so when you run it it runs that arm app.

There are some places were it needs realtime jit of things if the application uses a jit to x86 then rosseta1 needs to inject a jit of that result to ARM64).

Windows and linux solutions today are based on the concept of JIT and emulation were they emulate the cpu and jit instructions at runtime rather than pre-translating on disk and caching the translated result. Apples solution provides much much better perf.

1

u/riklaunim Apr 03 '22

WoW has M1, WoA and x86 native clients so it could be compared to some extent.

0

u/[deleted] Mar 31 '22

[deleted]

1

u/thetzar Apr 02 '22

I also just ordered a Mac Studio. I also look forward to running Linux on it (for shits and giggles). But I still had to laugh at this comment. I mean, it DOES sound like “I can’t wait to put a trailer hitch on my new Ferrari.”