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

Vulkan: Spurious "Failed to open JSON file" printed due to invalid Vulkan ICD files #56089

Closed
oleg-butko opened this issue Dec 20, 2021 · 15 comments · Fixed by #62641 or #66883
Closed

Comments

@oleg-butko
Copy link

oleg-butko commented Dec 20, 2021

Godot version

4.0.dev

System information

Windows 7 x64, Vulkan, GTX 970

Issue description

I'm very new to Godot. I'm just trying to open demos and examples. Here is some issues with
https://github.com/Calinou/godot-sponza/tree/4.0-dev using today's 4.0 build from https://hugo.pro/projects/godot-builds/

Seems like the most important bug is:
when I try to use "Copy Error" it shows "INTERNAL ERROR: ...": https://imgur.com/7nHYFmg

Those 3 red errors from the console:

E 0:00:00:0327   _debug_messenger_callback: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
	loader_get_json: Failed to open JSON file K:\Temp\epicgames\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win32.json
	Objects - 1
		Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 116119456
  <C++ Source>   drivers/vulkan/vulkan_context.cpp:157 @ _debug_messenger_callback()
E 0:00:00:0404   _debug_messenger_callback: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
	loader_get_json: Failed to open JSON file K:\Temp\epicgames\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win64.json
	Objects - 1
		Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 116119456
  <C++ Source>   drivers/vulkan/vulkan_context.cpp:157 @ _debug_messenger_callback()
E 0:00:00:0490   _debug_messenger_callback: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
	loader_get_json: Failed to open JSON file G:\Program Files\NVIDIA Corporation\Nsight Systems 2019.5.2\Target-Windows\x86_64\VkLayers\VkLayer_nsight-sys_windows.json
	Objects - 1
		Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 116119456
  <C++ Source>   drivers/vulkan/vulkan_context.cpp:157 @ _debug_messenger_callback()

I see these errors in other projects and in godot.windows.opt.tools.64.exe as well.

INTERNAL ERRORS and INTERNAL WARNINGS popup also when I change something in Project Settings.
But not in godot.windows.opt.tools.64.exe.

A few other issues:

  1. When I run any project on 4.0, its left top corner is in negative position, so window title is not visible. To fix this I'm using something like: run/main_run_args="--position 170,40" in project.godot.

  2. Hotkeys in godot-sponza didn't work. I had to setup them.

  3. GUI in godot-sponza is messed up. https://imgur.com/6lbuPj6

  4. I see issues with Vsync. Godot 3.4 has additional options which helps, but Godot 4 doesn't have it.

Steps to reproduce

  1. git clone --branch=4.0-dev https://github.com/Calinou/godot-sponza.git
  2. use today's 4.0 build from https://hugo.pro/projects/godot-builds/
  3. open and run

Minimal reproduction project

No response

Bugsquad edit (keywords for easier searching): Twitch, TwitchStudio, TwitchOverlayVulkanConfig, TwitchOverlayVulkanConfig64

@Chaosus Chaosus added this to the 4.0 milestone Dec 20, 2021
@Calinou
Copy link
Member

Calinou commented Dec 20, 2021

These (harmless) errors occur because of a bogus Vulkan layer that was installed by the Epic Games Launcher. This issue is not specific to Godot – it will occur in any Vulkan application, although most of them will silence it. I suppose we'll have to silence them at some point too.

Hotkeys in godot-sponza didn't work. I had to setup them.

The godot-sponza 4.0-dev branch doesn't have controls set up yet, as its README says on the 4.0-dev branch.

GUI in godot-sponza is messed up. imgur.com/6lbuPj6

It's a known issue; I didn't set it up again yet.

I see issues with Vsync. Godot 3.4 has additional options which helps, but Godot 4 doesn't have it.

Could you describe what's wrong with V-Sync? You can change the V-Sync mode in the project settings after enabling the Advanced toggle in the top-right corner and searching for vsync. You can choose between Disabled, Enabled, Mailbox and Adaptive are offered. (This is more than in 3.x where a single boolean is offered instead.)

@oleg-butko
Copy link
Author

I have found the reason. There are two options in 3.4: 1) "Use Vsync" 2) "Vsync Via Compositor". I had Vsync globally turned off in Windows Control Panel and I forgot about it. In this case option 1 turned on was not enough, but with both 1&2 it worked (now after I turned on Vsync globally option 1 is enough). In 4.0 there was no 2 and it didn't work for any option from the dropdown causing high usage of GPU and I had to turn on "Low Processor Mode".

@Calinou
Copy link
Member

Calinou commented Dec 20, 2021

Vsync Via Compositor was removed in #48622 because it caused all kinds of issues, such as applying V-Sync at a halved refresh rate without the user's request.
Also, it's interesting that a global V-Sync toggle still works on Vulkan applications. I thought it only worked on Direct3D <= 11 and OpenGL applications, given their high-level design.

Low Processor Mode does not enable V-Sync, but it enables a built-in ~145 FPS cap (it's controlled by Low Processor Mode Sleep Usec, which defaults to 6.9 milliseconds of sleeping per frame).

@oleg-butko
Copy link
Author

Vsync Via Compositor was removed

Kinda sad, but seems not critical.

it's interesting that a global V-Sync toggle still works on Vulkan applications

I just have tried. It doesn't matter if Vsync is turned on or off in Project Settings. Global Vsync is the real switch.

Here is 2 runs where I don't change Project Settings, but change the global settings.

--- Debugging process started ---
Godot Engine v4.0.stern-flowers-4.0.1675.custom_build.e31138958 - https://godotengine.org
Vulkan API 1.2.162 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 970
 
mesh ready
Project FPS: 1 (1000.00 mspf)
Project FPS: 10 (100.00 mspf)
Project FPS: 867 (1.15 mspf)
Project FPS: 868 (1.15 mspf)
Project FPS: 889 (1.12 mspf)
Project FPS: 882 (1.13 mspf)
Project FPS: 887 (1.12 mspf)
Project FPS: 877 (1.14 mspf)
--- Debugging process stopped ---


--- Debugging process started ---
Godot Engine v4.0.stern-flowers-4.0.1675.custom_build.e31138958 - https://godotengine.org
Vulkan API 1.2.162 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 970
 
mesh ready
Project FPS: 1 (1000.00 mspf)
Project FPS: 47 (21.27 mspf)
Project FPS: 60 (16.66 mspf)
Project FPS: 60 (16.66 mspf)
Project FPS: 60 (16.66 mspf)
Project FPS: 60 (16.66 mspf)
--- Debugging process stopped ---

@Calinou
Copy link
Member

Calinou commented Dec 30, 2021

Related to #56198.

@Calinou Calinou closed this as completed Dec 30, 2021
@Calinou Calinou reopened this Dec 30, 2021
@Calinou Calinou changed the title "Copy Error" causes errors to popup (Godot 4 Errors on Windows 7) Vulkan: Spurious "Failed to open JSON file" printed due to invalid Vulkan ICD files Dec 30, 2021
@TokisanGames
Copy link
Contributor

I just got this error message:

ERROR: GENERAL - Message Id Number: 0 | Message Id Name: Loader Message
        loader_get_json: Failed to open JSON file C:\Program Files\Rockstar Games\Social Club\SocialClubVulkanLayer.json
        Objects - 1
                Object[0] - VK_OBJECT_TYPE_INSTANCE, Handle 2505068707968
   at: _debug_messenger_callback (drivers/vulkan/vulkan_context.cpp:159)

I recently uninstalled GTA5 and the Rockstar launcher, which removed the JSON file. However, their loader did not remove the registry entries that referenced the above file. I found and removed the broken reference under the following registry keys, which removed the error in Godot 4:

HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ExplicitLayers
HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ImplicitLayers
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Khronos\Vulkan\ImplicitLayers

@akien-mga akien-mga added enhancement and removed bug labels Jul 2, 2022
@akien-mga
Copy link
Member

Yes these are not Godot bugs but badly designed software that installs Vulkan layers and never cleans them up on uninstall. Godot has nothing to do with them.

We could however avoid raising a warning for this and just skip the broken layers. The downside is that if you are actually trying to use such a layer (e.g. validation layers from the Vulkan SDK, or custom layers that provide additional tooling for Vulkan applications), they would also fail silently.

@Calinou
Copy link
Member

Calinou commented Jul 2, 2022

We can probably silence ICD warnings for common culprits (checking the path for Rockstar, Twitch or Epic should do the trick), and print warnings for the rest of them.

@TokisanGames
Copy link
Contributor

You could also provide more information, saying "Cannot load json file X.Json specified by registry entry hklm/software/..." so people don't have to find this ticket to solve it. I knew Rockstar had nothing to do with Godot, but still had to search to find out where the reference was coming from.

@akien-mga
Copy link
Member

The warning doesn't come from Godot though, but from the Vulkan loader. We can only ignore it based on specific keywords, not retrieve additional data (at least not easily).

@akien-mga
Copy link
Member

Could you test #62641 and see if it works? It should make those messages of "verbose" level so they should be printed as a normal (not red) message only when running Godot in verbose mode (with --verbose or matching project setting).

akien-mga added a commit to akien-mga/godot that referenced this issue Jul 2, 2022
In far most cases it seems like it's going to message about bogus manifests
in the Windows registry which point to JSON files which have since been
uninstalled, but without clearing the registry.

This happens with bogus Vulkan overlays from Twitch, Epic Online Services,
NVIDIA Nsight Systems, OBS Studio, Rockstar Games... fix your mess folks.

Fixes godotengine#56089.
@ooo-mmm
Copy link

ooo-mmm commented Jul 3, 2022

Just to add to the chaos, I am not able to open godot-cpp/test C++ GDExtension example in Godot 4.0 at all. Is there a way to remove these layers installed by Epic Launcher.

@akien-mga
Copy link
Member

@ooo-mmm You have the edit the Windows registry: #56089 (comment)

But again, these errors are not related in any way to you not being able to open Godot. They're just noise. Whatever issue you have is unrelated to these messages.

@DaiQing1995
Copy link

DaiQing1995 commented Aug 10, 2024

Just to add to the chaos, I am not able to open godot-cpp/test C++ GDExtension example in Godot 4.0 at all. Is there a way to remove these layers installed by Epic Launcher.

In my case, I found Epic Games's layer settings json files in this path:
HKEY_CURRENT_USER\Software\Khronos\Vulkan\LoaderSettings->ImplicitLayers
It works after they are delted.

@mijkolsmith
Copy link

#89305 (comment)
For me, another place to remove keys at was
HKEY_CURRENT_USER\SOFTWARE\Khronos\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment