flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.53k stars 289 forks source link

mangoapp not showing with gamescope in flatpak-based steam/gamescope/mangohud setup #1404

Open LukeXuan opened 3 months ago

LukeXuan commented 3 months ago

Do not report issue for old MangoHud versions

Describe the bug While mangohud %command% work without problem, gamescope --mangoapp %command% doesn't display the HUD. I can see in the log that mangoapp is launched though.

List relevant hardware/software information

To Reproduce Steps to reproduce the behavior:

  1. install steam, gamescope, and mangohud using flatpak
  2. change the game's launch command to mangohud %command%, and observe the hud showing up,
  3. change the command to gamescope --mangoapp %command%, and it doesn't

Expected behavior mangohud showing up with gamescope

Additional context Here is the log for mangoapp (the one that's not working), the actually launch options are ENABLE_GAMESCOPE_WSI=0 MANGOHUD_CONFIGFILE=/home/luke/config/MangoHud/MangoHud.conf MANGOHUD_LOG_LEVEL=debug PROTON_LOG=on gamescope --mangoapp %command%:

[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [config.cpp:122] parsing config: '/home/luke/config/MangoHud/MangoHud.conf'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:1032] Failed to read presets file: '/home/luke/.var/app/com.valvesoftware.Steam/.config/MangoHud/presets.conf'.  Falling back to default presets
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [config.cpp:122] parsing config: '/home/luke/config/MangoHud/MangoHud.conf'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_stats' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_temp' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_junction_temp' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_mem_temp' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'cpu_stats' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'cpu_temp' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'vram' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'fps' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'frametime' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'throttling_status' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'throttling_status_graph' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'frame_timing' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'fsr' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'font_size' = '16'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'text_outline' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'horizontal' = '1'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'background_alpha' = '0.3'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'alpha' = '0.5'
[2024-08-14 02:09:28.054] [MANGOHUD] [debug] [logging.cpp:237] Logger constructed!
Adding process 2074 for gameID 367520
Adding process 2073 for gameID 367520
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: mt7921_phy0
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: nct6687
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: amdgpu
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: nvme
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: k10temp
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:539] hwmon: using input: /sys/class/hwmon/hwmon5/temp1_input
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: mt7921_phy0
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: nct6687
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: amdgpu
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: nvme
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: k10temp
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: ps_controller_battery_bc:c7:46:3c:da:39
[2024-08-14 02:09:28.067] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: amdgpu
[2024-08-14 02:09:28.068] [MANGOHUD] [debug] [overlay.cpp:874] drm path check: /sys/class/drm/card1
[2024-08-14 02:09:28.068] [MANGOHUD] [debug] [overlay.cpp:916] Using gpu_metrics of /sys/class/drm/card1/device/gpu_metrics
[2024-08-14 02:09:28.068] [MANGOHUD] [debug] [overlay.cpp:974] Uploading is disabled (permit_upload = 0)
[2024-08-14 02:09:28.080] [MANGOHUD] [debug] [overlay.cpp:1067] Ram:64902632
[2024-08-14 02:09:28.080] [MANGOHUD] [debug] [overlay.cpp:1068] Cpu:AMD Ryzen 9 7950X3D 16-Core Processor
[2024-08-14 02:09:28.080] [MANGOHUD] [debug] [overlay.cpp:1069] Kernel:6.10.3-200.fc40.x86_64
[2024-08-14 02:09:28.080] [MANGOHUD] [debug] [overlay.cpp:1070] Os:Freedesktop SDK 23.08 (Flatpak runtime)
[2024-08-14 02:09:28.080] [MANGOHUD] [debug] [overlay.cpp:1071] Driver:
[2024-08-14 02:09:28.080] [MANGOHUD] [debug] [overlay.cpp:1072] CPU Scheduler:powersave

and here is the log of mangohud for comparison (MANGOHUD_LOG_LEVEL=debug MANGOHUD=1 %command%):

[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/luke/.var/app/com.valvesoftware.Steam/config/MangoHud/wine-hollow_knight.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/luke/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Proton - Experimental/files/bin/MangoHud.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/luke/.var/app/com.valvesoftware.Steam/config/MangoHud/wine64-preloader.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/etc/MangoHud.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:122] parsing config: '/home/luke/.var/app/com.valvesoftware.Steam/config/MangoHud/MangoHud.conf'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:1032] Failed to read presets file: '/home/luke/.var/app/com.valvesoftware.Steam/config/MangoHud/presets.conf'.  Falling back to default presets
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/luke/.var/app/com.valvesoftware.Steam/config/MangoHud/wine-hollow_knight.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/luke/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/common/Proton - Experimental/files/bin/MangoHud.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/home/luke/.var/app/com.valvesoftware.Steam/config/MangoHud/wine64-preloader.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:117] skipping config: '/etc/MangoHud.conf' [ not found ]
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [config.cpp:122] parsing config: '/home/luke/.var/app/com.valvesoftware.Steam/config/MangoHud/MangoHud.conf'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_stats' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_temp' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_junction_temp' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'gpu_mem_temp' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'cpu_stats' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'cpu_temp' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'vram' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'fps' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'frametime' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'throttling_status' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'throttling_status_graph' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'frame_timing' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'fsr' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'font_size' = '16'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'text_outline' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'horizontal' = '1'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'background_alpha' = '0.3'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [overlay_params.cpp:976] Param: 'alpha' = '0.5'
[2024-08-14 02:21:45.334] [MANGOHUD] [debug] [logging.cpp:237] Logger constructed!
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [overlay.cpp:1067] Ram:64902632
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [overlay.cpp:1068] Cpu:AMD Ryzen 9 7950X3D 16-Core Processor
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [overlay.cpp:1069] Kernel:6.10.3-200.fc40.x86_64
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [overlay.cpp:1070] Os:Steam Runtime 3 (sniper)
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [overlay.cpp:1071] Driver:
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [overlay.cpp:1072] CPU Scheduler:powersave
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: mt7921_phy0
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: nct6687
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: amdgpu
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: nvme
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:507] hwmon: sensor name: k10temp
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:539] hwmon: using input: /sys/class/hwmon/hwmon5/temp1_input
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: mt7921_phy0
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: nct6687
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: amdgpu
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: nvme
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: k10temp
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: ps_controller_battery_bc:c7:46:3c:da:39
[2024-08-14 02:21:45.348] [MANGOHUD] [debug] [cpu.cpp:632] hwmon: sensor name: amdgpu
[2024-08-14 02:21:45.361] [MANGOHUD] [debug] [vulkan.cpp:1859] gpu: AMD Radeon RX 7800 XT (RADV NAVI32)
[2024-08-14 02:21:45.361] [MANGOHUD] [debug] [overlay.cpp:874] drm path check: /sys/class/drm/card1
[2024-08-14 02:21:45.361] [MANGOHUD] [debug] [overlay.cpp:916] Using gpu_metrics of /sys/class/drm/card1/device/gpu_metrics
[2024-08-14 02:21:45.361] [MANGOHUD] [debug] [overlay.cpp:974] Uploading is disabled (permit_upload = 0)
Fossilize INFO: Overriding serialization path: "/home/luke/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/shadercache/367520/fozpipelinesv6/steamapprun_pipeline_cache".
[2024-08-14 02:21:45.731] [MANGOHUD] [debug] [vulkan.cpp:1859] gpu: AMD Radeon RX 7800 XT (RADV NAVI32)
[2024-08-14 02:21:45.732] [MANGOHUD] [debug] [overlay.cpp:874] drm path check: /sys/class/drm/card1
[2024-08-14 02:21:45.732] [MANGOHUD] [debug] [overlay.cpp:916] Using gpu_metrics of /sys/class/drm/card1/device/gpu_metrics
[2024-08-14 02:21:45.732] [MANGOHUD] [debug] [overlay.cpp:974] Uploading is disabled (permit_upload = 0)
[2024-08-14 02:21:45.757] [MANGOHUD] [debug] [vulkan.cpp:720] Recreating font image
[2024-08-14 02:21:45.770] [MANGOHUD] [debug] [vulkan.cpp:739] Default font tex size: 1024x1024px
[2024-08-14 02:21:47.207] [MANGOHUD] [debug] [vulkan.cpp:1546] Present mode: FIFO
[2024-08-14 02:21:47.211] [MANGOHUD] [debug] [vulkan.cpp:720] Recreating font image
[2024-08-14 02:21:47.223] [MANGOHUD] [debug] [vulkan.cpp:739] Default font tex size: 1024x1024px

I also verified that natively (using dnf install gamescope mangohud) they work, mostly. Well, the gamescope in fedora's repo is too old to have the --mangoapp option, but the old bash -c "mangoapp& vkcube" trick still works.

LukeXuan commented 3 months ago

Something happened with gamescope --mangoapp that is definitely not correct is that unless I explicitly specify the config path, mangoapp will try to read config from /var/run/1000/.... I'm unsure if that's a flatpak problem or gamescope problem. But at least that's something I can fix easily.

flightlessmango commented 3 months ago

mangoapp will try to read config from /var/run/1000/

This was a gamescope issue and has been addressed there

install steam, gamescope, and mangohud using flatpak

Does flatpak mangohud have mangoapp?

LukeXuan commented 3 months ago

Does flatpak mangohud have mangoapp?

yes,

bash-5.2$ ls -la /usr/lib/extensions/vulkan/MangoHud/bin/
total 5564
drwxr-xr-x. 1 nfsnobody nfsnobody      32 Dec 31  1969 .
drwxr-xr-x. 1 nfsnobody nfsnobody      56 Aug 12 07:48 ..
-rwxr-xr-x. 2 nfsnobody nfsnobody 5693376 Dec 31  1969 mangoapp
-rwxr-xr-x. 2 nfsnobody nfsnobody    1705 Dec 31  1969 mangohud
flightlessmango commented 3 months ago

Too often the cause lies somewhere in flatpak and if it does it's not a mangohud issue. Could you verify that this is happening outside of flatpak?

LukeXuan commented 3 months ago

running natively with packages shipped from fedora repository it works, like I previously describe,

I also verified that natively (using dnf install gamescope mangohud) they work, mostly. Well, the gamescope in fedora's repo is too old to have the --mangoapp option, but the old bash -c "mangoapp& vkcube" trick still works.

LukeXuan commented 3 months ago

Is there any information I can gather other than MANGOHUD_LOG_LEVEL=debug? At least one thing I observed is that with flatpak, running mangohud eventually leads to somewhere in the vulkan.cpp, and reports my gpu. running with --mangoapp doesn't print that line.

[2024-08-14 02:21:45.361] [MANGOHUD] [debug] [vulkan.cpp:1859] gpu: AMD Radeon RX 7800 XT (RADV NAVI32)
flightlessmango commented 3 months ago

Why are you setting ENABLE_GAMESCOPE_WSI=0 ?

LukeXuan commented 3 months ago

It's related to this issue for flatpak's gamescope: https://github.com/flathub/org.freedesktop.Platform.VulkanLayer.gamescope/issues/199

flightlessmango commented 3 months ago

That usually happens when you use mangohud with gamescope, the two layers do not work well together. Make sure you don't have mangohud layer automatically applied and use the gamescope layer

LukeXuan commented 3 months ago

If you are talking about the CreateSwapchain error, no it's independent: running gamescope without mangohud installed still triggers the errors.

leonardohn commented 4 days ago

I'm facing the exactly same issue in NixOS, which also wraps Steam into a namespace. MangoHud works as expected using MANGOHUD=1, but gamescope --mangoapp has no effect, even though it seems to initialize by looking at the logs.