Search Unity

How to increase resource consumption during command line / headless builds?

Discussion in 'Testing & Automation' started by Mike_canVerse, May 18, 2022.

  1. Mike_canVerse

    Mike_canVerse

    Joined:
    Mar 9, 2021
    Posts:
    1
    Hi there,
    Id like to increase resource consumption of unity.exe / unityshadercompiler.exe on our build server and was wondering if anyone has any tips on how to achieve this for headless / batchmode builds?
    Can boot.config be customised as a kind of resource template just for -batchmode?

    When the shader compiler processes launch it is maxing out cpu usage, but system memory consumed seems capped to just under 16GB. Our build server has 64GB of memory so Id like the shader compiler processes to consume more memory, if possible.
     
  2. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    599
    It sounds like your build server has 4 sticks of 16GB ram? If that's true, it is capping at 16GB because Unity runs on a single thread. Mostly. Obviously there is DOTS and users can explicitly run some processes on threads. But core Unity functionality outside of DOTS is all running on a single thread. So it would naturally cap out there. Can you add extremely intensive process that are spun off on separate threads?

    You could check "Application.isBatchMode", and then launch into some async logic that will calculate something like GIMPS which will search for prime numbers and eat up a bunch of memory. That is the only way I can think to force what you are suggesting.