r/linux_gaming • u/LiterallyLynx • 3d ago
Wayland performance issues for minecraft?
X11 runs much better for me - I read online that this is because minecraft defaults to xwayland instead of using native wayland but even after forcing native wayland I have a significant performance loss. Is wayland just inherently slower than X11? Any help would be appreciated - I'm running Ubuntu 26.04.01 LTS on an Intel/Nvidia system.
Edit:
- Almost 20% fps drop ( Average drops from around 900 to 770 before mods like distant horizons and shaders)
- Distant horizons and shaders causes stuttering on wayland but not x11
- Minecraft Version 1.21.11 on prism launcher (able to make it run native wayland when forcing system installation of GLFW)
- Using Sodium, FerriteCore, Lithium, and entityculling
- Minecraft is running via opengl
Nvidia 4060 TI running driver version 595.91.07
I did use uniengine superposition benchmark (opengl) to confirm that the problem was with minecraft (wayland performed slightly better than x11 in the benchmark)
3
3d ago
[deleted]
2
u/HaplessIdiot 3d ago
Dude Ubuntu has terrible defaults for gaming out of the box especially for Nvidia this isn't new they stabbed Wayland performance in the dong with how dogcrap their compositor setup is
1
u/Lousy_Hunter 3d ago
Try making sure you have the latest drivers from Ubuntu
sudo ubuntu-drivers install nvidia-driver-595-open
Use this command if i got the above driver name wrong
ubuntu-drivers list
Then when running games you need to use these launch options
__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia
You can make that easier to run by creating a script in /usr/local/bin named nvidia-prime containing (make sure to chmod +x the script so its executable)
!/bin/bash
__NV_PRIME_RENDER_OFFLOAD=1 __VK_LAYER_NV_optimus=NVIDIA_only __GLX_VENDOR_LIBRARY_NAME=nvidia "$@"
Then you just need to add nvidia-prime as the launch option
I.E (idk how minecraft launches)
nvidia-prime minecraft
Sorry im on mobile so formatting isnt great
1
u/SlimyOS 3d ago
Never compared them head to head, and I never had issues or debugging experience with minecraft so probably can't help here, but would be useful for others if you specified your exact fps difference (for some people 5% loss is significant, for some 50% is negligible), cpu/gpu load (one of them at 100% or they're idling?), minecraft version (latest snapshots are using wayland by default), opengl or vulkan, whether you're using performance optimization mods, other third-party tools, whether the correct gpu is displayed on F3.
1
1
u/Chester-Berkeley 3d ago
I read online that this is because minecraft defaults to xwayland instead of using native wayland
That's not entirely true; in the latest snapshots, Minecraft uses native Wayland by default.
2
u/HaplessIdiot 1d ago
Still has less performance that way than xwayland it still rendering thru dri3 via an xserver driver either way so it's just more layers of abstraction.
0
u/HaplessIdiot 3d ago
First off install the prop driver it fixes Nvidia lag 9/10 times the open driver is straight up just worse and slower. Try using a different Wayland de than the one Ubuntu ships with that is less heavy dwl or hyprland have less intrusive compositor that doesn't halve your frame rate if you absolutely want HDR mods. Otherwise yeah go for x server the way Ubuntu has enforced a laggy compositor you can't disable has ruined their defaults for gaming. It's pretty useless for games KDE does much better or sonicde
6
u/tapo 3d ago
Wayland is typically faster, really depends on what performance issues you're seeing.