Search Unity

RenderTexture.Create failed during -nographics

Discussion in 'General Graphics' started by malkere, Dec 8, 2018.

  1. malkere

    malkere

    Joined:
    Dec 6, 2013
    Posts:
    1,212
    I'm trying to setup a headless server and testing a windows standalone build with -batchmode -nographics commands. I get RenderTexture.Create failed every frame though... but... who cares about graphics? I assume that means the graphics drivers being used are null and so nothing is supported... Do I have to encase code to watch for isBatchMode, or?

    I get a bunch of these in the log during startup:
    ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/PostProcessing/Debug/Waveform' - Setting to default shader.

    Then this every frame:
    RenderTexture.Create failed: format unsupported - RGBA4 UNorm (9).
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    We also get such errors while doing builds on a server in headless mode, using Unity 2018.2.20f1.

    Code (CSharp):
    1. RenderTexture.Create failed: cubemap not supported.
    2. UnityEditor.BuildPipeline:BuildAssetBundlesInternal(String, BuildAssetBundleOptions, BuildTargetGroup, BuildTarget)
    3. UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTargetGroup, BuildTarget) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline.bindings.cs:449)
    4. UnityEditor.BuildPipeline:BuildAssetBundles(String, BuildAssetBundleOptions, BuildTarget) (at C:\buildslave\unity\build\Editor\Mono\BuildPipeline.bindings.cs:438)
    Any idea how to fix those errors? It would also be helpful if the asset name is contained in the error message.

    Edit: See this feedback item.
     
    Last edited: May 22, 2019
  3. NiallSoe

    NiallSoe

    Joined:
    Jan 30, 2018
    Posts:
    17
    We see this in headless mode as well.

    My colleague first saw this in Unity 2017.4.17f1 when building for iOS on an OSX Mojave build machine.

    We have also seen this building for Android on an OSX High Sierra build machine after upgrading to Unity 2017.4.26 (different project to the above issue).

    For us it was cubemaps being built into asset bundles causing the issue and turning off compression for each cubemap worked around it for us (does Unity internally use RenderTextures when compressing cubemaps?).

    Obviously this is not ideal, has anyone got a test project they could easily upload for a bug report?
     
  4. Ramy-TL

    Ramy-TL

    Joined:
    Dec 12, 2016
    Posts:
    1
    We added BuildOptions.EnableHeadlessMode to our build script BuildOptions and it worked like a charm (we are using -nographics in our command line)
     
    richardkettlewell likes this.
  5. azmi_unity

    azmi_unity

    Joined:
    Dec 13, 2020
    Posts:
    62
    For me, using batchmode without -nographics works.