godot: Vulkan: MangoHud breaks rendering unless single-window mode is enabled

Godot version

v4.0.alpha1.official [31a7ddbf8]

System information

EndeavourOS(Arch linux) KDE, AMD Ryzen 5 3400g Vega11, AMDVLK 2022.Q1.1-1 64bit on Vulkan API 1.2.203

Issue description

After opening Godot’ projects lists there is dialog box asking about downloading projects from asset library or creating on your own and it doesn’t load properly making UI basically useless, doesn’t happen on 32bit version of the editor. logs from the terminal:

Godot Engine v4.0.alpha1.official.31a7ddbf8 - https://godotengine.org
ERROR: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        loader_scanned_icd_add: Driver /usr/lib/amdvlk64.so says it supports interface version 6 but still exports core entrypoints (Policy #LDP_DRIVER_6)
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 128156400
   at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:157)
[2022-01-29 15:10:24.472] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/boomer/Download/MangoHud.conf' [ not found ]
[2022-01-29 15:10:24.472] [MANGOHUD] [info] [config.cpp:114] skipping config: '/home/boomer/.config/MangoHud/Godot_v4.0-alpha1_linux.64.conf' [ not found ]
[2022-01-29 15:10:24.472] [MANGOHUD] [info] [config.cpp:119] parsing config: '/home/boomer/.config/MangoHud/MangoHud.conf'
Vulkan API 1.2.203 - Using Vulkan Device #0: AMD - AMD Radeon Vega 11 Graphics
[2022-01-29 15:10:24.569] [MANGOHUD] [info] [overlay.cpp:678] Uploading is disabled (permit_upload = 0)

HAPPEN ON THE RADEON DRIVER TOO!

Steps to reproduce

Run 64bit of Godot 4.0 and load empty projects list

Minimal reproduction project

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (10 by maintainers)

Commits related to this issue

Most upvoted comments

I found that MangoHud supports a DISABLE_MANGOHUD environment variable which takes precedence over MANGOHUD. So we can use that to force disabling it in the editor, and then re-allow it (without having to save the value of MANGOHUD ourselves) in the game process. I’ll make a PR shortly.

I think just this should be enough and should not prevent using MangoHud when running the project from the editor / running from the command line:

if (editor || project_manager) {
        OS::get_singleton()->set_environment("MANGOHUD", "0");
}

In main.cpp, editor should only be true when actually running the editor (Engine::get_singleton()->is_editor_hint()), not when running the game using an editor binary. (And it should handle project_manager too.)

Edit: I was wrong, I thought set_environment would only affect the environment of the current process (editor), but it also affects the environment used for child processes. This was actually discussed above, I read too fast 😃