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
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Build time taking almost a day - URP

Discussion in '2021.2 Beta' started by RenOli, Jun 29, 2021.

  1. djarcas

    djarcas

    Joined:
    Nov 15, 2012
    Posts:
    245
    The only thing I could really improve there was to disable hard shadows, which I did. This shader doesn't use shadows (I believe?) and therefore shouldn't be affected by it.

    But - this was a 100% warm build - what was the 4.5 (est) hours spent doing? 0 shaders should have been compiled, and Unity definitely shouldn't have taken half a working day to go "Yup, no work to be done!" - the only change between those 2 builds was the changing of a single piece of whitespace in a random script file.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    And none were. It was figuring out which variants it needs, then reading them from the local cache on disk. If you can't change your settings to use less different options, you'll have to live with this, at least for now.
     
  3. Kazoos

    Kazoos

    Joined:
    Nov 28, 2012
    Posts:
    19
    I don't fancy your cloud build bill.
     
    Immu likes this.
  4. alynnferguson

    alynnferguson

    Joined:
    May 6, 2021
    Posts:
    1
    Any updates on this? We're using 2021.3.15, and we're still seeing 14h cold builds. It's making it damn near impossible to troubleshoot errors that only show up in build.
     
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    @alynnferguson please read this thread carefully, there's several messages with links describing what you could do to reduce the cold build times.
     
    Immu likes this.
  6. ionutbaza26

    ionutbaza26

    Joined:
    Jul 21, 2022
    Posts:
    3
    What a terrible system . Using just the default shaders, absolutely ZERO custom shaders and the build time is still INCREDIBLY long (like 15x times) compared to built in.


    No one in their right minds should use anything else but the built in. Its stable, fast , bug free absolutely superior to this slug thing called urp.
    Just get back to supporting built in and burry this thing 5 feet deep in the ground.
     
    Last edited: Mar 16, 2023
    spider853 likes this.
  7. SharpAccent

    SharpAccent

    Joined:
    Jul 19, 2018
    Posts:
    39
    So, from October till now, nothing yet?
     
  8. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    #276
     
  9. SharpAccent

    SharpAccent

    Joined:
    Jul 19, 2018
    Posts:
    39
    Fair enough, why I'm having 33 hours of cold builds then? :D:oops:
    Optimize Mesh Data is off & Prebake Collision meshes
     
  10. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    This depends on your settings and your content :)
    Check the links in this post on what to do to improve the build times.
     
  11. socialtrens

    socialtrens

    Joined:
    Oct 23, 2017
    Posts:
    65
    Hi, Unity please stop your defensive attitude. I had no trouble building with SRP. In SRP it only took 30-40 minutes. But when we change to URP. It takes hours. We didn't complete the build because it took too long. We don't have time to wait. We changed it again to SRP.

    Please stop this defensive attitude. Acknowledge URP is broken and fix bugs. Stop blaming user error. I've been using Unity for 6 years. Do you think I'm a noob who can't tell the difference between a user error and a bug?
     
  12. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    281
    With the upgrade to Unity 2022 LTS (URP) I got a 3 hour cold build. I think switching unity versions even with small increments always result in a full cold build, not sure. The warm builds after this were only 1 minute. Everyone's project is different so this might not be the same experience for everyone, for me at least it has improved during the lifetime of this thread.

    It used to be unworkable, but now I can plan around the cold builds. And the warm builds are good.
     
  13. yagodar

    yagodar

    Joined:
    Oct 10, 2016
    Posts:
    17
    Hello, Arnold_2013 :) Could you please tell, what was the cold build time before upgrade to 2022 LTS.

    On my project with 2021 LTS and URP, cold build time is about 16 hours. Now I'm thinking how rapidly should I upgrade to 2022 LTS.
     
  14. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    281
    With this update I came from 2022.2.1f1, so I can't really say anything about the potential benefit from 2021 LTS to 2022 LTS. I would imagine most of the fixes will have been backported to 2021 LTS. So upgrading would not help.

    The warm builds on 2022.2.1f1 were also not too bad (5-10 minutes), but older versions would give me warm builds of ~1 hour which was my main problem back then (sorry I can't find a version number or date for when this was). So it seems to me progress has been made on the long build times.
     
    yagodar likes this.
  15. ilia_infable

    ilia_infable

    Joined:
    Sep 8, 2023
    Posts:
    1
    Any news? It is insane. 22.3.10f1
     
  16. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,896
    Do you have an idea of what's the reason for that long build time?
    If it's related to shader compilation, it's probably due to shader variants. Some assets can add lot of shader variants if not properly configured. You can remove unneeded shaders or check the documentation to remove shader features and improve build time.

    Btw, our Shader Control tool is included in the current $30 for 30 Unity bundle. This tool will list all shaders in your project sorted by keywords/variants count and even let you disable shader keywords either in the shader source (for non-internal Unity shaders, ie. asset shaders) or disable them at build time.
     
    ilia_infable, iceb_ and lclemens like this.
  17. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    760
    I just bought the bundle and I'm excited to give Shader Control tool a try.
     
    Kronnect likes this.
  18. RaventurnPatrick

    RaventurnPatrick

    Joined:
    Aug 9, 2011
    Posts:
    248
    I can confirm on the latest Unity 2022.3.11f1 (LTS) the cold build times are quite fast (around 10 minutes with lot's of different urp shaders such as simple lit and lit) and around 1-2min hot build time (only counting the addressable build that includes the shaders)

    For many shaders such as Urp/Simple Lit its preparing up to 150m variants and then compiling around 800vp (whatever a "vp" is)

    I guess the preparing could be more effiencient as it is only using 3-4 cores (out of 16)
     
    lclemens likes this.
  19. Zardify

    Zardify

    Joined:
    Jul 15, 2015
    Posts:
    20
    I don't know about you guys, but any time a Unity staff said there's a fix for this, it... remained the exact same :D I have 1 scene, mostly default settings, only the standard URP material used, and the build has been running for 45 minutes with no end in sight XDDDDD .....

    EDIT: I actually left it running for about 4 hours, no progress, cancelled it.
     
    Last edited: Dec 28, 2023
    funkyCoty likes this.
  20. Threeyes

    Threeyes

    Joined:
    Jun 19, 2014
    Posts:
    80
    Unity2022.3.10f1, with URP Forward+ rendering, I get 10000+ shader varients during build time and it took days to finish the job:(. And I found that each Lightmap Modes shader will add up to 3000+ shader varients.
    1703842849192.png

    So I wonder, If we use the same project settings (URP, default Graphic settings), can Unity provide the most common genrerated shader variant files for 90% of the reqular Developers so that we don't have to recomplile them over and over again?

    Note: The generate shader varients are located in 'Library/ShaderCache' folder, Sometimes Unity may regenerate these files for no reason(even if you haven't modified any other settings).try backup or replace it from other project if you are facing this problem.
     
    Last edited: Jan 3, 2024
    kmowers and Zardify like this.