Here’s a step by step guide of how to play Minecraft on the VF2, adapted from https://forums.sifive.com/t/minecraft-running-barely/4974:
The Prism launcher will help us handle the Minecraft installation.
git clone --recursive https://github.com/PrismLauncher/PrismLauncher.git cd PrismLauncher
Now install the prerequisite packages:
sudo apt update sudo apt install qt6-base-dev qtchooser qt6-base-dev-tools libqt6core6 libqt6core5compat6-dev libqt6network6 cmake ninja-build extra-cmake-modules zlib1g-dev openjdk-19-jdk
Compile Prism Launcher:
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="/usr/local" -DENABLE_LTO=ON cmake --build build sudo cmake --install build
Now, launch Prism Launcher and add a new Minecraft instance. Choose the latest version (1.20.1 for me) and launch it. Prism will ask you to log in with an account, so do that!
If Minecraft is running now, stop it.
Now we need to get a native version LWJGL3 because Minecraft doesn’t have a RISC-V version yet. I have a fork of a PR that makes LWJGL buildable on RISC-V, so we’ll use that.
Install Apache Ant first:
sudo apt install ant
git clone https://github.com/Slackadays/lwjgl3-riscv-existing cd lwjgl3-riscv-existing ant
If Ant hangs while doing the test step, just stop it.
On my VF2, Prism’s files are in
~/.local/share/PrismLauncher. We need to patch the LWJGL Java library that is in Prism to link to our newly built LWJGL native libraries. To do this, run these commands to copy them to the folder where the Java library is:
cd ~/.local/share/PrismLauncher/libraries/org/lwjgl/lwjgl/3.3.1/ cp ~/lwjgl3-riscv-existing/bin/libs/native/linux/riscv64/org/lwjgl/liblwjgl.so . cp ~/lwjgl3-riscv-existing/bin/libs/native/linux/riscv64/org/lwjgl/glfw/libglfw.so . cp ~/lwjgl3-riscv-existing/bin/libs/native/linux/riscv64/org/lwjgl/opengl/liblwjgl_opengl.so . cp ~/lwjgl3-riscv-existing/bin/libs/native/linux/riscv64/org/lwjgl/stb/liblwjgl_stb.so . cp ~/lwjgl3-riscv-existing/bin/libs/native/linux/riscv64/org/lwjgl/tinyfd/liblwjgl_tinyfd.so . cp ~/lwjgl3-riscv-existing/bin/libs/native/linux/riscv64/org/lwjgl/jemalloc/libjemalloc.so .
To patch the Java library, the
jar uf command works great.
jar uf lwjgl-3.3.1.jar liblwjgl.so jar uf lwjgl-3.3.1.jar libglfw.so jar uf lwjgl-3.3.1.jar liblwjgl_opengl.so jar uf lwjgl-3.3.1.jar liblwjgl_stb.so jar uf lwjgl-3.3.1.jar liblwjgl_tinyfd.so jar uf lwjgl-3.3.1.jar libjemalloc.so
Now we need to copy everything to our installation folder because we will disable this from happening automatically in the future.
cp * ~/.local/share/PrismLauncher/instances/1.20.1/libraries
To stop Prism from clobbering our changes every time, add
"MMC-hint": "local" to the LWJGL JSON patch file at
lwjgl-3.3.1.jar, then add
"MMC-hint": "local" to the end of the object keys (adding a comma at the end of the previous line).
Now, within the Prism launcher, go to your instances, click the Edit button for the one you have already, and go to Settings. In the Java menu, enable the Java checkbox and “Skip Java compatibility checks.” In the Version tab in Settings, click the LWJGL3 row and then the Reload button to get the new local file configuration.
If the steps worked correctly, you should be able to click the Launch button and watch Minecraft coming to life veeeeerrrrrryyyyy slowly. I couldn’t figure out how to the the Imagination GPU working even with Zink because it seems like the driver probe feature is completely broken.
I hope this works for you!