Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Shader compiler crash

Discussion in 'Editor & General Support' started by plufz, Jul 28, 2021.

  1. plufz

    plufz

    Joined:
    May 26, 2020
    Posts:
    11
    Hi!

    I have a project which crashes everytime I open it, from what I can tell it is the shadercompiler that crashes (it seems to crash when it is about to show the content of a scene, the scene view turns cyan and then crash). I have not filed a bug report since I have not been able to create a test project with the same error. I have tried deleting the Library directory inside the project. What can I do? If there is a better/faster way than creating a new project and adding resources one by one that would be great.

    macos 11.5.1
    Unity 2021.1.15.1f.

    Editor.log is saying this:

    Code (CSharp):
    1. Shader compiler process initialization failed: Protocol error - failed to read magic number
    2. Launching external process: /Applications/Unity/Hub/Editor/2021.1.15f1/Unity.app/Contents/Tools/UnityShaderCompiler
    3. Launched and connected shader compiler UnityShaderCompiler after 0.02 seconds
    4. No explicit failure code handling for error of type 22
    5.  
    6. Shader compiler process initialization failed: Protocol error - failed to read magic number
    7. Launching external process: /Applications/Unity/Hub/Editor/2021.1.15f1/Unity.app/Contents/Tools/UnityShaderCompiler
    8. Launched and connected shader compiler UnityShaderCompiler after 0.01 seconds
    9. No explicit failure code handling for error of type 22
    10.  
    11. Shader compiler process initialization failed: Protocol error - failed to read magic number
    12. Shader compiler: failed to launch and initialize compiler executable, even after 10 retries
    13.  
    14. Shader compiler initialization error: Protocol error - failed to read magic number
    15.  
    16. Cancelling DisplayDialog because it was run from a thread that is not the main thread: Fatal Error! Shader compiler initialization error: Protocol error - failed to read magic number
    17.  
    18.  
    19. AcceleratorClientConnectionCallback - disconnected - :0
    20. QObject: Cannot create children for a parent that is in a different thread.
    21. (Parent is QObject(0x7fbe507b3090), parent's thread is QThread(0x7fbe50605890), current thread is Thread(0x7fbe5534ea60)
    22.  
     
    Hy_S likes this.
  2. Barliesque

    Barliesque

    Joined:
    Jan 12, 2014
    Posts:
    128
    @plufz Did you ever find a resolution to this problem?

    I've run into a similar issue. When exiting play mode, Unity crashes every time. This starting happening in Unity 2020.3.10. I tried installing 2020.3.19 in case there was something wrong with Unity itself, but of course it continues.

    I just discovered that at the moment Unity closes down, the file
    obj/shadercompiler-UnityShaderCompiler.exe0.log
    is updated with this:

    This happens even when playing an empty scene and pressing stop.
     
    Last edited: Oct 29, 2021
  3. Barliesque

    Barliesque

    Joined:
    Jan 12, 2014
    Posts:
    128
    My problem was resolved by completely removing the Oculus Integration Plugin and reimporting it. Apparently an earlier version of it was responsible for the issue, and (I guess) only by manually removing and replacing does the critical file get replaced.

    Thanks to Lukas Petrauskas of Unity's Customer QA Team for this solution.
     
    Arxiepiskopos likes this.
  4. I_Live_On

    I_Live_On

    Joined:
    Dec 16, 2021
    Posts:
    2
    I started to get this error during a plane flight, I was not connected to the planes wifi, connecting to it did not fix the issue. When I got home to my mesh network the error went away.
     
  5. Jave_Lin

    Jave_Lin

    Joined:
    Jan 27, 2014
    Posts:
    4
    I got a same crash!
    Terrible engine!

    crash on env info :
    os : windows 10 pro
    unity version : 2020.2.5f1

    resolved on env info :
    os : windows 10 pro
    unity version : 2020.3.37f1
     
    Last edited: Dec 1, 2022