Skip to content

Instantly share code, notes, and snippets.

@riscygeek
Last active September 8, 2023 05:57
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riscygeek/714b78deb737fb2eb9a769500d30da88 to your computer and use it in GitHub Desktop.
Save riscygeek/714b78deb737fb2eb9a769500d30da88 to your computer and use it in GitHub Desktop.
Minecraft on the Pinebook Pro

Minecraft Java on the Pinebook Pro

This is a guide on how to get Minecraft (Java Edition) working on the Pinebook Pro. If you have any issues or improvements, make a comment or contact me at <benni at stuerz dot xyz>.

Limitations

  • Only 1.14+ versions work, because they use LWJGL 3, which supports aarch64-Linux
  • Performance will be poor (especially on Survival)

My Setup

  • Pinebook Pro (duh!)
  • Fedora 37 (Gnome & Sway)

Installation

Preparations

Install the following packages:

  • OpenJDK (17 or newer)
  • C++ compiler (capable of building C++11 code)
  • cmake (3.1 or newer)
  • zlib
  • GL headers
  • Qt Development tools (5.12 or newer)
# Debian
sudo apt update
sudo apt install build-essential qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5core5a libqt5network5 libqt5gui5 cmake zlib1g-dev openjdk-17-jdk libgl1-mesa-dev

# Fedora
sudo dnf group install "C Development Tools and Libraries"
sudo dnf install cmake zlib-devel glibc-devel qt5-qtbase-devel qtchooser java-latest-openjdk-devel

# TODO: Arch/Manjaro

PolyMC

If you have PolyMC in your distro’s repo, you can install it and skip this step.

Otherwise: Download the latest PolyMC-x.y.z.tar.gz (eg. PolyMC-1.3.2.tar.gz) from https://github.com/PolyMC/PolyMC/releases. Be sure to not download the binary packages, you need to compile it yourself. Extract it and open a terminal in that directory and execute the following commands.

POLYMC=~/PolyMC # You can change this path to your liking.

mkdir -p build install

cd build

cmake ..					\
    -DCMAKE_INSTALL_PREFIX="$POLYMC" 	\
    -DCMAKE_BUILD_TYPE=Release 		\

make -j4 install # This will take a while

cmake --install . --prefix "$POLYMC" --component portable

LWJGL

Go to https://www.lwjgl.org/customize. Choose the following:

  • Mode: ZIP Bundle
  • Options: None
  • Natives: Only Linux arm64
  • Presets: None
  • Addons: None
  • Version: latest (3.3.1 as of writing)
  • Contents:
    • LWJGL core
    • GLFW
    • jemalloc
    • OpenAL
    • OpenGL
    • stb
    • Tiny File Dialogs

Then press: DOWNLOAD ZIP Run the following commands (in the same terminal):

mkdir "$POLYMC/lib"
for f in *-natives-linux-arm64.jar; do
    unzip -o "$f"
done
find linux | grep '\.so$' | xargs -I '{}' cp '{}' "$POLYMC/lib"

Configuring PolyMC

First, start PolyMC.

"$POLYMC/PolyMC"
  • On the first start it asks you a few questions.
  • First, select your language and click “Next”.
  • Then, choose the most recent Java version.
  • You should then set the maximum memory to 2048 MiB.
  • If you give it more, then the system might get unusable.
  • Click “Finish”.
  • Now, the main window of PolyMC opens.
  • Click on “Settings” and go to “Java”.
  • Now comes the important part:
  • Add to the JVM Arguments: -Dorg.lwjgl.librarypath=$POLYMC/lib (Replace $POLYMC with the path to your PolyMC installation)
  • Click on “Minecraft” and select:
    • Use system installation of GLFW
    • Use system installation of OpenAL
  • Click on “Accounts” and add your “Microsoft” or “Mojang” account.
  • You can now close the “Settings” window.
  • You can now add an instance and try to start it.

Improving Performance

Map

Superflat Maps should yield the best peformance.

Game Mode

Performance on survival is horrible (~5 fps). The better option is creative (>15fps).

Window size

Decreasing the window will improve performance significantly.

Desktop Environment

Using a standalone window manager (in my case: Sway) or a lightweight desktop environment can improve performance significantly, because more RAM is usable by Minecraft.

Servers

Play on an externally hosted server has yielded slightly better performance in my tests.

Installing Performace Mods

This is probably the part that improves the performance the most. Instructions:

  1. Click “Add Instance”.
  2. Set a name (like: “Performance”)
  3. Click on “Vanilla”
  4. Select “Fabric” as the mod loader.
  5. Click “Ok”
  6. Click “View Mods”
  7. Click “Download mods”
  8. Add the following mods
    • Sodium
    • Fabric API
    • Lithium
    • Iris Shaders
    • Starlight
    • Cull Leaves
    • Ferrite Core
  9. Optionally, add these mods too:
    • FPS Monitor (to show the FPS without clicking F3)
    • FPS Reducer (to reduce the FPS when not actively playing the game)
  10. Click on “Ok” and confirm your selection.

Best result (probably unplayable)

I have managed to get up to 100 fps. This was achieved by making the window extremely small (about 100x50) and following all the steps described before.

Known performance issues

High CPU usage after loading the game

In my tests the CPU usage was pegged at about 100% even after the game loaded. Joining a world and playing in creative for like 10 minutes should fix it.

Significant drop in FPS when opening the inventory

Sorry, I dunno why and how to fix it.

Troubleshooting

OpenGL 3.3

You may or may not get an error saying that OpenGL 3.3 is not supported. Run this command to fix it and reboot afterwards:

echo 'PAN_MESA_DEBUG=gl3' >> ~/.config/environment.d/opengl.conf

Note: This fix only applies to Linux distributions using systemd.

Game fails to start

java.lang.UnsatisfiedLinkError: Failed to locate library: …

  1. Check that $POLYMC/lib contains the following files:
    • libglfw.so
    • libjemalloc.so
    • liblwjgl.so
    • liblwjgl_opengl.so
    • liblwjgl_stb.so
    • liblwjgl_tinyfd.so
    • libopenal.so
  2. Check that you set the JVM Arguments correctly!

Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment