"Kernel" errors after updating to 2021.2

Hello everyone,

two days ago I updated my WebGL project from Unity 2021.1.24f1 to 2021.2.12f1 and afterwards the same two errors kept getting spammed in console:

I found a thread about the same error and this post suggests deleting the “Library” folder to get rid of the errors. It worked, the errors were gone after it re-imported everything and I activated my scene again. Today I noticed that deleting the folder also reset the project to the “Windows, Mac, Linux” platform, so I switched back to WebGL and the errors are back again!

When I start the app, the camera movements are really choppy, the shaders I use don’t work properly (at least the bloom is gone) and the same errors keep getting spammed in console. I already updated the “Post Processing” package to 3.2.1 (latest version, the errors quoted above are from that version) but that didn’t help.

How do I fix this?

Edit: If I disable the “Post-process Layer” and the “Post-process Volume” on my main camera, the errors stop appearing. If I then re-enable one of these components, the errors don’t appear again but once I enable both, they’re back. To get rid of them again, I have to disable the layer component, so looks like that’s the culprit.
I deleted the layer component and created a new one but as soon as I set its layer to “PostProcessing”, the errors appeared again. I also reinstalled the “Post Processing” package but that didn’t help either - unfortunately there’s no “see other versions” button for this, so I can’t install the Unity 2021.1 version again. Is this a URP error (instead of WebGL)?
Screenshot of the components:

I created a completely new 3D/2021.2.12f1 project and started applying my main project’s settings but I didn’t have to change much until the errors started being logged again:

  • Switch to the WebGL platform.
  • Install the “Post Processing” package (version 3.2.1).
  • Create a new “PostProcessing” layer (I used layer 6) and set the camera to it.
  • Add a “Post-process Layer” component to the camera and set its layer to the new “PostProcessing” one
  • Add a “Post-process Volume” component to the camera, tick “Is Global” and create a new profile.
  • Add the “Ambient Occlusion” effect to the volume, enable its “mode” setting (Multi Scale Volumetric Obscurance) and also the “Intensity”. Set the intensity to e.g. 0.2.
  • Now the errors should start popping up.

That’s it, there aren’t any objects in the scene, apart from the default camera and the default directional light and I also didn’t change any other settings.

Edit: I filed a bug report. I guess I’ll have to leave ambient occlusion disabled for now but maybe someone has an idea what else I could try to get rid of the error while the effect is enabled in the meantime.

Are you using WebGL 2.0? The AO effect (specially the MSVO option) relies on Computer Shaders. I’m not sure Unity supports compute for WebGL. Hence switching to Standalone Windows/Mac resolves the error.

But then again, if it worked in 2021.1, it should work in 2021.2 just the same.

@StaggartCreations
You have to add your own shaders that you want to use in the exported app in the “Graphics” settings list but once I did that, they’ve all been working fine in the WebGL builds.
I checked “Player - Other Settings”: “Auto Graphics API” is ticked, so I guess both are active/supported at the moment. I also tried unticking it, which then gave me a “Graphics API” list with only WebGL 2 but as soon as I enabled the AO effect, the errors started popping up again.
I didn’t change any of the player settings after updating to the new version and it was working fine with the old one - no idea what changed and the changelogs of the 2021.2 versions also don’t mention anything regarding post processing/that effect.

According to the source code, the compute shader in question doesn’t support the OpenGLES graphics API, which is what WebGL uses.
7925620--1011865--upload_2022-2-25_13-28-8.png

I believe adding the shader to the “Always include” list prevents unity from actually stripping it out whilst using OpenGLES in this case. That would be unwanted behavior, if a particular shader uses “exclude_renderers” for a good reason.

It could be that starting from 2021.2 this was fixed, hence the workaround stopped working. If so, the only option is to use the “Scalable Ambient Obscurance” option instead of “Multi Scale Volumetric Obscurance”, since the latter uses this compute shader.

@StaggartCreations
The only shaders I added to the list myself are slightly edited versions of Unity’s “Unlit” shaders (basically to turn culling on/off) and they always worked properly in the WebGL builds (iirc). Those shaders don’t even exist in the new project I managed to replicate the problem in. You can test it yourself, I posted the steps above (takes about 5 minutes to set up).
Tbh, I don’t know what either mode does, I just left it on default, which is “Multi Scale Volumetric Obscurance”. I just set it to “Scalable Ambient Obscurance” and the errors still show up.

Ah, I misunderstood then. It’s probably a good idea to file a bug report, especially since it seems to an issue that arose in a different/newer Unity version.

@StaggartCreations
No worries. I already filed a bug report after I noticed that it also happens in the new project, just waiting for a reply at the moment.
If you test it too and get/don’t get the same errors, please post again and I’ll add the thread url to the report

1 Like

Any update on this, @ -people? I filed the bug report more than a month ago but no reply yet.

1 Like

Was this ever resolved? This error was also flooding my console in the 2021.3 LTS when I had my editor build set to WebGL and had the post-processing layer component on my main camera. After deleting Library and reimporting, the kernel error disappeared, but I’m now getting: Color and depth buffers have mismatched kSurfaceUseResolvedBuffer flag

This error also goes away when the post-processing layer is disabled.

EDIT: oddly, it also only spams the error when moving my cursor over the scene view.
EDIT2: Narrowed the issue to be with the third-party asset, Easy Performant Outline, PostProcessing, and possibly only on Mac OS using the built-in pipeline.

@SimRuJ would you mind sharing a link to the bug report so I can follow up on it?

Never mind, the Kernel error came back as soon as I switched my platform back to WebGL :'/

I also got the same error on version 2021.2.10.f1
I fix:
Delete current file Post Process Profile
Reimport project
Create new Post Process Profile

Sorry about the delay. I sent you a message with the link.

I haven’t downloaded the latest version yet, so not sure but my bug report is still open and I haven’t received a reply yet.
I’m on Windows 10 and tested it with a completely new and vanilla project that doesn’t contain any extra packages, apart from PostProcessing (which is by Unity anyway) - see post #4 for the exact steps to replicate the problem.

@SimRuJ
So the issue here is that Multi Scale Volumetric Obscurance uses a computer shader, which is not supported by WebGL (WebGL 2.0 Compute)

The actual problem is that the post-processing package isn’t checking if WebGL supports computer shader before asking for the shader. I’m working on getting this bug triaged to the team that updates that package. But for now, I believe if you remove the ambient occulsion effect, this error will go away.

2 Likes

@unityruba
It used to work just fine with Unity 2021.1.24f1, did the shader change in 2.12f1 (or some time between these versions)?
Yes, disabling the Ambient Occlusion effect also stops spamming the errors (have to disable and re-enable something else first though).
Thanks for looking into it!

No, it is not related to AO only because even after deleting this property i am getting the same error. You have to untick the post processing layer and volume. Is there any progress? Unity said it has resolve in beta 2022 here.

IIRC you also have to disable the layer to stop the console spam but you can enable it again afterwards and the errors won’t be back unless you also enable AO again. I think the effect simply gets “stuck” somehow/it doesn’t refresh properly.
I can’t use beta versions for my project and I’m going to wait until a couple of minor versions are out before I update, so I haven’t tested it yet. If you want to try it, you can find the step for reproducing the problem in post #2.

I have exported different project with Ambient occlusion it work well only Auto exposure has problem due to lack of support of compute shader on webgl. I don’t know why it is acting weird!

@faziii
For me the errors even show up in the editor and I never bothered exporting with AO active because of that. It has to be a WebGL project though, last time I checked there were no errors with “Windows, Mac & Linux”.
I never tested Auto Exposure.
The test I posted in #2 only uses default settings, apart from Post Processing, and there aren’t any GOs, so no idea why there would be a shader that’s unsupported in WebGL.
Did you test the beta?