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.46k stars 287 forks source link

MangoHUD causes Resident Evil 4 Remake to crash if it is launched with Gamescope #966

Closed DoomPenguin9 closed 1 year ago

DoomPenguin9 commented 1 year ago

Describe the bug If I launch the Resident Evil 4 Remake with gamescope and MangoHUD, the game crashes. MangoHUD works fine as long as the game is not launched with gamescope.

List relevant hardware/software information

To Reproduce Steps to reproduce the behavior:

  1. Go to the launch settings in Steam and set the launch options mangohud gamescope -f -h 1440 -- %command%
  2. Launch the game
  3. Game will proceed to crash.

Expected behavior The game runs with MangoHUD showing in the top left corner.

flightlessmango commented 1 year ago

Try setting DXVK_FILTER_DEVICE_NAME=7900

DoomPenguin9 commented 1 year ago

DXVK_FILTER_DEVICE_NAME=7900 did not help. Also, RE4 remake is a DX12 game, how is a DXVK variable applicable here?

gort818 commented 1 year ago

I believe it has to do with dxgi.

I cannot reproduce as mangohud gamescope -f -h 1440 -- %command% runs fine on my 7900XTX on arch.

Do you have an iGPU?

DoomPenguin9 commented 1 year ago

I believe it has to do with dxgi.

I cannot reproduce as mangohud gamescope -f -h 1440 -- %command% runs fine on my 7900XTX on arch.

Do you have an iGPU?

I do not have an iGPU.

flightlessmango commented 1 year ago

Do you have multiple drivers installed? e.g mesa and amdgpu-pro for example?

DoomPenguin9 commented 1 year ago

Do you have multiple drivers installed? e.g mesa and amdgpu-pro for example?

I do have AMDGPU-PRO and Mesa, but I have Mesa explicitly set as my default.

I only have the Vulkan component of AMDGPU-PRO installed, RADV is explicitly set as my default.

gort818 commented 1 year ago

Does removing amdgpu-pro help?

DoomPenguin9 commented 1 year ago

It does not help.

DoomPenguin9 commented 1 year ago

MangoApp works fine.

flightlessmango commented 1 year ago

You don't want to attach mangohud to gamescope, but the to the game itself

DoomPenguin9 commented 1 year ago

You don't want to attach mangohud to gamescope, but the to the game itself

How would I do that? Is it something like

gamescope -f -h 1440 -- bash -c " mangohud gamemoderun %command%"

If so, I just tried that, and it results in the same crash.

MatthiasGrandl commented 1 year ago

I experience the same crash on a 7900XT also inside gamescope.

gort818 commented 1 year ago

I think it should be like this gamescope -h 1440 -f -- mangohud %command%

maybe try building gamescope from git

jackun commented 1 year ago

You maybe need to "fake" enable vkBasalt: ENABLE_VKBASALT=1 gamescope...

Billli11 commented 1 year ago

Can reproduce the problem.

There are other game have this problem too.

Tested

With both game that crash,

running mangohud both inside or outside gamescope produce a crash.

But only using mangohud script cause crashes. So may be LD_PRELOAD is the problem?

there are also a error message in stderr

\re4.exe: ../mangohud/subprojects/imgui-1.81/imgui.cpp:7056: void ImGui::ErrorCheckNewFrameSanityChecks(): Assertion `g.IO.Fonts->Fonts[0]->IsLoaded() && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()?"' failed.
gort818 commented 1 year ago

@Billli11 Are you saying it works fine with gamescope, but using mangohud without gamescope crashes?

Billli11 commented 1 year ago

@gort818

No, if running both mangohud and gamescope the game will crash. If running only gamescope or mangohud the game wont crash.

If using environment variable MANGOHUD=1. Both with or without gamescope the game won't crash

-mangohud gamescope -- %command% --> crash -gamescope -- mangohud %command% --> crash -mangohud %command% --> didn't crash -gamescope -- %command% --> didn't crash -MANGOHUD=1 gamescope -- %command% --> didn't crash -gamescope -- env MANGOHUD=1 %command% --> didn't crash -MANGOHUD=1 %command% --> didn't crash -gamescope -- sh -c "mangoapp & %command%" --> didn't crash

flightlessmango commented 1 year ago

gamescope -- sh -c "mangoapp & %command%" --> didn't crash

This is the correct way to use mangohud with gamescope. Resolving the other crashes would just be to disable mangohud in those instances. In other words it's out of scope to use any other method and as such not a bug