Okay, first of: I know that there are multiple threads discussing the shader variants compiling just hanging for a long time, but this is not the case here.
I’m using Unity 2018.4.20f1 (building things for VRChat, so this specific version is required) on Linux. Everything was working fine before until yesterday.
Now when I’m trying to build & publish an avatar or a world from any previously working project, Unity starts to compile shader variants and will start to freeze at random shaders (or at least I couldn’t identify any pattern yet).
When observing the UnityShaderCompiler child processes, they are all running at 100% CPU while the compile is running. At the moment the compiler freezes, all those child processes go down to 0% CPU usage. Occasionally, the Unity parent process itself would go up to maybe 5% and then go down to 0% again. I assume its trying to reach the stuck UnityShaderCompiler children. Trying to kill them will just result in them being , and I’ll have to kill the parent Unity process to get rid of them.
There were no changes made to those projects, so I’m not sure what caused the new behavior. I tried playing around with the build settings, and for one build the shader variant compiling actually went through (and that very quickly), but I could not reproduce that success again.
Looking at the log files of the UnityShaderCompilers, I only see this for 11 child processes:
Base path: /home/user/Unity/Hub/Editor/2018.4.20f1/Editor/Data
Cmd: initializeCompiler
Only the first process contains actual log entries, with the last one before it gets stuck being:
Cmd: initializeCompiler
Cmd: compileSnippet
api=15 type=0 insize=1878 outsize=3001 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR ok=1
Cmd: compileSnippet
api=15 type=1 insize=1878 outsize=0 kw= pd=UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR ok=1
By the way, I’m only using the “Standard” Unity shader and nothing else.