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.
  2. Dismiss Notice

Multithreading and WebGL

Discussion in 'WebGL' started by ChristianKoGaMa, Jan 29, 2020.

  1. tmars

    tmars

    Joined:
    Jul 26, 2013
    Posts:
    42
    @unityruba btw, how do we actually enable multithreading?
    I've set PlayerSettings.WebGL.threadsSupport to true and now I'm getting some weird error:

    [Postprocess built player] Internal build system error. BuildProgram exited with code 1.
    System.ArgumentException: You're trying to copy to build/Build/d41d8cd98f00b204e9800998ecf8427e.js more than once. Previously from Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.framework.js and now from Library/Bee/artifacts/WebGL/build/debug_WebGL_wasm/build.worker.js
    at Bee.Core.CopyTool.Setup(NPath target, NPath from)
    at WebGLPlayerBuildProgram.WebGLPlayer.SetupCompression(NPath input, NPath output)
    at WebGLPlayerBuildProgram.WebGLPlayer.SetupPostProcessBuildFile(NPath path)
    at WebGLPlayerBuildProgram.WebGLPlayer.SetupPlayerExecutable()+MoveNext()
    at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
    at System.Collections.Generic.SparseArrayBuilder`1.ReserveOrAdd(IEnumerable`1 items)
    at System.Linq.Enumerable.ConcatNIterator`1.LazyToArray()
    at System.Linq.Enumerable.ConcatNIterator`1.ToArray()
    at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
    at PlayerBuildProgramLibrary.PlayerBuildProgramBase.RunBuildProgram()
    at PlayerBuildProgramTypeWrapper.Run(String[] args)
    at Program.Main(String[] args)

    The WebGL template is set to PWA. Any ideas?
     
  2. RageAgainstThePixel

    RageAgainstThePixel

    Joined:
    Mar 11, 2020
    Posts:
    53
    Ended up just using this package I found on GitHub to accomplish the same thing:
    https://forum.unity.com/threads/async-await-and-webgl-builds.472994/page-2#post-6866063
    https://github.com/VolodymyrBS/WebGLThreadingPatcher
    Thanks @VolodymyrBS !
     
    Thaina likes this.
  3. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    233
    @tmars what Unity version are you on?
     
  4. tmars

    tmars

    Joined:
    Jul 26, 2013
    Posts:
    42
    @unityruba 2022.3.0f
     
  5. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    233
    @tmars are you using the Name Files As Hashes option? if you are, does disabling it make the build succeed?
     
  6. Alex_Heizenrader

    Alex_Heizenrader

    Joined:
    May 16, 2019
    Posts:
    66
    Any news on progress? Its been a few years of C# multithreading hopes (if not more) with no luck.
     
    Chris9465 likes this.
  7. Zarbuz

    Zarbuz

    Joined:
    Oct 13, 2015
    Posts:
    31
    What's the roadmap about WebGL and C# multithreading for 2024? Is it still a thing working on ?