We’ve got Vulkan running Minecraft Java Edition on ARM before GTA6

We’ve got Vulkan running Minecraft Java Edition on ARM before GTA6

Minecraft running at 120 FPS on Mali-G610 on RK3588

Minecraft running at 120 FPS on Mali-G610 on RK3588

So after I was tinkering with Vulkan on the libMali driver I was looking for ways to real world test it. Sure there is benchmarks (@ GeekBench please activate Vulkan in your Linux ARM builds thank you) and vulkancube but what is the point of running that if you can’t have some fun right?

On my search I just gave Google a simple query for which I did not expect an actual answer “Vulkan renderer for Minecraft” and there it was: VulkanMod. I was like sure nobody went all the way to replace the OpenGL renderer in Minecraft with Vulkan right? Well the Minecraft community did not disappoint and so after I got the PolyMC launcher installed it was as easy as to add the Mod to the instance aaaand- the game doesn’t start. Going through the log I noticed some libraries were missing (which for some reason is a deliberate choice by the mod creator) and looking inside the mod’s jar file I found the culprit quickly. While x86 had all the libraries for windows and linux, the arm64 libraries were only included for macos. Another Google search later I found lwjgl-shaderc-natives-linux-arm64.jar & lwjgl-vma-natives-linux-arm64.jar, in the PolyMC instance added those to the minecraft.jar instead of in the mod section and bam! The game is starting.

We we’re finally in the main menu of the game but clicking on the settings revealed a not so nice issue: lots of flickering. Here I have to give a shoutout to GinKage who not only is the wizard that later made the patches to have it fixed in Gnome too but first helped me get it running under Weston (where it did not have the flickering of menu items) that enabled me to get some hours of playtime testing in.

Note from GinKage: in order to fix flickering, VSync was enforced, and as such it means that e.g. vkmark will always give you a score of 60. This does not affect performance in game.

So I have to give a big thanks to xColleteral for their work on VulkanMod and the impressive feat they’ve done and to GinKage who was kind enough to take some time to point me in the right direction because there was quite some compiling with the right flags necessary.


The deep dive & Tutorial #

It’s one thing to showcase that something is running it’s another to show how to get it running.

Prerequisites:

  • A RK3588(s) based system
  • Rockchip Kernel >=6.1.84
    • The easiest way would be to use an Armbian Desktop image with the mesa-vpu extension. As of publishing this article Armbian uses 6.1.99 (also called rk-6.1-rkr5)
  • the libMali G610 userspace driver for g24 and newer
    • Will be explained below
  • A Wayland Desktop Environment
    • To have everything working this requires at least Ubuntu Noble

There’s three things we need to do:

First of all if you don’t use an Armbian image you need to make sure your Kernel’s mali driver and the libMali driver (version: g24) you’re installing are up to date. For the kernel you find it in the source at drivers/gpu/arm/bifrost/Kbuild when you look for MALI_RELEASE_NAME which as of today is "g25p0-00eac0" . In this case g24 and g25 are compatible with each other when it comes to the userspace driver. So now that we know we have a kernel that meets our requirement (Armbian takes care of this) we need to install the libMali userspace driver which you can find here (Sidenote: For older kernel drivers the issue is that the releases aren’t associated with the respective kernel driver version so you would have to look at the git history and see when which version was used and find the release here).

Now we should have a RK3588 system with Armbian Ubuntu Noble. Going into the settings under about should reveal we’re running wayland and have a G610 Panfrost GPU. This means we’re currently using the open source Panthor driver instead of libMali. To switch we need to first download the libmali driver libmali-valhall-**g610-g24p0-wayland-gbm**_1.9-1_arm64.deb . You can do this from the terminal via sudo dpkg -i and dragging the .deb file into the terminal. After that disable the panthor-gpu overlay by running sudo armbian-config going into System > Overlays and remove the x there by pressing space and save to then be prompted to reboot.

So with the panthor-overlay deactivated, libmali installed and your system rebooted you can check your settings again you should successfully see you’re still running Wayland but this time the GPU name also mentions g24.

But before we can go about installing Minecraft (or any Vulkan Game / Emulator) we need to make Vulkan work with Wayland and for that we have the vulkan-wsi-layer. Remember how I mentioned GinKage above? He is the one that makes that layer work for gaming on RK3588 so let’s leave him a star on his fork.

To get the vulkan-wsi-layer running we’re going to open the terminal again and git clone the project: (You can click on the codeblocks to select everything)

git clone https://github.com/ginkage/vulkan-wsi-layer.git
cd vulkan-wsi-layer

then you need to install some dependencies:

sudo apt install cmake libvulkan-dev libdrm-dev libwayland-dev wayland-protocols libx11-xcb-dev -y

and run this:

cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_WSI_HEADLESS=0 -DBUILD_WSI_WAYLAND=1 -DSELECT_EXTERNAL_ALLOCATOR=dma_buf_heaps -DWSIALLOC_MEMORY_HEAP_NAME=system-uncached -DENABLE_WAYLAND_FIFO_PRESENTATION_THREAD=1
sudo make -j8 install

This automatically installs the vulkan-wsi-layer into the right paths and now you can get your favorite Minecraft launcher, add the VulkanMod from Modrinth add the two libjwgl libraries for vma and shaderc to your game and start playing even online! This is how I set it up in PolyMC:

Instance configuration in PolyMC

Instance configuration in PolyMC

But please note that VulkanMod is not 100% bugfree in itself which usually can lead to invisible chests on some bigger Minecraft servers and their custom game modes.