Search Unity

Why is DX12 so much slower than DX11?

Discussion in 'General Graphics' started by funkyCoty, Mar 6, 2020.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    I wasn't intending to put words in your mouth, I was using hyperbole to more clearly point out that dx12 clearly hasn't been a priority for Unity and it hasn't really been worked on over the last 6 years.

    Because somehow I doubt a team of graphics programmers were tasked to create great dx12 support as their no 1 priority, and they still haven't managed to finish it 6 years later, no?
     
    hopeful likes this.
  2. davidcole

    davidcole

    Joined:
    May 23, 2013
    Posts:
    9
    yes, this is exactly the point I was trying to make, but I removed too much of the original quote, which is why it came across a bit differently.

    I also want to respond to the comment about toxicity, as I think I contributed to that and it’s absolutely not what I want here. I apologise for the negativity in my post. It comes from a place of creative passion – which phenomenal software like Unity facilitates. It’s easy to get a little carried away I guess.

    It does seem Unity has been listening to feedback from its users about issues like this – so when they say it’s being worked on, I think we can believe them.
     
    gsylvain and richardkettlewell like this.
  3. mjc33

    mjc33

    Joined:
    Oct 9, 2019
    Posts:
    26
    Last time I tried out DX12 about a year ago my experiences were like others in this thread, but I thought I would give it a go again (using latest 2021.2), to my surprise performance is actually a lot better for me with DX12 now, particularly in terms of smoothness - with DX11 I was having some issues with stuttering when rapidly moving around the view frustrum (due to large amount of instanced terrain tiles), this vanishes when switching to DX12.

    The only issue is with DX12 I get frequent editor crashes on things like 'toolbar.paint' when DX11 was very stable in that regard
     
  4. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,456
    Did the crash reporter tell you if that crash was a known bug? If not, could you please report it as one?
     
  5. mjc33

    mjc33

    Joined:
    Oct 9, 2019
    Posts:
    26
    Sure next time I get a crash I will make a report

    Have been noticing some huge improvements in the responsiveness of the editor, like saving the scene is so quick compared to DX11 I thought I had hit the wrong key combo or it wasn't working, and if I alt-tab back to Unity after doing other stuff on the computer it renders and is responsive almost instantly instead of taking ~10 seconds to draw everything and become responsive to input that I had become used to (with a big complicated scene).
     
    MartinTilo likes this.
  6. mjc33

    mjc33

    Joined:
    Oct 9, 2019
    Posts:
    26
    Ever since 2021.1.14 came out I haven't been able to load my project with DX12 due to editor crash, have tried every new version hoping it will be fixed but still not the case. 13 still works fine as does DX11. Using a 1060 with latest 471.96 (happened with previous release too).

    Looking into the crash dumps I'm seeing this

    Code (csharp):
    1. d3d12: upload buffer was full! Waited for COPY queue for 1.059 ms.
    2. d3d12: upload buffer was full! Waited for COPY queue for 5.641 ms.
    3. d3d12: upload buffer was full! Waited for COPY queue for 1.895 ms.
    4. d3d12: upload buffer was full! Waited for COPY queue for 5.410 ms.
    5. d3d12: upload buffer was full! Waited for COPY queue for 0.000 ms.
    6. d3d12: upload buffer was full! Waited for COPY queue for 5.436 ms.
    7. d3d12: upload buffer was full! Waited for COPY queue for 5.748 ms.
    8. d3d12: upload buffer was full! Waited for COPY queue for 5.355 ms.
    9. d3d12: upload buffer was full! Waited for COPY queue for 4.464 ms.
    10. d3d12: upload buffer was full! Waited for COPY queue for 2.881 ms.
    11. d3d12: upload buffer was full! Waited for COPY queue for 4.004 ms.
    12. d3d12: upload buffer was full! Waited for COPY queue for 5.376 ms.
    13. d3d12: upload buffer was full! Waited for COPY queue for 0.550 ms.
    14. ProgressiveSceneManager::Cancel()
    15. d3d12: CreateCommandAllocator failed (887a0005).
    16. Device removed reason (887a0006).
    17. GfxDevice was not out of Local memory
    18. Local memory usage:
    19. Budget: 5496610816
    20. CurrentUsage: 5177020416
    21. AvailableForReservation: 67108864
    22. CurrentReservation: 2904555520
    23. GfxDevice was not out of Non-Local memory
    24. Non-Local memory usage:
    25. Budget: 9896141620
    26. CurrentUsage: 266612736
    27. AvailableForReservation: 0
    28. CurrentReservation: 5082288538
    29. Set -force-d3d12-debug for more information on device removal
    30. d3d12: CreateCommandList failed (80070057).
    31. Crash!!!
    Exception in the dump is "The thread tried to read from or write to a virtual address for which it does not have the appropriate access." and dissasembly shows the error happens on the second of these two lines


    00007FF638DAA0C5 call D3D12CommandList::GetCmdListAndMakeActive (07FF638DC09A0h)
    00007FF638DAA0CA mov r9,qword ptr [rax]


    I tried using -force-d3d12-debug, but this just seems to make the project open with DX11?
     
  7. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Send a bug report with a sample of your project that causes the same problem when built
     
    MartinTilo likes this.
  8. mjc33

    mjc33

    Joined:
    Oct 9, 2019
    Posts:
    26
    Have submitted multiple bug reports on this issue, am not able to upload the project. I'd have to make a new empty project and recreate the issue with it.

    Edit - Don't know what the issue was but I gave up on new versions for a while, whatever it was has been fixed at some point between .19 and .26, not having crashes now
     
    Last edited: Oct 25, 2021
  9. unity_zw6QHpcgpJfeDA

    unity_zw6QHpcgpJfeDA

    Joined:
    Mar 23, 2018
    Posts:
    6
    Great to hear that DirectX12 is getting performant! Is this only the case for newer Unity versions or is this also included in latest 2018 patches?
     
  10. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Just FYI,

    DX12 on average is about 40% slower on anything above 1440p on 2022.1

    Still very bad performance, and mostly unusable which also renders Raytracing unusable.
     
  11. tvirolai

    tvirolai

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    79
    Hi, is this on HDRP with raytracing off on DX12 vs DX11? Because while we are slower 40% is tad too much.

    We aim to be max 10% slower in the near future. For the current system we cannot match DX11 in all cases for the simple reason that we have to essentially reimplement DX11 on top of DX12, and that has overhead. However this overhead should scale on terms of drawcalls, not in term of rendering resolution assuming everything else remains constant.
     
    valarnur likes this.
  12. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    No offense, but I don't understand your question....have you even tried DX12? Of course this is without raytrace...I don't know why every time I bring the DX12 issue the devs say it is just a "little" slower...it is not just a little slower. At 1440p i have to max out DLSS to match DX11...

    Please just actually load a full sized game or even a scene and see how the comparison works between DX11 and DX12. The performance at anything below 1440p is just not noticeable in small tests scenes that you guys use...In the HDRP test scene it dips between 10%~20%. But try it again on a more sizeable scene...and see it just drop...I am really pissed that after all these years, you guys are aiming for 10% slower DX12...and on top of that, that you guys are not even aware that DX12 pretty much halves FPS in a full blown scene...I mean...come on...have you guys not been listening to everyone saying that DX12's performance is amazingly bad...Google search literally auto completes this...

    Unless, what you were trying to say is that instead of 40%, you were thinking something like 35%~30%....and I overreacted...either way...DX12 is too slow...

    Here are my specs in case you are wondering
    AMD 5950x
    64gb ram
    4tb NVME SSD
    RTX 2080
    WIN10.

    No real hardware reason for DX12 to be suffering...
     
    funkyCoty and Necka_ like this.
  13. tvirolai

    tvirolai

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    79
    Yeah I was anticipating something like 20-30% slowdown on some super heavy scenes right now. Unfortunately as our intermediate layer is basically DX11 we cannot be faster than DX11 in all cases. Because the emulation has overhead. There are longer term plans to change the layer, but naturally as that requires changes in all backends it will take even longer. But hey, at least there are plans :D

    Do you see similar performance drop in standalone build vs editor? Standalone build uses graphics jobs which allow us to be faster than DX11 in some cases, at the expense of baking your CPU. The reason for not using them in Editor is stability for now. Same thing applies to Vulkan and Metal.

    We are well aware that DX12 is slow. The more slow things we can profile the more we can fix things inside the engine to get it to usable stage on large scenes. Performance in non-HDRP should have improved in 22.1. HDRP is a different beast as it uses explicit constantbuffers so whatever optimizations we make to the good old shader property path are not seen in HDRP.
     
  14. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    I personally don't understand the strategy here.

    You market HDRP everywhere like the next big thing for Unity.
    DLSS is only available in HDRP
    RTX is only available in HDRP (with DX12)

    And yet the focus isn't on HDRP as apparently non HDRP DX12 projects benefits from higher performances and I'm pretty sure most of Unity dev would use DX12 with HDRP to enable RTX.

    So that's super nice, we have plenty of tools available to use Raytracing in an HDRP project but we are bound to not get good enough performance to make actual productive projects.

    Sure DLSS compensate a little but why can't we have Unity making their top priority to have proper DX12 implementation (without DX11 overhead - I don't even understand that non-sense) so we can have good base performances and improve them with DLSS.

    I'm pretty sure the rendering team isn't responsible for that: but when I read that Unity acquire Speedtree, Zyva and other things that won't ever improve the core problems of Unity that shows to us (devs) that the money is being put in the wrong teams.

    But hey, at least the Shareholders are happy.
     
    unity_8p6oRXXqiWbRTQ likes this.
  15. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Out of curiosity, how come that DX12 is going forward so slowly? Is there no priority or resources?

    I had reported DX12 performance issues (link) in March 2020 already and at this point, DX12 support was in Unity for quite some time already as well. I had thought 2 years isn't too bad to improve it.
     
  16. tvirolai

    tvirolai

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    79
    I have some good news: Now there is. Since last fall we have a dedicated team for this, which incidentally I'm leading, and we are focused on DX12 backend in all it's glory. We also keep the lights on with DX11 but thankfully that's relatively stable. Please poke me if you have feedback or improvement suggestions or whatever regarding our DX12 backend.

    So there should be more and more improvements dropping in soon.

    A major improvement that's in the queue right now is memory residency support allowing users to overprovision GPU memory just like DX11 does. This should fix most out of memory crashes in the editor in one fell swoop. Priorities currently naturally go with stability being #1 and after that performance. These things will take some time (thankfully no-one has asked you before to just wait, right?) but let's see how far we'll go and how fast.

    EDIT: I just took your performance project and let's see how it works on 2022.whateveralpha. Based on your graphs it seems like a really good test case for us for some CPU profiling. Thank you for taking the time and effort to make them
     
    Last edited: Jan 27, 2022
  17. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    The project is used inside Unity Technologies for various things as I understand. There could be an updated version of it that runs in 2022 already, so you don't have to go through the trouble of upgrading it. @JohnC-Unity @richardkettlewell and @vickycl used the project as far as I know.

    Otherwise you should be able to use the project attached to (Case 1300104), which is the same project, but submitted with 2021.1.
     
    tvirolai likes this.
  18. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    If you guys are serious about DX12...start by making a good scene to test it.

    Not a small room

    Not a 50m terrain...no

    begin with at least 10km terrain

    slap on multiple vfx graphs

    slap on minimum 1000+ decals

    add in rigged mesh

    scatter around mesh props

    then finally add in vertex animated meshes

    bake nav mesh and make rigged mesh roam around

    and have a heavy UI canvas with at least 100+ images and tmp texts

    add in many meshes with GPU instancing...and fill that GPU

    now add in ambient audiosources around the map...and fill the DSP buffer.

    Turn every texture into Virtual textures at 4k. Make sure to push the texture memory to its limit.

    and most importantly...do not optimize. If you start to optimize, then the test scene becomes moot.

    Now you actually have a scene that is similar to a commercial game...not as heavy or complex but close enough and not too heavy to make it a nightmare. You need to make Unityengine suffer to see if what ever you build is actually stable. Hell, DX11 is still wonky. So begin with a good, real world standard to begin with.

    Some of you might think this is too much. But, if you think twice about it...any decent engine should be able to do it easy...it might choke a little...and Unity will...and crash...but it should be easy on modern hardware if DX12 is done right. Nothing crazy really...

    Once this is done, begin your work on DX12.
     
  19. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    Hey, we've sent our project (wave break) to unity for various bug and performance reports in the past. Is there a way we can forward this to you, and maybe get some focus on improvements to dx12? We thought about shipping RTX at the launch of the game, but the DX12 slowdowns were so great it was just not viable. No RTX for players because DX12 is too slow, it's very sad.

    I just wanna make it super clear, players at the very end of things are missing out on cool stuff like this (builtin deferred+custom rtx+dx12) because DX12 has been so consistently slow for so many years. I'll do anything I can to help speed this up.

    At this point I'd be happy if Unity's Vulkan implementation on PC worked with RTX, if getting DX12 faster than DX11 is really just impossible.
     
  20. tvirolai

    tvirolai

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    79
    Hi, We will keep your project in mind when we have more bandwidth for optimization focused work. Just remember that we are a relatively small group with narrow focus so we don't have time to do things like making sure the project actually works in latest version of Unity. But if it nicely runs on the latest version we'll definitely want to take a look likely sometime during this spring.
     
    stevphie123 and hippocoder like this.
  21. celeronpm

    celeronpm

    Joined:
    Feb 15, 2017
    Posts:
    11

    Really looking forward to DX 12 performance improvements. Here are benchmark results for our game www.CrushDepth.com

    Benchmark Results

    DX 12 is significantly slower and really unusable for us. Ray tracing is a nonstarter as the overhead added to each light brings 120fps down to 3fps in our project. I really hope to see DX12 performance improve significantly over the coming releases and really appreciate the time you are taking to share updates with us.
     
  22. RR7

    RR7

    Joined:
    Jan 9, 2017
    Posts:
    254
    i develop for console using GameCore and that's DX12 exclusive. i'm fighting for frame time constantly, getting some of that 20-30% back that's just being lost in the engine would be awesome.
     
  23. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    It runs on the latest version of 2019.4 haha. I haven't tried it with anything newer.
     
  24. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    Your benchmark access is protected.
     
  25. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That is absolutely no problem, however some notes:
    • There's no real DX12 specific detail on the roadmaps
    • Customers will be more reasonable if they know your constraints but you can't really tell us those without appearing critical of your employer. Something a roadmap can indirectly address.
    You are the team lead so I totally understand that managing customer expectation is not really your job to do, but a burden that we appreciate nonetheless.

    With that said, I am pretty surprised that DX12 is not there yet. It's not your fault in the slightest and we get that as your team has not had the resources. Looking forward to more transparency so we can choose to use parts of Unity that might better fit the situation and project though.
     
    Scott_Pottenger, NotaNaN and Gasimo like this.
  26. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    305
    Not a critique about the devs in the DX12 trenches, but why Unity is not dedicating a lot more ressource to DX12 is beyond me.
    Clearly DX12 is the state of the art technology for high end Desktop game and has been released 7 years ago.
    If Unity is serious about trying to keep up with state of the art rendering technology more investment is required.
    Given the selling points of DX12 vs 11, trying to just rebuild 11 in 12 is not good enough for demanding projects.
     
  27. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Yeah, I'm puzzled about that myself. I'd think getting DX12 going would be a huge company-wide priority, more important than tech releases.
     
    unity_8p6oRXXqiWbRTQ likes this.
  28. Necka_

    Necka_

    Joined:
    Jan 22, 2018
    Posts:
    488
    100% agree. That's where I'm really confused.
     
    unity_8p6oRXXqiWbRTQ likes this.
  29. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Also, Xbox Series X|S and Xbox One games going forward are now DX12 only.

    I don't know if the Xbox DX12 team is separate from the Windows DX12 team or not, because it would be terrible for Unity games on Xbox if they are all using an inefficient DX11 wrapper under the hood.
     
  30. tvirolai

    tvirolai

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    79
    This is a good point. I'll see if I can get something to the public roadmaps.

    We are all in the same team. It's just DX12. In that platform the performance and stability are pretty good. Our biggest issues are in the Editor and Windows standalone, but I cannot tell details as to why outside of our GameCore forums.
     
    NotaNaN and hippocoder like this.
  31. funkyCoty

    funkyCoty

    Joined:
    May 22, 2018
    Posts:
    727
    Are you sure? On a project I was involved in, we saw similar performance between the Nintendo Switch and base Xbox One. Xbox should in theory be much faster, but the cpu side of draw calls took so much longer on xbox it ended up almost being slower.
     
  32. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Gif comparison:
    DXCOmpareVulkan.gif
    __________________________
    Screenshots
     
  33. tvirolai

    tvirolai

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    79
    Definitely unexpected at least on any later version of Unity. What scene is that? Is raytracing on for DX12 or not (The reason I'm asking this is because it's so very common to see comparisons with DX12 with raytracing vs others without it).

    Very sure. There might be some edgecases, like there always are, but on average it works very well. If you have an example where it does indeed work really slowly we would be delighted to take a look and fix it.
     
  34. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Original scene was for Unreal Engine from evermotion that has been exported and re lighted in the unity 2022 on built-in pipeline

    Just switched to the DX12 and Vulkan from player settings
     
  35. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Let me just clear the air a bit here.

    Unity devs seem to think DX12 performance is good and in some cases, slightly slower
    -> Completely not true. DX12 performance is really bad. Period.

    Unity devs seem to think DX12 + Raytracing performance is making people think DX12 is slow.
    -> Completely not true. DX12 performance is really bad. Period.

    Unity devs seem to think DX12 is currently able to near match DX11 in performance
    -> Completely not true. DX12 performance is really bad. Period.

    Unity devs seem to think DX12 is just slow in Editor and standalone build is fine.
    -> Completely not true. DX12 performance is really bad. Period.
     
    funkyCoty likes this.
  36. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Did you send a test scene to them proving this? You can read what other people post and then assume that is the mighty undisputed fact, but how do you know the people posting are exactly your level of experience or higher? Because that is what you assume posting this if you have not personally sent a test to Unity.

    None of us should be looking at what issues other people are having if we have not sent a recent case. If you have, then accept my apologies. If you haven't then let me apologise for ignoring your opinion.
     
  37. slime73

    slime73

    Joined:
    May 14, 2017
    Posts:
    107
    A tricky thing with builds is the DX11 backend can't use native graphics jobs, whereas the DX12 and Vulkan backends can. So with projects that don't make good use of multiple threads in script code (especially small demo projects), the DX12 backend might perform on par with or better than DX11 in PC builds (since it's able to use more threads) - but that doesn't mean the work it does is necessarily efficient, especially compared to the Vulkan backend.
     
    Last edited: Feb 12, 2022
    unity_8p6oRXXqiWbRTQ likes this.
  38. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    I don't know if you are asking just as a member out of curiosity or as moderator. But this doesn't feel good if it is as a moderator. Opinions should not be "accused" and as a moderator that shouldn't even be your concern. I would like to believe that this is just me overreacting but I also cannot help feel that Unity is trying to keep a short leash members who actually say stuff straight up. Maybe you should refrain from such comments in your moderator account in the future.

    Regardless, all in good faith, as for the issue of DX12, I've been raising this issue constantly, and have received feedback and have exchanged info with the devs and I believe it goes back a few years. I think I started raising this issue since the first release of HDRP when we were in 3.0 or 4.0. Not sure exactly as it goes a few years back. They told me they are working on it back then, but hearing that they formed the team like two weeks ago to work on this now...kind of feels bad...straight up BS there. Don't know why I spent all that time providing feedback...when there wasn't even a proper team working on it...maybe a team of two or three peeps...dunno...but still feels bad...

    I've also posted a thread regarding this asking for more detail as to why DX12 is in its current state about six months ago.

    But now that we are here and are asking for proof that I really had a bad experience with DX12, and that my statement is not just a reaction to reading other people's posts, let's just get some hard numbers out. All tests were done in latest HDRP13, 2022.1b7, Win10, 5950X CPU, 64Gb RAM, RTX2080, 4TB NVME, 1440p, IL2CPP Standalone Build.

    template.png
    This is the HDRP template, and while DX12 is about 20% slower than DX11, it seems to be in the range of what the devs say. DX12 is only 20% slower.

    BUT

    This template is a not a good measuring stick for investigating DX12, as it barely uses any GPU and any potential DX12 benefits/issues won't really come to light. Strange it loses 20% even in this lightweight scene...

    Let's move onto an actual commercial project.

    This is a FPS game that we are working on and is nearing release on Steam.
    I know linking the game from screenshots to its actual name is not difficult, but please respect the privacy in this regard. Just observe the material for the sake of this thread.

    gameScreen.png
    Now, in a full FPS environment, DX12 starts to take a bigger hit. No settings were changed, and the game was saved and loaded in, so this is as close as it gets to an actual comparison. No BS, just straight up numbers.

    The numbers show a 67% decrease in performance.

    Now, the game uses about 4gb of memory and about 80% usage on my RTX2080 at 1440p. It runs at 80~90FPS at med settings (shown in the screenshot). With DLSS, it can easily go above 140FPS.

    Now, I've investigated further:

    DX12 seems to take a huge performance hit with shadows, texturing filtering and texture resolution. When I change texture from Med -> High which is 1k to 2k texture, it loses about 15FPS. Something is wrong. Doesn't happen on DX11 in case you are curious

    SSGI, SSR, Volumetrics also take 5~10FPS easy at low settings. When I turn every graphics settings off, like no shadows and nothing, then I can reach near 150FPS. On DX11 I can reach near 200FPS.

    Also DX12 standalone takes a long time to start and often locks up the game for about 10 seconds. The first scene is literally an empty scene with UI text so something is wrong here again. Happens with both HDRP template and my project.

    start.png

    So, now that I have provided data, for like the 10th time...I hope it helps. If you still don't believe me for some odd reason, I will send you a Steam key when it releases, and feel free to jump into DX12. Although I don't think I will include DX12 as the performance just makes it out of the question...

    Now back to my original statement:
    Unity devs seem to think DX12 performance is good and in some cases, slightly slower
    -> Completely not true. DX12 performance is really bad. Period.

    Unity devs seem to think DX12 + Raytracing performance is making people think DX12 is slow.
    -> Completely not true. DX12 performance is really bad. Period.

    Unity devs seem to think DX12 is currently able to near match DX11 in performance
    -> Completely not true. DX12 performance is really bad. Period.

    Unity devs seem to think DX12 is just slow in Editor and standalone build is fine.
    -> Completely not true. DX12 performance is really bad. Period.

    Can we stop "not believing" and begin fixing DX12...

    If this is not enough for you devs, I can bring up my old Open World HDRP project (I've posted screenshots somewhere...) and that used to go down to 10FPS in open areas...while hitting steady 90FPS in DX11.

    I can also bring up another game released on Steam that uses HDRP, and this one has RTS top down camera in Unity2020 version, so I can prove that this is not specific to FPS, camera, or even Unity version. DX12 performance has never been good and is honestly a not usable. I don't know why this is so hard to believe when the devs can literally do the same test in 5 minutes.

    Hope this helps.

    In case you are new to this thread...here is what other people have said with regards to DX12

    It extremely slow for me aswell, in many scenarios. Even if raytracing mark is turned off it's pretty much 30% slower than DX11 out of the box. On more complicated scenes with a lot of object performance is even worse, it can be even to 70% slower than DX11 or Vulcan.

    this is still the case in 2019.4, its kind of crazy how much slower it is. I thought one of the big perks of DX12/Vulkan were jobified render queue, but even with my ryzen 9 it just seems slower on DX12.




    Now I am gonna go and make a vid to prove that Virtual Texturing is broken since b5 and find a way to replicate it...cheers.
     
    Last edited: Feb 12, 2022
    chingwa, BOXOPHOBIC, hopeful and 5 others like this.
  39. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Pretty sure the only time I will speak as a moderator (if such a concept exists) is to moderate a discussion (or spam). I have no say nor would I want any say, in Unity matters.

    Any other discussion is personal, like any mod.
     
  40. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Good to know. Thanks
     
  41. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Moderators are community members, not a part of Unity, so moderator or not, he is not really speaking for Unity.
    This thread has plenty of people showcasing it being slower in DX12, and even Unity devs themselves agreeing it is slower. IMO, it's not up to the community to keep testing and retesting DX12 "just in case".

    Personally, at this point, I test new Unity features around a year or two after they are "production ready" and then get instantly disappointed. To bother re-evaluating, I need overwhelming evidence (blog posts? release notes? people raving about a feature in the forums?) that the feature has gotten a lot more work done to it.

    I arrived at the above policy after many painful years of having to ride along subpar Unity features in hopes that in the next version they will finally fix it, only for a decade to go by.

    As for DX12 specifically, I did a pretty good evaluation around ~2017 and I found DX12 unstable and slow. It has been ~5 years since then, and Unity hasn't given me reasons to think things have changed, or that they're even really working on it at all. The onus to prove the status of a feature is on Unity IMO, not the community.

    IMO DX12, along with a number of other Unity features, falls under the category of features where the goal for implementing them is to get a cool blog post out of them and not to actually have a useful feature.
     
    Last edited: Feb 12, 2022
  42. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah but what we don't need, and what nobody needs are me too summary posts. That's literally noise. And yes, this is a moderator post. In a thread like this any additions should at least come with constructive purpose, even if it's "my project does x when y" but what isn't cool is "abc said so and so and I have similar but then peter said paul". That's noise.

    If we want to get it fixed, how is shouting louder or repeating stuff in the same thread helping? It is not. It is simply telling Unity staff they are blind while not sending them enough data.
     
  43. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Point taken.

    But I don't know, I remember someone telling the community we should submit bug reports even though a bug may have already been filled, so Unity can gauge how many users it is affecting and prioritize accordingly. And I would argue noisy forum posts serve a similar purpose, but we're getting off topic, so I'll stop here.
     
    NotaNaN, hippocoder and funkyCoty like this.
  44. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    I believe it does help to expose what's wrong with Unity to a broader audience. But the forums are not enough though.

    It seems to be better to make a Twitter post where one who has "enough important followers" retweets it, for example the #srplife campaign. The caused blame seems to make higher management to step in. But it's unclear to me whether it solves the problem.
     
    NotaNaN, AcidArrow and hippocoder like this.
  45. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I agree. Although the best way to "attack" Unity's issues to fix this is really to demonstrate - somehow - that they need to pay attention to an area without getting a reputation for just being a noisy customer.

    Personally, I'm with @jjejj87 @Peter77 @AcidArrow and everyone else who has week after week tried to make Unity do something with it.

    So yeah you know, I'm going to retract my remarks. Sorry. I think that customers do indeed deserve to shout as loud as they want. So many users (none in this thread) tend to just copy what other people are saying, and we can't do that, so that's one element that was in my mind.

    Perhaps Unity can tell us more, be more transparent but not just on the forums, as a post from staff can be lost at sea here. I really would like to see more roadmaps for performance, because performance is actually a feature.

    If it wasn't, there wouldn't be DOTS.
     
  46. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    305
    We are working on a project in 2020 LTS with HDRP, available on Steam (Synthetik 2 in Steam) and have tested DX12 over the last year. The performance has been wildly fluctuating.

    In a few 2020.3 patches performance seems to have been on par with DX11, most of the time between 30% to 150% times worse.
    In 2020.3.25 for example just the a single directional light with realtime shadows eats 8-10ms on my machine when with DX11 the whole scene takes this. In 2020.3.18 performance DX11 vs DX12 was more or less even.

    For us it's not just DX12, for example using Vulkan in .25 the game runs out of GPU memory in main menu, when with DX11 it still runs on relatively old hardware.
    Decal projectors in the LTS HDRP version still uses the LateUpdate for every projector to do some validation checks resulting in 0.5ms main thread overhead for roughly 1k projectors (which in my view is not many at all) in a scene .

    Now I'm sure if we where to test & report this constantly, Unity would work on improving the situation for our specific situation, but quite frankly we do not think this investment seems worth it as we do expect to have to do this on an ongoing basis.
    Their actions as shown by the updates and state of 2020.3+HDRP+DX12 has clearly demonstrated that they are either not interested in higher end core games or incompetent to execute in that direction.
    We have been aware of that risk from the start and instead scale back our expectations to a level where DX11 and the rest is "good enough" and will consider abandoning Unity in the future.

    On the point of requiring to demonstrate that Unity is lacking I'd argue that this should not be necessary, Unity already has a pretty terrible reputation in the AAA/high end circles.
    Very few high caliber production games use it, the results speak for themselves.

    I'm not sure that it is required to "warn the broader audience".
    Arguable many of the devs with smaller production scope will not seriously bump into this problem as it is.
    Those that would, will likely go with the competition anyway.
    But I think it makes sense to point out very clearly that should Unity actually be interested in aquiring a solid market share in higher tier productions they seriously need to overhaul their strategy.
    Just posting a few, shiny marketing videos of HDRP demo project is not going to cut it.
     
    jjejj87 and PutridEx like this.
  47. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    I like HDRP and it's my main RP, but starting to think it is old-gen unreal engine.
    Don't want to mention other engines, but there's a good comparison to make here.

    For example: Signed distance field ambient occlusion & SDF shadows.
    Both available in unreal for years, give it 2-3~ years and it'll be a decade.
    Fortnite relies entirely on SDF AO to light it's interiors correctly, otherwise sky light will be everywhere, which would be the case with HDRP.

    Capsule shadows have been available for a long time in unreal, and we're only now getting it (possibly) in 2022.2.

    There was a capsule shadows hackweek back in 2020, but it was left behind until 2022 when someone decided to pick it up.

    I struggled a lot with the GPU lightmapper. I complained about it and finally they now say the GPU lightmapper faces some regressions and I should fallback to the CPU lightmapper and wait for a century to bake.

    I'd understand if I can use multiple computers to bake with the CPU lightmapper, but unity doesn't provide any functionality for this, unlike other engines.

    Raytracing requires DX12, but even if DX12 wasn't slow, raytracing in HDRP has a big main thread cost.
     
  48. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    The DX12 is not slow, the DX11 is too much fast inside unity!!!
    DX11 and overall unity renderer is much faster than other engines
     
    Last edited: Apr 7, 2022
    Deleted User likes this.
  49. tvirolai

    tvirolai

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    79
    It's weird to see such a large fluctuation across patches. Our internal performance regression tracking shows it to be rather stable. We really need to look into what's causing all of this. Do you recall if the difference was in Editor or Standalone or both? (this information is useful as Editor doesn't use graphics jobs)

    As for memory consumption it's because DX11 automatically swaps things in and out of GPU memory. Driver does that, we don't need to do a thing. Vulkan and DX12 don't.

    Incidentally the next tech stream release of Unity has the new memory manager for DX12, that will allow DX12 (or more precisely allows Windows to do it) to swap things in and out of GPU memory. This should fix vast majority of these issues for DX12. Current limitation is that the working set of a single frame must fit in the GPU visible ram + GPU memory. Moving this down to more granularity will come later.

    I don't have any doubts that it will crash and burn horribly in some cases even after extensive testing, thankfully it should crash and burn only if one is out of memory so we'd have crashed and burned already. We're waiting any bug reports on it happily to be able to make it as robust as possible.

    P.S. I loved the first Synthetik! Great job on that one!
     
  50. Flow-Fire-Games

    Flow-Fire-Games

    Joined:
    Jun 11, 2015
    Posts:
    305
    Thank you :)

    Stability wise I can not remember seeing any crashes or similar in DX12, just a lot slower.
    Same is true for Vulkan (testing this only on Linux though, so could very well be OS issues also).

    We are using only LTS and are in the middle of running Early Access, meaning we don't have much time to hunt down DX12 specific bottlenecks in our project in likely buggy versions of Unity.
    If you guys are interested to run some tests and profiles in our full project to confirm the upcoming changes, I can give you access to the project VCS.