Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved FMOD fails only building on batch mode in Docker Windows container

Discussion in 'Editor & General Support' started by MoctezumaDev, Aug 7, 2023.

  1. MoctezumaDev

    MoctezumaDev

    Joined:
    Aug 14, 2013
    Posts:
    53
    We are facing an issue when building on our pipeline using a Gitlab-Runner with a Docker Windows executor.

    I have managed to reproduce the issue in a small sample project that only includes the fmod library.

    The issue happens when I try to run a job with a Gitlab Runner on a Docker Windows container based on a Game-CI image.

    The build fails with the following log:

    Code (CSharp):
    1. Application.AssetDatabase Initial Refresh End
    2. Scanning for USB devices : 0.991ms
    3. Initializing Unity extensions:
    4. .[MODES] ModeService[none].Initialize
    5. [MODES] ModeService[none].LoadModes
    6. [MODES] Loading mode Default (0) for mode-current-id-gitlabrunnertest
    7. ProgressiveSceneManager::Cancel()
    8. Unloading 114 Unused Serialized files (Serialized files now loaded: 0)
    9. Unloading 204 unused Assets / (494.8 KB). Loaded Objects now: 3484.
    10. Memory consumption went from 79.8 MB to 79.4 MB.
    11. Total: 6.145500 ms (FindLiveObjects: 0.559300 ms CreateObjectMapping: 0.414300 ms MarkObjects: 4.698000 ms  DeleteObjects: 0.472200 ms)
    12.  
    13. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL
    14. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL.dll
    15. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL.dll
    16. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL
    17. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL
    18. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL.dll
    19. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL.dll
    20. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL
    21. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL
    22. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL.dll
    23. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL.dll
    24. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/fmodstudioL
    25. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL
    26. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL.dll
    27. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL.dll
    28. Fallback handler could not load library C:/Program Files/Unity/Hub/Editor/2021.3.28f1/Editor/Data/MonoBleedingEdge/lib/libfmodstudioL
    29. DllNotFoundException: fmodstudioL assembly:<unknown assembly> type:<unknown type> member:(null)
    30.   at (wrapper managed-to-native) FMOD.Memory.FMOD5_Memory_GetStats(int&,int&,bool)
    31.   at FMOD.Memory.GetStats (System.Int32& currentalloced, System.Int32& maxalloced, System.Boolean blocking) [0x00000] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\fmod.cs:991
    32.   at FMODUnity.RuntimeUtils.EnforceLibraryOrder () [0x00000] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\RuntimeUtils.cs:543
    33.   at FMODUnity.EditorUtils.CreateSystem () [0x0000a] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EditorUtils.cs:510
    34.   at FMODUnity.EditorUtils.get_System () [0x0000c] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EditorUtils.cs:597
    35.   at FMODUnity.EventManager.UpdateCache () [0x00269] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EventManager.cs:179
    36.   at FMODUnity.EventManager.RefreshBanks () [0x00000] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EventManager.cs:33
    37.   at FMODUnity.EventManager.BuildTargetChanged () [0x00000] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EventManager.cs:1045
    38.   at FMODUnity.EventManager+<>c.<.cctor>b__16_0 () [0x00000] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EventManager.cs:571
    39.   at FMODUnity.BuildStatusWatcher.SetBuildInProgress (System.Boolean inProgress) [0x0003c] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EditorUtils.cs:1669
    40.   at FMODUnity.BuildStatusWatcher+BuildProcessor.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) [0x00000] in C:\builds\moctezumadev\gitlabrunnertest\Assets\Plugins\FMOD\src\Editor\EditorUtils.cs:1695
    41.   at UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass16_0.<OnBuildPreProcess>b__1 (UnityEditor.Build.IPreprocessBuildWithReport bpp) [0x00000] in <308d48a21a3e462ba091bd758b25b1e6>:0
    42.   at UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) [0x000ff] in <308d48a21a3e462ba091bd758b25b1e6>:0
    43. UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    44. UnityEngine.DebugLogHandler:LogException(Exception, Object)
    45. UnityEngine.Logger:LogException(Exception, Object)
    46. UnityEngine.Debug:LogException(Exception)
    47. UnityEditor.Build.BuildPipelineInterfaces:InvokeCallbackInterfacesPair(List`1, Action`1, List`1, Action`1, Boolean)
    48. UnityEditor.Build.BuildPipelineInterfaces:OnBuildPreProcess(BuildReport)
    49. UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, Int32, BuildOptions, String[], Boolean)
    50. UnityEditor.BuildPipeline:BuildPlayerInternal(String[], String, String, BuildTargetGroup, BuildTarget, Int32, BuildOptions, String[])
    51. UnityEditor.BuildPipeline:BuildPlayer(String[], String, String, BuildTargetGroup, BuildTarget, Int32, BuildOptions, String[])
    52. UnityEditor.BuildPipeline:BuildPlayer(BuildPlayerOptions)
    53. UnityEditor.BuildPipeline:BuildPlayer(String[], String, BuildTarget, BuildOptions)
    54. Builder:Build() (at Assets\BuildPipeline\Editor\Builder.cs:19)
    55.  
    56. (Filename: Assets/Plugins/FMOD/src/fmod.cs Line: 991)
    57.  
    58. DisplayProgressNotification: Build Failed
    59. Error building Player: DllNotFoundException: fmodstudioL assembly:<unknown assembly> type:<unknown type> member:(null)
    60. Unloading 78 Unused Serialized files (Serialized files now loaded: 0)
    61. Unloading 75 unused Assets / (23.0 KB). Loaded Objects now: 3506.
    62. Memory consumption went from 78.2 MB to 78.2 MB.
    63. Total: 6.078000 ms (FindLiveObjects: 0.585500 ms CreateObjectMapping: 0.376400 ms MarkObjects: 5.051600 ms  DeleteObjects: 0.063000 ms)
    64.  
    65. Build Finished, Result: Failure.
    66. Batchmode quit successfully invoked - shutting down!
    I was able to reproduce this issue in different versions of Unity and FMOD with target Win64.

    The build only fails on batchmode and when it is executed in the container.

    Unity
    2021.3.28f1
    2021.3.15f1

    FMOD for Unity
    2.02.13
    2.02.09

    Docker
    version 24.0.4, build 3713ee1

    Gitlab-Runner
    Version: 16.2.0
    Git revision: 782e15da
    Git branch: 16-2-stable
    GO version: go1.20.5
    Built: 2023-07-21T22:53:19+0000
    OS/Arch: windows/amd64

    GameCI Editor Images
    unityci/editor:windows-2021.3.28f1-windows-il2cpp-1.1.2
    unityci/editor:windows-2021.3.15f1-windows-il2cpp-1.1.2

    Attachments
    Dokerfile to build the Docker Image
    Gitlab Runner Full Log
    Source Code of Sample project without FMOD for Unity (just download it and import it)
    config.toml used to config the Gitlab Runner Docker executor.

    FMOD Forum post:
    https://qa.fmod.com/t/docker-windows-dllnotfoundexception-fmodstudiol/20491/8
     

    Attached Files:

    Last edited: Aug 8, 2023
    leon_unity65 likes this.
  2. MoctezumaDev

    MoctezumaDev

    Joined:
    Aug 14, 2013
    Posts:
    53
    Ok part of the issue is gone, it was actually a DLL missing in the docker image.

    upload_2023-8-8_19-51-5.png

    I catched this thanks to an old thread which where someone was having also an issue with a DLL

    https://forum.unity.com/threads/searching-for-dll-in-wrong-folder.1111126/

    Now I have other issue still related to FMOD

    Code (CSharp):
    1. FMOD Studio: Encountered Error: ERR_OUTPUT_INIT Error initializing output device.
    2.  
    3. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    4.  
    5. FMOD Studio: Encountered Error: ERR_INVALID_HANDLE An invalid object handle was used.
    6.  
    7. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    8.  
    9. FMOD Studio: Encountered Error: ERR_INVALID_PARAM An invalid parameter was passed to this function.
    10.  
    11. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    12.  
    13. FMOD Studio: Encountered Error: ERR_INVALID_HANDLE An invalid object handle was used.
    14.  
    15. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    16.  
    17. FMOD Studio: Encountered Error: ERR_INVALID_PARAM An invalid parameter was passed to this function.
    18.  
    19. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    20.  
    21. FMOD Studio: Encountered Error: ERR_INVALID_PARAM An invalid parameter was passed to this function.
    22.  
    23. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    24.  
    25. FMOD Studio: Encountered Error: ERR_INVALID_PARAM An invalid parameter was passed to this function.
    26.  
    27. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    28.  
    29. FMOD Studio: Encountered Error: ERR_INVALID_HANDLE An invalid object handle was used.
    30.  
    31. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 585)
    32.  
    33. FMOD: Bank refresh failed: FMODBanks/Desktop\Master.strings.bank is not a valid bank.
    34.  
    35. (Filename: Assets/Assemblies/Thirdparty/FMOD/src/RuntimeUtils.cs Line: 593)
    36.  
    37. DisplayProgressNotification: Build Failed
    38. Error building Player: 9 errors
     

    Attached Files:

  3. MoctezumaDev

    MoctezumaDev

    Joined:
    Aug 14, 2013
    Posts:
    53
    Just for the record I found the solution for this.

    GameCI images are base in a windows image that does not have the Windows Audios Service. I can not confirm that this might be the reason FMOD throws errors but by using mcr.microsoft.com/windows:1809 as my base image the issue went away.