(Case 1278110) Can't build specific game with 8GB RAM with versions after Unity 2020 a19 just saying

Hi there! I have downloaded Unity 2020s…all alphas and today, the new beta 2020.2; I have encountered a problem with building a game. In Unity 2020 alpha, alpha 1 to 19 I am able to build correctly/to completion. But after that, there are new changes post-alpha.19 that make the engine quite different. I mean I have a PC with 8 GB RAM so this is the limit to why it would not build correctly in later Unity version (after alpha 19).
The test I did was simple, I downloaded the asset : ‘‘Creator Kit: FPS 3D asset (the FPS game by Unity)’’,

and tried to build it in Each version I downloaded (I left the Project Settings as they are ‘default’ when you download Unity). I could not build it anymore post-19. What happens is that the build starts and everything is going well…it compiles everything and then it arrives at ‘shaders’, compiling ‘shader variants’…and then it hangs there; it stops at ‘shadows shader’ (it seems light shadow map shader is too heavy); what happens is that Windows freezes from lacking memory; I checked in the Task Manager and it Rises exponentially the instant it arrives at that shader compiling; then it reaches like +5GB RAM and then it reaches limit/freezes Windows because too much RAM requirement (have only 8 GB; maybe with 16 it would now work?). I tried to build another ‘empty scene’ and it worked correctly… Thus, I cannot compile *this Asset in Unity 2020.2 beta or any other previous ones, down to alpha 19. It means it is a ‘shader/variant compiling eating RAM problem’. IT’s strange because I can build that Exact same Creator Kit FPS asset (up to/in) Alpha 19 no problem - with only 8GB RAM (like OS/Unity are capable of ‘working it out’ with 8 GB RAM in alpha 19)…not after that version. In those previous versions, the compiling continues correctly and it compiled every shader variant correctly (it does not run ‘out of memory/Freeze Windows/Unity frozen’). I tried the game and it works perfectly. I will stick will alpha 19 (still I read now that Unity 2020.2 beta has peformance regression??), so I guess alpha 19, it is.
(unless maybe if I upgrade to 16GB RAM).

Just a 2 cents. Thanks for reading.

PS: If you have 8GB RAM, download Creator Kit: FPS and Unity 2020.2 beta, and try building it, it probably won’t work (will freeze/lack of memory when shader variant compilation happens).

PPS: I dabbed in the Project Settings and Jobs → tried with regular compiler, I tried with ‘Burst’ compiler or ‘graphics job’ or with ‘shader stripping all’…makes no difference build hangs at shader compiling due to excessive RAM rise/load. Could this mean a shader (variant) problem…though it builds perfectly in alpha 19; go figure. My take is that the ‘asset pipeline 1/2’ thing has problems or the compiler Itself has problem with compiling such shader (maybe the compiler is much different after alpha 19 and why it eats all RAM when shader variants compilation happens). I also tried to make a NewShaderVariants file (in Projects Settings > Graphics) in shaders slot…no difference, build/unity freezes due to lack of RAM. I can’t even terminate Unity (because OS is frozen, I waited 3 hours and it was still frozen (RAM lacking causes that to OS)).

PPPS: I’m just giving this as help for anyone (with 8GB RAM) to use Unity 2020.2 beta, you may encounter this building problem. I won’t go up of alpha 19 (since apparently Unity 2020.2 beta saw performance regression for some people; despite I looked forward to the improvements, regressions in fps performance; can’t/I prefer a stable version with enough fps/so far alpha 19 is the most stable one (in my case) and only ‘last/most recent’ one I can build a large game with, with 8GBram)). So think of this I just a little problem you could look at to help others (but I won’t do back and forth exchange on this problem/it’s done, I’m stying with alpha 19). If performance regression and that build problem are fixed (when with only 8GB RAM to build) I might upgrade then.

PPPPS: I still wanted to share this, I decided to share it/I thought…I’ll just stick with a19 and not report this bug like problem; but decided to because it might help someone who Really wants to obtain Unity 2020.2 beta (but faces same problem).

2 Likes

Hi @unitedone3D ,

Could you please submit a bug report for this issue with the instructions you provided above attached?

Dear LeonhardP, thank you, bug report was sent.

1 Like

Can you please post the bug-report Case number (number only, not the link) here for Unity staff to pick up?

1 Like

Dear QA Jesus, thank you, case 1278110.

3 Likes

@unitedone3D Hi! 2020.2 has Caching preprocessor turned on by default. It eats more RAM, but does things faster :slight_smile:
You can turn it off (Project settings → Editor settings → Caching preprocessor checkbox) while I try to limit the caching when there’s not much RAM in the system.

3 Likes

Dear Aleksandr, thank you!, this works/Fixed.

The build goes on correctly (compiling all shaders) and there is no hanging/freezing (memory spike); thus, the culprit, preprocessor/shader caching is too costly on low RAM memory computer. Anyone having this problem, it is preprocessor/shader caching the problem; turn it off as Aleksandr said and it will now work on 8GB RAM (or possibly less, at most points Unity compiling shaders (with this particular asset) does not go above 2GB RAM (in Task Manager, I had it in the background and was constantly checking it while Unity compiled); so, probably with 4GB RAM it will work too; but on 2GB RAM it may end up too tight/may freeze because reaching near-2GB RAM use; thus, 4GB RAM or 3GB RAM I think are bare minimum).

Which Unity version are you on right now? It left experimental state in 2020.2.0a13.

Re You are right, I apologize, it is not ‘Experimental’ anymore in 2020.2.0b2.3094 (I confused 2020.1.a19 projects settings with 2020.2.b2; removed the ‘experimental’ bit above).

PS: Just a suggestion for the Unity version, a (note*) should be besides this setting in Projects Settings - ‘‘Will not work on Low RAM machine’’. It is not experimental anymore, but it still does not work will low RAM (thus it not useable for low RAM), a small notice there would help for anyone stuck with the problem (so they would go in their projects settings and turn if off knowing it problably is the cause of RAM excess/freezing use during shader compiling - because ‘‘Will not work on Low RAM machine’’, clear message).

I’ll try to reduce its RAM usage first :slight_smile:

2 Likes

For 2020.1 as well ?

Yes, but for 2020.2 first.

OK, a short update: I managed to cut down the peak memory usage by about 2x (1.11GB → 533MB on my machine per UnityShaderCompiler process).
The fix also speeds up shader compilation a bit (the project in the bug report went down from 445 seconds total build time to 414 seconds).
I’ll post here when the fix is available for 2020.2 and 2020.1.

8 Likes

I’ am using 2020.2.2f1 and i can’t build the project, it gets stuck on shader variants.
I uncheck caching preprocessor but it still not working.

I am using Intel(R) Core™ i7-4710HQ CPU @ 2.50GHz with 12.0 GB of RAM

Hi! It took a bit longer than I initially thought it would, but the fix is there in:
2020.1.11f1+, 2020.2.0b9+, 2021.1.0a2+

@Cerberus_team this means it’s something different. What do you mean by “it gets stuck on shader variants”? Does it compile variants, but slowly? Or does it stop completely?

It gets stuck, i left it overnight and this morning it was still compiling shader variants.

And the task manager show unity as not responding.

It usually shows something like “Compiling shader variant X out of Y” - does X change over time?

No it does change over time.

6771700--782863--Screenshot.png

It got stuck on a Frameplay shader yesterday, but it could be any shader.

This looks like a different issue. Can you please submit a bug report?

It’s a 10gig project, and i’ am not sure about the steps to reproduce since it builds correctly on new projects.