Search Unity

Question "Kernel" errors after updating to 2021.2

Discussion in 'Web' started by SimRuJ, Feb 24, 2022.

  1. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    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:
     

    Attached Files:

    Last edited: Feb 24, 2022
  2. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    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.
     
    Last edited: Feb 24, 2022
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    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.
     
  4. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    @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.
     
  5. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    According to the source code, the compute shader in question doesn't support the OpenGLES graphics API, which is what WebGL uses.
    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.
     
  6. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    @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.
     
  7. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    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.
     
  8. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    @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
     
    chris_schubert likes this.
  9. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    Any update on this, @Unity-people? I filed the bug report more than a month ago but no reply yet.
     
    DomKonecny likes this.
  10. LiamVisionary

    LiamVisionary

    Joined:
    Apr 2, 2020
    Posts:
    48
    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.
     
    Last edited: Apr 14, 2022
  11. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    273
    @SimRuJ would you mind sharing a link to the bug report so I can follow up on it?
     
  12. LiamVisionary

    LiamVisionary

    Joined:
    Apr 2, 2020
    Posts:
    48

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

    lam08

    Joined:
    Oct 24, 2019
    Posts:
    1
    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
     
  14. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    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.
     
  15. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    273
    @SimRuJ
    So the issue here is that Multi Scale Volumetric Obscurance uses a computer shader, which is not supported by WebGL (https://www.khronos.org/registry/webgl/specs/latest/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.
     
    Gulzatt and JemWritesCode like this.
  16. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    @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!
     
  17. faziii

    faziii

    Joined:
    Jun 11, 2019
    Posts:
    17
    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.
     
  18. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    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.
     
  19. faziii

    faziii

    Joined:
    Jun 11, 2019
    Posts:
    17
    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!
     
  20. SimRuJ

    SimRuJ

    Joined:
    Apr 7, 2016
    Posts:
    247
    @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?
     
  21. faziii

    faziii

    Joined:
    Jun 11, 2019
    Posts:
    17
    No i didn't test on beta yet
     
  22. SprtySpice

    SprtySpice

    Joined:
    Mar 24, 2014
    Posts:
    2
    Any updates on this? Ambient Occlusion & Auto Exposure still don't work with WebGL.
    I tried both the latest stable release (2021.3.8f1) and also the latest beta (2022.2.0b5).
     
  23. yitz_unity

    yitz_unity

    Joined:
    Jun 22, 2021
    Posts:
    12
    Ambient occlusion was working in webgl in 2020.3.12f1, updated to 2021.3.9f1 and it is no longer working in webgl. I don't understand what changed.
     
  24. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Ok so i encountered this error today. When upgrading from 2020 lts to 2021.3.11 lts.

    It will error spam the editor even not during run time.
    To remove it.

    Uncheck Ambient Occlusion (I actually removed it)
    Then disable and re-enable Post-process Layer.

    This should stop the error.

    I get this error even when on Android.
     
    basska, Miryum and MrEdL like this.
  25. Gulzatt

    Gulzatt

    Joined:
    Mar 19, 2022
    Posts:
    2
    Worked for me, thanks! I just removed ambient occlusion and was able to build my game in WEBGL
     
  26. setablaze777

    setablaze777

    Joined:
    Aug 21, 2018
    Posts:
    2
    I'm not sure if this will help anyone else, but here's what worked for me. I tried disabling Ambient Occlusion but that did not help.

    I narrowed the issue down to the post-processing layer on my main camera. If I disabled that component, the kernel errors stopped. I simply had to delete that component and then add it again. After I did that, the errors stopped for me.

    Hope that helps someone.

    BTW I'm using Unity 2021.3.8
     
  27. manurocker95

    manurocker95

    Joined:
    Jun 14, 2016
    Posts:
    210
    This is happening to me now on 2021.3.16LTS on Windows standalone when only using standard shaders (and post-pro). Any idea?
     
  28. Spellbook

    Spellbook

    Joined:
    May 21, 2015
    Posts:
    30
    Our users are reporting this now in 2022.1.24
     
  29. Miryum

    Miryum

    Joined:
    Jul 25, 2021
    Posts:
    11
    I got this error on Android, disabling and re-enabling Post-process Layer component solved it.
    And I changed Rendering to auto Graphics API in Player settings
     
    Last edited: Jan 4, 2023
    mcf_dev likes this.
  30. SprtySpice

    SprtySpice

    Joined:
    Mar 24, 2014
    Posts:
    2
    SANTIAGODML likes this.
  31. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    273
    SANTIAGODML likes this.
  32. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    There's an error in the post processing package that incorrectly handles checking the capabilities for compute shaders, so it thinks WebGL supports Compute Shaders, which it does not. What should happen is instead of getting the obscure kernel error, the MSVO pass should just be ignored. Only the other SSAO mode works for WebGL.

    We'll work with the post processing package to get that fixed.
     
    manurocker95 and SANTIAGODML like this.
  33. SANTIAGODML

    SANTIAGODML

    Joined:
    Jun 29, 2021
    Posts:
    6
    Hello everybody!

    I solved it Switching to the WebGL platform and compiling from a scene that doens't have post processing. In my case was the main menu.

    I home this helps
     
  34. daniel_lochner

    daniel_lochner

    Joined:
    Jun 9, 2016
    Posts:
    175
    Hi there. Any updates on this fix?
     
  35. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    I filed the ticket with the post processing v2, but hadn't followed up on it. I'll do so now. The "fix" will be that MSVO mode for SSAO will be a no-op for WebGL. You can not use MSVO to fix the issue from the project.
     
  36. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    Wasn't sure if I should start a new thread... decided to tack on here, as the issue I'm having seems related but occurs under a different, specific circumstance, and is always repeatable. I'm using 2022.3.13f1.

    If I select an object in my Scene, there's no issue (first screenshot).

    If I search/filter though, and then select an object matching the filter, Unity will spam the "Color and depth buffers have mismatched kSurfaceUseResolvedBuffer flag" error to the log (second screenshot).



     
  37. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    437
    @SteveJ This would not be the same issue, it would be an editor issue. The web platform wouldn't be involved with interacting in the editor. It does seem very curious and really annoying. I would post it to the Editor forum, or maybe even the MacOS forum. That error comes from the Metal graphics API on MacOS, when you have a render target where the color and depth textures don't have consistent MSAA state. Given that you're on MacOS, the Editor would be using Metal. I don't know why filtering would affect that.
     
  38. SteveJ

    SteveJ

    Joined:
    Mar 26, 2010
    Posts:
    3,085
    No worries - it's the same error mention earlier in this post which is how my search brought me here, but I didn't notice this was specifically under Web platform forum at the time.
     
  39. URoland

    URoland

    Unity Technologies

    Joined:
    Nov 4, 2020
    Posts:
    9