godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.18k stars 21.03k forks source link

NVIDIA Instant Replay status indicator is everywhere now #85111

Open nanodeath opened 11 months ago

nanodeath commented 11 months ago

Godot version

v4.2.rc1

System information

Godot v4.2.rc1.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti with Max-Q Design (NVIDIA; 31.0.15.3640) - Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 Threads)

Issue description

In Godot 4.2, the Instant Replay πŸ”ƒ icon shows up in the corner of...well, basically every conceivable window in Godot, including tooltips. This wasn't present in Godot 4.1.3.

Project Selector image

Main Editor image

Build Project tooltip image

Project menu image

Filesystem Context menu image

It usually doesn't impact functionality, except...when it covers up the text, which it does sometimes.

Steps to reproduce

  1. Be on Windows, have an NVIDIA graphics card, have Instant Replay enabled (which I think is the default?) and don't have the status indicator HUD disabled.
  2. Use Godot Editor.

Workarounds:

Turn Off Instant Replay

Just hit Alt-Z and turn off Instant Replay; however, this is not per application, and some people use it. image

Turn Off Indicator

Also under the Alt-Z menu, you can go to settings -> HUD layout -> status indicator.

image

Minimal reproduction project

N/A

sonic2kk commented 11 months ago

This wasn't present in Godot 4.1.3.

If you go back to v4.1.3, does it still occur? This could help narrow down if the issue was caused by a change in Godot 4.2, or an update to the Nvidia driver software.

nanodeath commented 11 months ago

I've verified it doesn't affect 4.1.3.

Calinou commented 11 months ago

This may be a consequence of https://github.com/godotengine/godot/pull/71472, although it shouldn't affect the Forward+ and Mobile rendering methods.

akien-mga commented 11 months ago

This may be a consequence of #71472, although it shouldn't affect the Forward+ and Mobile rendering methods.

I thought so too, but that PR was merged for 4.1-stable, and the OP suggests the bug isn't present in 4.1.x.

YuriSizov commented 10 months ago

If it's present in 4.1.3, then https://github.com/godotengine/godot/pull/81251 is also out, which is weird because that's the PR I thought was responsible for the NVidia overlay now pestering me in the editor.

Edit:

Okay, I've tested it and I can't reproduce it with either 4.1.3.stable or 4.2.rc1. But I can reproduce it with my build of the current master. In either official build I don't actually get the NVidia popup that the overlay is running in this application. And in my custom build I do (and have been getting constantly for weeks).

So I think that the reports of whether it's reproduceable in 4.1.3 are not reliable. I think that #81251 is responsible but somehow we don't always apply the profile correctly still.

nanodeath commented 10 months ago

not reliable

I'm feeling a little insulted right now 😜

Here's an additional screenshot with 4.1.3 and 4.2.rc1 launchers running simultaneously:

image

YuriSizov commented 10 months ago

I'm feeling a little insulted right now...

Oh sorry, I wasn't talking about you being unreliable. Just that reports themselves aren't giving us the full picture. I think the issue can be reproduced with 4.1.3, we just don't know what triggers the behavior. This is supported by the fact that I don't have this issue with 4.2.rc1, but do have it with a custom build of the engine.

So you indeed see what you see. I just don't think that this necessarily rules 4.1.3 out.

Calinou commented 10 months ago

I wonder if this is related in any way to https://github.com/godotengine/godot/issues/75409, which is a crash I could only ever reproduce with self-compiled builds.

nanodeath commented 10 months ago

FYI, this laptop has NVIDIA Optimus on it. I'm not sure if that's standard now or has another name, but basically means the gfx drivers can decide to run an application either using the integrated (Intel) graphics or the dedicated (NVIDIA) graphics, and perhaps something changed to convince the drivers to run Godot 4.2 with the dedicated graphics. Theoretically that could have been me, but I don't think so...? I'll see if there's a configuration dashboard somewhere that configures that.

edit: maybe it was the last laptop that had Optimus πŸ™Š so maybe disregard that.

nanodeath commented 10 months ago

Some other data in case it's helpful: Windows is set to "automatically decide" which graphics device to use for both versions of Godot:

image

And weirdly, when I set it to use the "Power Saving" mode for Godot 4.2:

image ⬇ image

The Instant Replay icon is gone from the Project Manager window

image

but not the main application

image

Calinou commented 10 months ago

The Instant Replay icon is gone from the Project Manager window

The project manager always uses the Compatibility rendering method, which uses OpenGL. OpenGL and Vulkan behave differently with regards to GPU program injection (OpenGL has no layer system like Vulkan).

sonic2kk commented 10 months ago

Might #85188 be related here?

aitorciki commented 10 months ago

Might #85188 be related here?

I'm not sure how NVIDIA driver decides where to overlay the Instant Replay icon, but I've just tried with my branch you are referring to, and the icon still appears. I'll try to fully disable NVIDIA profile creation, and see if that's related, I'll report back.

Update: I can confirm fully disabling the NVIDIA profile creation removes the icon, and re-enabling it brings it back. As for why this is the case, no idea πŸ˜…. I've tried other apps with similar profiles (just an override to disable OpenGL threaded optimization, everything else defaulting to the global setting), and they don't present the same issue.

Update 2: correction: Ryujinx, that does a similar use of NVIDIA profiles (I think their implementation is referred to in code comments) also displays the icon in the game window, the fact that all windows in Godot are "game windows" is what makes this case definitely worse. Actually, it's all over the place. I've tried a few games, the icon shows half the times. It does show for many GamePass games or RetroArch for example, but I haven't seen it in any Steam game. I really don't know what triggers it.

aitorciki commented 10 months ago

@YuriSizov I think you are right: NVIDIA profiles aren't applied consistently because they can be "corrupted" during creation, and #81251 exacerbated the problem by repeating the creation process, thus being more likely to result in a corrupt profile that won't be applied.

After a bit of head scratching, I'm trying to solve the original problem and the further complication in #85188. The bad news is that I'm pretty confident fixing profile creation will result in this incident (the Instant Replay indicator) getting way worse: based on my limited test, a properly applied NVIDIA profile consistently result in the indicator showing up for people who have it enabled. The reason it's only randomly showing now is many (most?) times the profile is not properly created and thus applied.

clayjohn commented 10 months ago

@aitorciki Could we conditionally disable creating an NVidia profile, but only when Engine::get_singleton()->is_editor_hint() is true?

aitorciki commented 10 months ago

@clayjohn I'm no expert in NVIDIA profiles, but afaict the way they work is: you create a profile, you then register an executable name (or path) with that profile, and every time that executable runs and requires work from the NVIDIA driver the latter will apply that profile.

That means we can't conditionally apply the profile: if your executable name matches its registered apps, the driver will apply the profile.

I guess we could maybe not register Godot's editor as such an executable somehow (and only register exported apps instead), but the downside would then be the profile wouldn't apply to scenes ran through the editor in debug mode either, which I think would be a big miss (for instance, I'm forcing DXGI swapchain through profile to have nicer alt-tab integration + AutoHDR on Windows, and this approach would limit that, I could still create a profile manually and add new binaries over time though).

I am not sure there is an easy way out of this either: all games / emulators I've tried that have created such a profile (RetroArch, Ryujinx, CEMU, Sim City 4 to name a few) show the indicator. The ones that, having created a profile, don't show the indicator, are browsers or alike (Chrome, Brave, Steam), which probably aren't using the GPU to render their chrome, but embedded content instead.

aitorciki commented 10 months ago

Oh, good news, not the easiest to find, but digging for a while I've stumbled upon https://www.reddit.com/r/nvidia/comments/89mtzr/comment/dwud5xn/: there is a undocumented setting (0x809D5F60) that can be used to disable the indicator. It seems to be used by many apps at the driver level to control the overlay (Unreal and Unity among them).

I've tried it and it works in my setup, I can disable the indicator consistenly. I don't know if I can disable it just for the editor, it would require creating a separate profile, and being able to discrimate editor vs exported apps when creating profiles.

Should I try to explore that path? Or just disable the indicator for all Godot instances for now (like many commercial games and apps do)?

Edit: It doesn't just disable the indicator, but screen capture as a whole. If we choose the "always disabling it" path, all related features provided by GeForce in-game overlay will be disabled for all apps.

akien-mga commented 10 months ago

IIUC we register a profile each time you open a new version (executable name) of Godot. Maybe we can enable this setting to disable the indicator and GeForce features for editor binaries only (so it's done upon registration only for TOOLS_ENABLED), and leave the feature on for exported games?

Might still be a problem for exported applications like Material Maker or Pixelorama though.

Overall it looks like we stepped on an anthill with #71472, the remedy might be worse than the original problem.

aitorciki commented 10 months ago

@akien-mga one option would be to provide a setting to explicitly enable / disable the feature. Since we create a profile per project name, each project could decide what to do with the setting. Still not the easiest to figure out if you want this feature enabled or not for your application unless someone specifically complains about it.

Also, projects that don't set a custom project name default to the Godot Engine profile, shared with the editor.

What about:

I might be missing some existing heuristic to tell apart apps from games in Godot though, that'd be way smoother as a developer experience.

I disable all overlays by default, but checking forums through this issue, there are tons of complaints to NVIDIA about this indicator both showing and not showing based on user expectations, I wonder if giving the developer control over it is just the best path forward.

aitorciki commented 10 months ago

Things can never be simple 😞: I'm trying to set the flag from code, but turns out setting certain flags requires administrator privileges. This explains why NVIDIA Profile Inspector requires to run in that mode.

I'm out of ideas for this one, without an installer that runs as administrator or being included in the driver presets, I don't know a way to disable these overlays without completely dropping the NVIDIA profile.

YuriSizov commented 10 months ago

@aitorciki Thanks a lot for looking into this. There is no hurry to fix this, let's take a break and consider our options. Maybe we'll get a better idea then.

KuroodoD commented 4 months ago

Only leaving this comment because I didn't see it mentioned. This has a significant functionality impact where it almost completely blocks out file names when attempting to rename them. It can also block out node names in the scene panel when renaming if the name is long enough and the scene panel doesn't have much width. The screenshots are for 4.3 Beta 1

image image image

Edit:

I also want to highlight how difficult it is to view collision layer information image

aitorciki commented 3 months ago

@KuroodoD are you using Geforce Experience or have you updated to the new NVIDIA app meant to replace it? Afaict with the new NVIDIA app Instant Replay and other icons are only shown once on the corner of the screen, instead of on every window's corner.

This could solve most concerns with this issue as NVIDIA app becomes the default and fully replaces Geforce Experience.

@Calinou if folks can confirm NVIDIA app solves the "overlaid icons appearing everywhere" issue (it seems to only appear once at the corner of the screen) we could make the recommendation of replacing Geforce Experience with NVIDIA app the preferred workaround (replacing https://github.com/godotengine/godot-docs/pull/9028). It would not even be a workaround anymore once NVIDIA decomissions Geforce Experience in favor of the new app (hopefully soon).