Search Unity

Dispatching Compute Shaders to run in parallel

Discussion in 'Shaders' started by funkyCoty, Nov 5, 2020.

  1. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    It seems that Compute Shaders always run one after another, regardless of dependencies between them. If I'm dispatching hundreds of Compute Shaders that are all only dispatching a few cores worth of work each, is there no way to schedule them in a way that would have groups of them run in parallel?
     
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,549
    funkyCoty likes this.
  3. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    Ah man.. It's not supported on Switch. Damn, I was so hype when I read your reply, haha. I implemented this immediately and went to test.. no gains. Checked that bool: false.

    Unity PLEASE, how can we get this magic in?
     
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,549
    The Maxwell GPU on the switch don't properly support async compute as far as I'm aware. Only partially on the CUDA side. In Pascal is when full proper support was implemented.

    I'd recommend trying to merge your kernel workloads if possible so you can get more core saturation. Queue up structures of the data to work on from multiple sources, compute it then parse the results back out to those sources.

    If these compute operations also aren't using many cores, then it might be a better use case of doing it on the CPU. You can utilize the Jobs/Burst system to compute all these different operations in a highly parallel and optimized manner and then submit any computed results to the GPU once done, instead of beforehand.
     
    Last edited: Nov 7, 2020
  5. korzen303

    korzen303

    Joined:
    Oct 2, 2012
    Posts:
    223
    So does DX12/Vulkan async compute on desktop (Win64) actually works? Despite that in 2019.4.14f1 SystemInfo.supportsAsyncCompute returns FALSE for both DX12 and Vulkan.

    I am currently exploring a feasibility of running some GPU simulation in VR. As such decoupling graphics rendering from compute is crucial. It is fine if the simulation drops below real-time but not acceptable for the graphics.

    Cheers