Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MangoHud support #13

Closed
luni3359 opened this issue Mar 13, 2022 · 13 comments
Closed

MangoHud support #13

luni3359 opened this issue Mar 13, 2022 · 13 comments
Assignees

Comments

@luni3359
Copy link

I'm trying to run Minecraft with gamemode and mangohud but the sandbox isn't recognizing commands other than gamemode. I already enabled everything in Flatseal and it's still not recognizing them.

Sorry for the different language it just says that there's no such file or directory named mangohud. I also tried with prime-runx (my distro doesn't have prime-run so I made a bash alias named prime-runx)

PolyMC log

@d-513 d-513 self-assigned this Mar 13, 2022
@d-513
Copy link
Collaborator

d-513 commented Mar 13, 2022

prime-run is available in the flatpak. Gamemode is manually added aswell.
As far as I know, you only need to do something like this flatpak override --user --env=MANGOHUD=1 org.polymc.PolyMC to enable mangohud, but I will look into it

@luni3359
Copy link
Author

I'm so dumb, I didn't realize that the prime-run script was already included, it works! But I couldn't get MangoHud to run at all. It seems like games running on OpenGL need mangohud to be run but with Vulkan MANGOHUD=1 alone works.

I have to run the official Minecraft Launcher like this for MangoHud to show up:
MANGOHUD_DLSYM=1 mangohud minecraft-launcher
as a whole my command looks like this:
prime-run gamemoderun MANGOHUD_DLSYM=1 mangohud minecraft-launcher

@d-513
Copy link
Collaborator

d-513 commented Mar 21, 2022

I'm so dumb, I didn't realize that the prime-run script was already included, it works! But I couldn't get MangoHud to run at all. It seems like games running on OpenGL need mangohud to be run but with Vulkan MANGOHUD=1 alone works.

I have to run the official Minecraft Launcher like this for MangoHud to show up:

MANGOHUD_DLSYM=1 mangohud minecraft-launcher

as a whole my command looks like this:

prime-run gamemoderun MANGOHUD_DLSYM=1 mangohud minecraft-launcher

Let me see what I can do about that. Does official launcher via flatpak work?

@luni3359
Copy link
Author

I'm using the .deb from here, it installs the official Minecraft launcher. I'm not sure if Microsoft is supporting the flatpak in flathub, but right now it seems like it's not very reliable.

I'll test tomorrow and let you know how it goes.

@d-513
Copy link
Collaborator

d-513 commented Mar 27, 2022

any results?

@d-513 d-513 changed the title How to run wrapper commands from flatpak? MangoHud support Apr 18, 2022
@TheEvilSkeleton
Copy link

TheEvilSkeleton commented May 9, 2022

I might be wrong, but you might get MangoHud working if you can add the MangoHud flatpak as an extension. Similar to how you did with Gamescope:

com.valvesoftware.Steam.Utility.gamescope:
version: stable
add-ld-path: lib
no-autodownload: true
directory: utils/gamescope

- --env=PATH=/app/bin:/app/utils/gamescope/bin:/usr/bin

After a build with this support is published on Flathub, the user should be able to install the MangoHud flatpak by running flatpak run org.freedesktop.Platform.VulkanLayer.MangoHud, or by installing with GNOME Software (maybe Discover too?).

@sarahnya
Copy link

I had MangoHud working using org.freedesktop.Platform.VulkanLayer.MangoHud and the wrapper command /usr/lib/extensions/vulkan/MangoHud/bin/mangohud --dlsym before but it didn't work today. I noticed the polymc flatpak is using the kde platform, was it using that before? I think maybe switching platform broke compatability?~

@sarahnya
Copy link

oh no wait I just checked on a different computer and mangohud is still working with the polymc flatpak on that computer~

@d-513
Copy link
Collaborator

d-513 commented May 16, 2022

it always used kde platform

@luni3359
Copy link
Author

Sorry in the end I didn't go anywhere testing because I couldn't figure how to do it properly. Flatpak's sandboxing was already making several characters in Japanese unreadable due to a bug with flatpak itself so to spare me more problems I started using the AppImage and now everything works.

@jn64
Copy link

jn64 commented May 30, 2022

How to get PolyMC + gamemode + MangoHud working

  1. Install PolyMC and MangoHud via Flatpak:

    $ flatpak install org.polymc.PolyMC org.freedesktop.Platform.VulkanLayer.MangoHud
  2. In PolyMC, set the wrapper command to: gamemoderun /usr/lib/extensions/vulkan/MangoHud/bin/mangohud --dlsym

  3. In order to use your existing (unsandboxed) MangoHud config in ~/.config/MangoHud/, do:

    $ flatpak override --user --filesystem=xdg-config/MangoHud:ro org.polymc.PolyMC

    Alternatively you can use Flatseal and add xdg-config/MangoHud:ro under the Filesystem > Other files section of PolyMC.

That's all!

Notes

  • Don't need to set the MANGOHUD or MANGOHUD_DLSYM env vars.
  • Tested with PolyMC v1.3.0, MangoHud v0.6.7-1 on Fedora 35.
  • Trans rights

@d-513
Copy link
Collaborator

d-513 commented May 30, 2022

@jn64 Thanks! I will add it to the readme

@cassiofb-dev
Copy link

Thanks for the tip @jn64 !

If you want to enable most of MangoHud variables by default you can set this variable on Flatseal:

image


MangoHud in the game will appear like in the image bellow:

image


Tested with:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants