Search Unity

Bug Invalid pass number (0) for Graphics.Blit (Material "(Unknown material)" with 0 passes)

Discussion in 'Linux' started by jonkuze, Sep 30, 2023.

  1. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Unity 2021.3.30f1

    When building and running a Linux Dedicated Server, I see an infinite loop of the following Error thrown in the Console: Invalid pass number (0) for Graphics.Blit (Material "(Unknown material)" with 0 passes). I wish I could ignore this error but it's effecting performance; server is utilizing up to 80% of vCPU when running in a Docker container.

    I hope someone can assist. I'm trying to launch a closed beta test of my upcoming game, but I'm totally blocked now due to this issue.
     

    Attached Files:

  2. ChiwTheNeko

    ChiwTheNeko

    Joined:
    Mar 24, 2022
    Posts:
    135
    Does your code or the code of one of the assets you use call any blit function inside a callback like Update() or similar?

    Dedicated server builds have no graphic. All graphic assets like material and shaders are striped from the build. If you code calls Graphics.Blit() (or equivalent) then it would explain the 'Unknown Material' error you get.
     
    jonkuze likes this.
  3. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    You are spot on! A buddy of mine was able to find the source, it was related to a Unity Asset i'm using and was calling something in the Update() on the server side. Oddly enough I was not seeing the source of where this error was coming from, but on my buddies end he recieved different console logs so we were able to find the culprit! Thanks soo much!
     
  4. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    259
    Hey! If I'm correct, this message Invalid pass number (0) for Graphics.Blit (Material "(Unknown material)" with 0 passes) should be fixed in 2021.3.32f1.
     
    jonkuze likes this.
  5. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Thanks so much for the update. I'll be sure to upgrade to latest version. Thank you.
     
  6. rfuhrer

    rfuhrer

    Joined:
    Oct 2, 2015
    Posts:
    52
    I have just upgraded my project from 2019 to 2021.3.34f1 and now I get exactly the same error message:
    Code (CSharp):
    1. Graphics.Blit material "Hidden/MotionBlur" uses dest texture "" as input in pass (0), it's an undefined behaviour. Consider using double buffering.
    2. UnityEngine.Graphics:Blit (UnityEngine.Texture,UnityEngine.RenderTexture,UnityEngine.Material)
    3. UnityStandardAssets.ImageEffects.MotionBlur:OnRenderImage (UnityEngine.RenderTexture,UnityEngine.RenderTexture) (at Assets/Standard Assets/Effects/ImageEffects/Scripts/MotionBlur.cs:72)
    4. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    So this should not appear since I am on a newer Version then 2021.3.32f1. What can I do?
     
    Last edited: Jan 22, 2024
  7. cristianm_unity

    cristianm_unity

    Unity Technologies

    Joined:
    Oct 16, 2018
    Posts:
    259
    Hey @rfuhrer, this looks like a slightly different issue (notice that in this case it's a motion blur material instead of the "unknown" one). So would it be possible for you to submit a bug report and share the case number? Or let me know if there are some reproduction steps that could help us investigating it.

    Thanks!
     
    rfuhrer likes this.