WebGPU blank / black screen on startup. Sometimes

Building simple project (SRP text on canvas scene) on multiple browsers shows a blank/black screen about half the time when starting up. No errors in the console, can’t predict when it might work or not.

Is there anything that I can do to pin down the cause or anything to rule out?

WebGL 2.0 is working reliably, but WebGPU in my case performs a bit better hence the experiment.

Hey @amateurd,
I’m not sure why you would be seeing a black screen at startup randomly. Can you give me any more info to work with? What Unity version, what OS, browser, GPU. What do you mean by “when starting up”? That the engine is running and the first frame(s) are black? If possible, you could DM me a project that repros the problem and I could see if I can find anything that might cause the issue. WebGPU, unlike WebGL, does have an asynchronous initialization process, but the Unity engine doesn’t start until after that webgpu initialization completes. I’m not sure what else would cause a black frame without a console error, but happy to help try to figure it out.

Hi thanks for responding.

I have looked at the console logs in each case and they are almost identical: they always do “Loading player data from data.unity3d” etc but about half the time it shows the game window and half the time it is a blank screen. When it’s blank the “UnloadTime” number (shown after “Input Manager initialize…” is higher (shows 2.100000ms vs 2.000000ms).

Unity version is 6000.2.6f1), Intel i7, 16GB, OS is Windows 11, browser is Edge, but similar behaviour on Chrome as well. Not seen it on Firefox. GPU is built-in Intel Iris graphics.

A bit more testing shows the game is running, just not outputting anything to the display. Interestingly, keyboard shortcuts in the game do work, and I have some game objects which alter the mouse cursor when hovered and these work even though I can’t see the objects underneath.

The screen never starts OK and then goes black: it either displays normally for the whole session or starts and stays black for the whole session. Sometimes it will work fine 5 times in a row, or fail multiple times. It never happens with WebGL 2, only WebGPU.

To avoid sending a giant project folder I’ll see if I can reproduce it with a limited extract and if I can I’ll send that over.

Thanks again

Still not managed to shrink the project down to share it but I will if I can.

What is very clear is it only has this problem on compressed builds (gz or br). Uncompressed it never happens.

Just adding this in case someone has a brainwave.