Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Cannot build - UnityShaderCompiler using 100% cpu

Discussion in '5.3 Beta' started by radimoto, Oct 17, 2015.

  1. radimoto

    radimoto

    Joined:
    Aug 23, 2012
    Posts:
    257
    I'm testing Unity 5.3.0b2 and have a project that plays OK in the editor on Mac.

    When I go to build however it hangs on "Building assets - resources.assets"
    If I go to Activity Monitor I can see 8x UnityShaderCompiler running at 99%

    I left Unity running overnight but it still didn't complete the build, it is still stuck as above.

    Looking at the editor log the only shader warnings coming up when I try to build are:

    WARNING: Shader Unsupported: 'Hidden/TerrainEngine/Details/BillboardWavingDoublePass' - Pass '' has no vertex shader

    WARNING: Shader Unsupported: 'Hidden/TerrainEngine/BillboardTree' - Pass '' has no vertex shader

    EDIT: Can I please request that UnityShaderCompiler log what it's doing to a file, so we can at least see what shader it has just started on? This would identify which shader it is hanging on straight away....

    EDIT2: using 'lsof' I can see UnityShaderCompiler does actually log into the Library folder:

    /Users/user/Unity-RAD_Rally/Library/shadercompiler-UnityShaderCompiler1.log

    Looking through the log files though it doesn't seem to log the name of the shader it is working on!?!? All I've got to go on is log entries such as:

    Cmd: compileSnippet
    api=14 type=1 insize=808 outsize=3803 kw=SPOT SHADOWS_DEPTH SHADOWS_NATIVE _ALPHABLEND_ON pd=SHADER_API_DESKTOP ok=1
    Cmd: compileSnippet
    api=14 type=1 insize=600 outsize=694 kw=SHADOWS_CUBE pd=SHADER_API_DESKTOP ok=1

    Cmd: compileSnippet

    I will see if I can log 'lsof' somehow to determine what shader files UnityShaderCompiler is actually working on.... Unity devs - can you please log the full path and name of the shader it is compiling into the log file

    EDIT3: I managed to isolate this by going through my Assets one by one. "Fog Volume" was the culprit. Once I deleted this Asset the build completed quickly like normal. I created a new project for Fog Volume and was able to build OK. Reimporting Fog Volume back into my original project now builds OK without any issues. So the final resolution was to delete and import Fog Volume. This whole process could be made a lot easier by just logging the name of the shader into the compiler log file, or into the editor log file. For example:

    UnityShaderCompiler - about to compile xxxxxx.shader

    At least if it all hangs up at this point we can identify the problem shader straight away....
     
    Last edited: Oct 17, 2015
    pixelR and kelloh like this.