OpenGL Initialization delay scales linearly with the amount of running instances

I found this weird issue when using the Godot engine. The original issue an be found here: [url]https://github.com/godotengine/godot/issues/14850#issuecomment-353811771[/url]

This is confirmed on a GTX 950, 940M, 1060, and other NVIDIA cards. Windows only

The OpenGL issue can be replicated with the Godot engine and I’m not really sure what else to do. Long story short, this is how to replicate the issue:

When you initialize one OpenGL instance, under the same executable, there is no delay. However, when you initialize a second OpenGL instance from the same executable, the delay starts to linearly scale with the amount you have open.

To further illustrate this: load up the Godot engine once. Load up the same Godot executable again, and there will be a 1-2 second delay when initializing OpenGL. Then, load up the third instance and it’s now a 3 second delay. Then, load up a 4th one, and it’s a 4 second delay and so on. Very hard to explain so please try it yourself!

This causes a great headache within the game engine because when you are previewing a scene, it loads up the same executable and the delay happens. I found a temporary fix for this that requires game devs to re-compile the entire source code. However, that’s really a band-aide solution tbh.

The delay does not occur when it’s a different executable (and doesn’t happen on any AMD cards)

I am asking if it’s possible for the NVIDIA driver developers to help the Godot core developers on finding a solution to this. It would be awesome!

Thanks for reading :)

To the best of my limited knowledge, this is an nvidia driver bug.

I have the same thing here: launching the same exe over and over is only fast if the name is changed - OpenGL - NVIDIA Developer Forums

And it looks like the same issue here: https://stackoverflow.com/questions/43378891/multiple-instances-of-opengl-exe-take-longer-and-longer-to-initialize

Perhaps there is more information we could provide, or another place to report this?

@pvan2, Can try tweeting at them.

https://twitter.com/NVIDIAGeForce
https://twitter.com/nvidia
https://twitter.com/NVIDIAGameDev

I’ll drop them a line as well, hopefully they see these threads! :)

dillybob92,

Thank you for the report! We have filed an internal bug to track this issue.

Thank you @qgu. I didn’t want to respond when you first replied cause I figured you guys are working on it.

I was just curious since it’s been 7 months. I have been extremely hyped to look at all the patch notes. Unfortunately, it seems like every one since 391.35 (March 27d) has nothing in them that’s related to this AFAIK (I might have overlooked it however).

Just wondering if you have an update on this, or if it’s still being worked on? If it is, please ignore this post =]

dillybob92,

The root cause of the issue is related to shader disk cache lock, and we had the internal fix at the end of March. However, it will need to go through a long-term comprehensive QA testing process to make sure it can deliver the best user experience. Please try it with our up-coming 4XX driver. We appreciate your patience.

qgu, Thanks for the update! You guys do great work.

dillybob92, Thanks for following up on this. Very glad to hear your perspective and I wasn’t just going crazy.

Cheers!

Wow, that is awesome to hear actually! I am happy you looked into pvan2 and our bug reports! I’m sure others might have reported this as well in the past, but still!

Thank you for the update, it’s truly appreciated ;)

Yeah, thank you as well! Nasty bug haha.