bryanedds / Nu

Repository hosting the open-source Nu Game Engine and related projects.
MIT License
1.05k stars 151 forks source link

Exception on game startup on nvidia with 555 driver #823

Open reinux opened 3 weeks ago

reinux commented 3 weeks ago

Exception:

System.Exception: Could not create GlRenderer3d due to: Could not create complete shadow texture framebuffer (status: 0; error: NoError).
   at Nu.GlRenderer3d.make(IntPtr glContext, Window window) in /home/rei/source/Nu/Nu/Nu/Render/Renderer3d.fs:line 3008
   at Nu.RendererThread.Run(ImFontAtlasPtr fonts, FSharpOption`1 windowOpt) in /home/rei/source/Nu/Nu/Nu/Render/RendererProcess.fs:line 330
   at <StartupCode$Nu>.$RendererProcess.thread@419-1.Invoke() in /home/rei/source/Nu/Nu/Nu/Render/RendererProcess.fs:line 419
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

I have it printing the output of CheckFramebufferStatus and Gl.GetError in the exception. My current suspicion, based on the Khronos documentation, is that the framebuffer is nonzero -- which is a thing that can happen on Linux because malloc doesn't necessarily zero out memory.

bryanedds commented 3 weeks ago

Please also add detail on what you tried as well as on what driver versions it did work on. I'm not sure the current level of detail is enough to be actionable.

reinux commented 3 weeks ago

Haven't done much yet beyond just inspecting with breakpoints and reading some docs.

I believe it worked fine on 545 and 550. 555 is the huge stability update though, and the general consensus is that it's a very good one, so unless there's been some kind of regression, I have a feeling it might not be a bug in the driver so much as that it's exposed some obscure problem.

The value of framebuffer in TryCreateShadowBuffers appears to be correct (0), but if I let it continue without checking that the buffer is complete, framebuffer continues to be 0 in further iterations, which suggests that the buffer is either being discarded or that it isn't actually being produced.

bryanedds commented 3 weeks ago

If there's an NVidia support forum, you should also check there. There may be known bugs or regressions about r555 or links about those that can be found there. If you can get forum support for this, it might find discovering root cause more expedient.

The value of framebuffer in TryCreateShadowBuffers appears to be correct (0)

Why would that be correct? 0 is the default framebuffer, and if any call to Gl.GenFramebuffer returns 0, then it indicates an error.

bryanedds commented 3 weeks ago

Here's one potentially relevant forum thread -

https://forums.developer.nvidia.com/t/555-release-feedback-discussion/293652/5

reinux commented 3 weeks ago

Ah, I assumed the first ID would be 0. It starts at 1 on my AMD machine, so yeah, something's up.

I'll take a look through the thread.

bryanedds commented 3 weeks ago

I just finished having a look through the thread - there's nothing really specific enough in there to be relevant to this other than the general case that this is a beta driver and there are plenty of regressions and a lot of fix-faileds. But at least it's adjacent to a board you might be able to put up a specific question about potential r555 regressions.

reinux commented 2 days ago

Issue persists with 555.58, which came out last week. Not a problem for me personally at the moment, as I can work on my laptop.