Minecraft on Vulkan
Monday, October 7th, 2024For some time I noticed some serious problems with Minecraft: It was a resource-hog, slow and depending on the modpack, on the lower end of fps, that’s like 15, on my old RTX2060 and on my newer RX7800XT. Even with the rendering distance capped to 16 or 12 to make it playable.
A few weeks ago it also started braking steam. Like, making it impossible to run Steam at the same time as Minecraft without Steam becoming a slideshow. Something was off.
I had the slight suspicion games using Vulkan did behave better, and weren’t causing the issue, so I wanted to try it with Minecraft as well. There is VulkanMod for Minecraft, and there are even a few modpacks like Vulkan Optimized and Vulkan32. I tried both of these, and ended up using Vulkan Optimized as a base for adding a few other mods, like Journeymap, Tech Reborn or AE2. No Create though, as this is incompatible with VulkanMod. And there it was. 60fps with a rendering distance of 32. While running Steam at full steam, pun intended, at the same time.
I was also now clear that my OpenGL was horribly broken, and I couldn’t find any hint of “how”, as at the same time the performance under Vulkan was marvellous. And how could I run any other Minecraft modpack, not just those using version 1.20.1 and 1.21.1 on fabric, without Create or Hephaestos mods, under Vulkan?
Turns out, there is a translation layer available, called Zink which is part of Mesa. Alright, let’s try:
$ MESA_LOADER_DRIVER_OVERRIDE=zink glxinfo
name of display: :0
DRI3 not available
That wasn’t quite encouraging, especially since:
$ xdpyinfo | grep DRI3
DRI3
It’s configured and working, of course.
Turns out this is a bug or regression on X11 (Seems to work on Wayland), and if you also give it LIBGL_KOPPER_DRI2=1, it works:
$ MESA_LOADER_DRIVER_OVERRIDE=zink LIBGL_KOPPER_DRI2=1 glxinfo | grep "OpenGL renderer"
OpenGL renderer string: zink Vulkan 1.3(AMD Radeon RX 7800 XT (RADV NAVI32) (MESA_RADV))
And oh, boy, it works. I put these two variables into the env of the PrismLauncher settings of All The Fabric 5 and this is the result:
And, what you can’t see here, is that the render distance is at max, which happens to be 62(!) with All The Fabric 5. It’s glorious.
I’ll now go and test this out with some modpacks that had gotten unplayably slow before: Project Architect 2, ATM10, AoF7…