2

Alyssa Rosenzweig 💜: "What's this? Minecraft running…" - Treehouse Mas...

 1 year ago
source link: https://social.treehouse.systems/@alyssa/109378606742926582
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Alyssa Rosenzweig 💜: "What's this? Minecraft running…"

@yuka As usual, my Mesa (OpenGL) driver in concert with @lina 's Linux (kernel) driver. With the needed OpenGL drivers in place, getting Minecraft working on Asahi was @yuka 's work... apparently there was some "fun" with a bundled jemalloc assuming the system used 4 KiB page, whereas Asahi uses 16 KiB pages. But I'll let her tell that story ^.^

@alyssa @yuka @lina OH OH OH! Does this mean we get another post from @marcan chiding/shaming people for always assuming 4KiB?!? 👀

@FelixCLC @alyssa @yuka @lina This one's a well known one with jemalloc, nothing new... (sigh)

@marcan Still so weird to me that the hardware supports 4KB pages in virtualization but it won't work bare metal.

@daeken @marcan it’s a hack IIRC. I believe Hector has a patch to fix it, but has made the explicit choice not to upstream because it’s about time software stops relying on silly assumptions like this.

Same as when FSs assumed that HW blocks were always 512 or 4096 and would die if you used enterprise SAS drives with 520 sectors (or the inverse for assuming everything was 512 and 4096 would never be a thing)

@daeken It can work on bare metal, however, the kernel cannot handle mixing different page sizes without significant changes (page sizes are treated as a constant in the kernel). The Asahi project may provide 4k kernels in future. But IMO it's not that necessary as the only real benefit I see is the ability to run Android apps natively (well, with Waydroid vs going via KVM). FEX has page table emulation in their roadmap for this year. You would probably get better performance operating in 4k native than with page table emulation (Rosetta uses 4k pages). Though from what I've heard, the way macOS switches between 4k and 16k pages are quite hacky.

@catlover999 Oh, interesting! Makes sense, thanks. My stuff on Apple Silicon (outside of the macos userland) has all been virt, so I just must've assumed at some point and forgotten it was an assumption haha

@daeken It works bare metal, but it's measurably slower in benchmarks (simply due to higher TLB/page walk overhead), and since the IOMMUs are 16K only, there are a pile of caveats and Linux needs hacks/patches to be able to handle the CPU/IOMMU page size mismatch.

It's doable and we will support it eventually, but I am deliberately not doing so right now to encourage people to fix broken software (and because it's not really ready yet). The only software with a valid excuse to use 4K pages is emulators/JITs. Everything else needs to be fixed, and I don't want the availability of 4K kernels to be an excuse not to.

@marcan firm agreement! I mostly deal with it wrt Switch virtualization, so 4k pages is non-negotiable for me, but that very much falls under the emulation carve out

@marcan @daeken I mean the good JITs are often lenient about page sizes too, unless the thing they’re running on is really picky about page sizes. All the major web browsers and Java switched pretty quick.

@saagar @daeken @marcan note that lightweight virtual machines* (see especially libkrun) can fulfil the gap quite convincingly. Even the missing vGPU infrastructure part is getting sorted out. :)

Tbh I really don’t see a point to running 4KB page size kernels on those, the perf overhead makes it quite clear that it isn’t the mode that they were designed to run in.

* also TSO bit, upstream KVM is quite unlikely to accept custom vendor extensions tho.

@daeken @marcan @never_released 4K pages is really one of those things where Apple penalizes the performance so you don’t want to use it if you have other choices but if you *really* don’t have any options it’s a godsend
@marcan @FelixCLC @alyssa @yuka @lina i thought jemalloc solved the issue with 4KB only pages? have they seriously still not fixed it?

@alyssa Do the Apple ARM chips support 4 KiB pages, and if so, can Asahi run using 4 KiB pages?

@clamchowder @alyssa The CPU yes, but not the GPU nor the rest of the hardware, which makes supporting it tricky. We'll support it some day, but for now lots of things break with 4K pages (including the GPU).

@alyssa I have no idea while you would proudly announce that such proprietary software runs when Minetest exists.

@alyssa @yuka @lina I’m very curious what the performance is when you have an optimisation modpack installed (maybe try simply optimised since it’s easy to get through prism launcher via modrinth)

@WaterSword @alyssa @lina it’s not great either way. I tried with various settings and performance-enhancing mods. Especially in full-screen resolution it drops again. But that is fine to be honest, we are at the very beginning of this development.

@yuka @alyssa @lina thanks for the response! It’s still amazing to see the progress being made!!

@yuka @alyssa it feels like things are progressing really quickly. Always nice to see an update like this, keep up the good work!

@alyssa

@yuka

Ooh that's cool. Just out of interest, what launcher are you using? 😛

@alyssa @yuka Is it able to start Minecraft 1.19?(or Minecraft 1.17+)

Because the newer Versions use a new Shader-based Rendering Engine. Using 1.16 here kinda makes me assume it does not start the newer ones.

@alyssa I find "CPU: 10x null" more amusing than I should

@alyssa @yuka null cpu real
But in all seriousness, this is some nice work.

@alyssa @yuka This is amazing news and incredible progress :)

@alyssa @yuka Is that 28fps still a driver thing or Minecraft being the new Crisis?

@orowith2os @alyssa @yuka Yes. But for Minecraft it's really hard to tell if it's the game or the driver that causes that low FPS. I think it's more the game so I am curious if something can be done to improve the FPS.

@alyssa @yuka It is possible to run it on a Raspberry Pi as well.

@alyssa @yuka Nice! although it doesn’t run at 240HZ but progress is progress.

@alyssa @yuka Oh wow, this is huge news! This is kinda something I've been waiting on to start using Asahi Arch Linux as my daily driver—is there a bare-bones setup guide for getting it working yet?

@rin @alyssa

To get 1.19.2 running:

  • Set appropriate GL/GLSL version overrive variables to 3.3 and 1.50 respectively
  • replace jemalloc natives with fixed ones
  • make sure it runs as a native Wayland client -> replace glfw natives with ones that are built with wayland support and have patches, I stole from some AUR packages
  • I had the best results using weston as a compositor

Keep in mind that this is not supported, as in don’t bother the devs ;)

@rin @alyssa oh, besides having a working setup for gpu acceleration, including m1n1, linux and mesa from the appropriate branches! But unless you really want to tinker around, I’d recommend just waiting for this to become broadly available in the Asahi distro.

@alyssa @yuka Hello.
With your hardware experience, is it possible to gain your input with ToRpedo LTE on Ubuntu or Kali ? I have a few working Beta's in Python, a bit bugged out, but essentially working. Bearing in mind what Is happening in Eastern Europe and will probably happen in Taiwan, this could be very useful ! Hardware = various laptops + Ettus 210B + Ubuntu 22.10 or Kali.
Thanks in advance.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK