[3.x] Disable NVIDIA's threaded OpenGL optimization on Windows #106551
+410
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backports #71472 and followup PRs to 3.x.
Helps address #33969
Draft
I'm more keen to trial #106556 first, as if it works okay it avoids a host of problems with accessing the driver directly. This PR is therefore left as draft in case the other doesn't work out.
Explanation
This is quite tricky for me as I don't have either windows or nvidia GPU, so I'm flying blind here to see if this passes CI and will likely need help from the original authors and / or someone with windows / nvidia to test the artifacts. I'm not quite sure yet in the function what / if any of it is specific to 4.x.
If someone else is interested in taking over the PR that has more appropriate machine, let me know. I'm not sure yet how practical it is going to be fixing the errors then relying on CI each time to compile. 😀
Discussion
I'm not altogether a fan of the approach of hacking in a change like this for (what seems like) a bug in the nvidia driver, but am exploring it, as it is annoying for users and end users.
I'll also have a go at a PR to turn on verbose debug output from the driver without outputting our side, which also has the effect of turning off threaded optimizations in the driver (and without the knockon bugs that this PR causes, e.g. #85111). The disadvantage there would be some performance implications of the debug strings, but that might end up being the best trade off. We may choose to only offer that option in 3.x.
Notes
false
here at the moment as I'm slightly concerned about the knock on bugs.