r/AsahiLinux • u/Iron_Flagg • 6d ago
Help Would minecraft run better?
Heya, I have an M1 air 8gb model and I develop modpacks (mainly on my pc) and I am wondering if asahi would help increase performance. Currently its quite choppy and gets hot quick. Any help will be great 👍
4
Upvotes
5
u/IchKaanWas-HD 6d ago
I remember playing some decently huge modpacks back in 2023 when I still had freetime with my friends every once in a while. Given its low hardware it ran extremely good. Back then It was still my main and ran macOS.
Asahi probably wont help much here, the OpenGL driver is more recent but FPS aren't really better from my experience. I have a 200% zram ratio set up on my m1 now which I use to develope and test linux ports and projects on. Ram Management works now, but macOS compression is admitably nicer than the one found in linux. Linux ram compression can lead to ocasional stutters because the system waits for the CPU to uncompress pages.
As much as I like asahi, I don't see a reason to switch to it to better your workflow. MacOS is a very good platform for developers and I doubt the asahi devs would disagree with that or hate on macOS.
2
u/Dazzling_Comfort5734 5d ago
I find that most games and gpu related stuff run slightly better in macOS than Linux on my M2 and M1 Max.
1
u/Useful_Problem7181 6d ago
Adding on to what IchKaanWas-HD said, the metal acceleration gets you more fps on macos than opengl on asahi by at least 50-100fps..
1
u/Cool_Incident_4799 13h ago
Actually, I have the same MacBook! I actually spent quite some time working on this. I actually tested both macOS and Asahi, and I was actually surprised that MacOS ran Minecraft better than Linux.
macOS
First of all, what I will recommend is to close literally almost all other apps. This includes your browser, or any heavy Electron (you can google what this means) or browser-based app. 8GB is a tight memory budget, and anything else you close will only make it run better.
Next, I would recommend an early OOM killer. Any background process that hogs a lot of RAM is killed early, and it should be able to more accurately tell what you're actively paying attention to and what it can safely kill without you noticing.
For zswap and zram, there's actually a difference. zswap is compressed RAM that acts like a buffer to swap, and zram is simply compressed RAM. I would definitely recommend zswap, and it's probably turned on by default. DO NOT use zswap AND zram; they do pretty much the same thing and will interfere with each other.
Next thing you want to do is optimize your Java build. Minecraft runs on Java(more specifically, the JVM), and all you need to know is that there are multiple builds, and some will run faster or slower.
The default Minecraft launcher uses a Java build that's not designed for ARM64, or your Mac, so your Mac's built-in has to emulate it and run it slower. I would download Prism Launcher; it provides a built in Java manager, and additionally, as a modpack developer, I think you'll like how easy it is to isolate different modpacks. A lot of other launchers also provide this functionality, but the point is some make it easier than others.
So the main Java builds you need to keep in mind are Eclipse Temurin, IBM Semeru, and Oracle GraalVM. Eclipse Temurin is the benchmark; it's the rock-standard Java build, and most other Java builds are actually based on Eclipse Temurin, and most of them are within 1-2% of its performance. IBM Semeru actually uses a completely different runtime, but the tl;dr is that it uses less RAM but has worse performance.
I use Oracle GraalVM, and I would definitely recommend it. The idea is that it starts off slow, but within a few minutes achieves really, really good FPS and 1% lows. If you want something zero-hassle, though, I would pick Eclipse Temurin, go inside Prism Launcher'sJavaa downloader, pick Eclipse Temurin, and select it. It should automatically download an arm64 build.
If you're more comfortable with technical stuff(I presume you are; you installed Asahi Linux), I would install Oracle GraalVM(not the community edition). You can download it here: https://www.graalvm.org/downloads/, either save the extracted binary somewhere and paste in the path to it in your Java path, or click the detect button, and Prism launcher should detect it automatically. I installed it through SDKMAN!, and it worked right out of the box by clicking Detect. Keep in mind, if you click Detect, click on the one whose path has some variation of Graal or GraalVM in it.
In general, the later the version, the better. In practice, any version over 21 should do you just fine.
This is starting to get long, but one last thing: adjust your Java flags. Prism Launcher gives you a GUI to manage your memory; set it at 4 or 5 GB(search what that is in MiB). DO NOT go over 5GB or else you risk system instability. These are my Java arguments; you can put them straight into the box in Prism Launcher, and you can honestly ask around or ask AI for good flags, but these should give you a good starting point for Oracle GraalVM 25(Oracle GraalVM 25 only; some of these flags will break on other builds):
-XX:+UseZGC -XX:+AlwaysPreTouch -XX:-ZUncommit -XX:+UseStringDeduplication -Djdk.graal.CompilerConfiguration=enterprise -XX:+UseCompactObjectHeaders -XX:+PerfDisableSharedMem
Finally, some things to keep in mind: check Skip Java compatibility checks, set minimum and maximum memory to the exact same thing, don't worry about permgen, turn off auto-download Mojang Java, turn off auto-detect Java version, and check Skip Java setup prompt at startup. I reckon you could probably find similar tweaks on other launchers, but I would still heavily recommend Prism. Addressing some of your original questions, getting hot is pretty normal for a MacBook Air or even a Pro; just keep it on a desk, or ideally something metal. Try not to run it on Battery, when seriously gaming; ideally, plug it in, and check the wattage of your charger. It's usually printed somewhere; the highest they sell is 100W, I think, but I've used 40-60W, and it's done perfectly fine. There's also a good guide; it's meant for Minecraft speedrunning, but you can also take some of their tweaks for your use case: https://its-saanvi.github.io/linux-mcsr/post_install/java.html . You can take a quick look through it if you want.