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

Resolved Burst GPU

Discussion in 'DOTS Dev Blitz Day 2023 - Q&A' started by optimise, Aug 23, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    Does official has any plan to implement burst GPU feature that can burst GPU side too?
     
  2. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,081
    GPU side already bursted by gpu :)
    but interesting question is running bursted code on GPU compute :)
     
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,029
    What I mean is burst GPU side code. I believe official has done a working prototype long time ago. It will open new possibility.
     
  4. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,081
    Waiting for official answer but what i mean is: what Unity done in Burst for CPU is what GPU Shader compilers done in shaders compilation decade ago :)
     
  5. icauroboros

    icauroboros

    Joined:
    Apr 30, 2021
    Posts:
    99
    I wonder what compiles Compute shader currently? Can Burst(or LLVM) give better performance? Also maybe it is possible to give us to IJobFor.ScheduleOnGpu type of thing, with some expected downsides of course.
     
  6. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,081
    shaders compiled by drivers of GPU.

    I like this IJobFor.ScheduleOnGpu and think unity move towards it :)
     
  7. elliotc-unity

    elliotc-unity

    Unity Technologies

    Joined:
    Nov 5, 2015
    Posts:
    228
    There was a hackweek once or twice (last one probably 2019) where we translated burst-like c# into shader code and compiled that as a shader. Nobody was that high on the idea of really shipping it because, among other reasons, there's a lot of tooling and communal knowledge around hlsl that wouldn't transfer that cleanly, and it doesn't provide anywhere near the same benefits over hlsl that c# over c++ on the cpu does (namely safety & ease of portability compared to c++).

    Shader compilation depends on the graphics API. In dx12, a compiler called dxc compiles hlsl to directx bytecode, which is handed to the gpu driver, which translates it into actual internal gpu instructions.

    In vulkan, unity translates hlsl into spir-v or whatever the vulkan shading language is called, and then I believe it's a similar path to dx12. I bet metal is similar too, but I haven't seen it myself.

    In opengl, unity translates hlsl to glsl, and then the full text of the glsl is handed to the driver, which compiles it the first time it's used. This is why in opengl games you used to have hitches whenever you saw something for the first time, until devs noticed and started doing stuff in loading to trick the driver into thinking it was using the shader during the loading screen, so that the hitch would happen during the loading screen rather than during actual play. :)

    Consoles tend to behave like dx12/vulkan/metal these days.
     
  8. icauroboros

    icauroboros

    Joined:
    Apr 30, 2021
    Posts:
    99
    Makes sense actually, I don't know why but I group compute shader with CUDA-like frameworks in my mind for some reason :D