Search Unity

Question DLSS Seems to be nonfunctional

Discussion in 'High Definition Render Pipeline' started by gorbit99, Jul 5, 2021.

  1. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    I tried to set up DLSS for a project, but to me it seems like absolutely no change happens performancevise even though the quality suffers visibly. Even setting the forced screen percentage to values such as 10% doesn't really make a big impact, both render times (through the connected profiler in a build) and GPU usages from task manager seem about the same. Same thing for VRAM usage. What could I be doing wrong? I've tried setting both screen percentage and quality settings all around the place, but nothing changed.
     
  2. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    We are using DLSS, and it works very well. We get a significant performance increase and quality is really good (do not notice any reduction in quality using DLSS).

    Remember that DLSS requires a RTX GPU...
     
  3. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    I know, we're using a 2080 if I'm not mistaken, otherwise I'm pretty sure it would either not work or use a fallback. And it tells us that it won't because dlss compatible hardware is detected.
    In my case we've tried multiple scenes, one with relatively few triangles (10k>) and one with a lot (134 million), to check if maybe there's just not enough render time to see changes, but not even the latter resulted in any signs of improvement.
    Strangely not even non dlss dynamic resolution nets us any performance gains.
     
  4. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    There can be many reasons why you do not see performance gain with DLSS, if you are CPU bound, FPS will not increase with DLSS (since this reduces GPU load, not CPU).

    DLSS is amazing, in our project we got 1.5x performance gain. We are however mainly GPU bound.
     
  5. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    I mean, the test project was literally the sphere with the stand from the hdrp start scene copied 3125 times, there are no scripts.
     
  6. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    Have you double checked that dynamic resolution is enabled on all needed settings ?
    HDRP Settings :
    upload_2021-7-6_10-4-38.png
    Camera Settings :
    upload_2021-7-6_10-5-13.png
     
  7. gorbit99

    gorbit99

    Joined:
    Jul 14, 2015
    Posts:
    1,350
    Yes, I followed the unity guide.
     
  8. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    I can confirm that DLSS is working very well (I have 2080 as well).

    You will not see much FPS boost if you are CPU bound though.

    A good way to test is to change resolution and see if FPS changes.
    But yes, DLSS is working good and it is really amazing.
     
  9. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Even in my case I can confirm DLSS is working (I can tell using the new volumetric clouds which don't scale well with DLSS right now and the obvious temporal problems with transparents with no motion vectors) but I don't see an fps boost in most cases and I' sure it's not CPU bound since there are no scripts in the project yet :p.

    And one strange thing I see now is that in a build I don't have any kind of fps boost at all, even in some cases I get more fps in the editor. It's kind of frustrating when you expect you will get better fps in build and you don't get it tbh. Is this common behavior due to some settings? I made sure to have it build as the master build and all the development checkboxes were turned off)
     
  10. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    To be able to have performance boost from DLSS, you need to make sure that your HDRP asset (under rendering section) has a screen percentage lower than 100% set. Either by forcing the percentage or by setting a min and max and letting DLSS find the "Optimal settings". (You can also do this yourself by using this script as an example).

    Otherwise, if you're using DLSS at 100%, you are basically paying the cost of it but with very few added benefits.

    (I'm just saying this because 100% is the default value)

    upload_2021-7-7_17-33-23.png
     
    rbcode and PutridEx like this.
  11. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    I had it at forced 50% though and still didn't see a boost
    And what are the benefits are you mentioning at 100% :)
     
  12. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Hoover tooltip for "Use Optimal Settings" says that when this is on, it will ignore setting for dynamic resolution scale. Do I still have to set min 50 and max 100% ??
     
  13. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Indeed, as stated in the tooltip, the "Use Optimal Settings" will ignore min and max and set what it thinks is best given your output resolution and the mode you selected. But the Force Resolution Percentage will still override the "Use Optimal Settings".
    You can see the input resolution DLSS uses in Window > Analysis > Rendering debugger then under the Rendering tab you have the Nvidia device debug view.

    DLSS at 100% can be considered like an expensive TAA brought to you by Nvidia
     
    olavrv and Ruchir like this.
  14. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    How does DLSS determine the optimal settings? using target FPS or something else? and when that is used what does the quality option really change, it's really vague right now. Us being the developers and not the consumers should know more about these things than the names "Max performance" or "Max quality".
     
  15. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    I found this:

    https://support.benchmarks.ul.com/e...cles/44002137036-how-to-test-dlss-performance
     
  16. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    To begin with change resolution from 4k to 1080p with around 10 mil triangles. If you see any FPS boost when you drop fps, it means you will most likely benefit from DLSS. Otherwise, fps might stay the same and GPU usage just dropping. Remember that DLSS and every other upsampling tech is based on using lower resolution and using the tech to upsample, so if your game doesn't benefit from lower resolution, you are just adding wasted CPU/GPU overhead.

    The benefits of using DLSS at 100% is actually quite huge. One, it fixes many transparency/alpha related artifacts. These artifacts will persist even in 4K, so getting rid of them via DLSS is quite huge. Also, if you replace the DLSS file (the included one with Unity is 2.1) with the latest 2.2, then thin lines and small moving particles will pretty much have zero ghosting. Think of Super sampled TAA with zero ghosting and alpha correction, which btw doesn't exist :) other than DLSS. So, the benefit is superior rendering.

    I've also noticed that at Quality settings, vertex animated objects without motion vectors, will be super crisp. I am not sure why as DLSS uses motion vectors, and my vertex animated grass don't have motion vectors. But, as long as the object is big enough on screen (in my grass's case, up to 100m?) it is super crisp with no ghosting. For grass in distance, 150m+, it tends to create some ghosting, my guess is that AI fails to recreate missing data as the pixel data is small (object is further from camera hence much smaller) but still much much crispier than TAA at close up with motion vectors.

    So, in my opinion, DLSS, is a god-send to Unity as Unity is traditionally weak at rendering, rendering performance and motions vectors. And, it turns out DLSS helps Unity in all three aspects. I believe in an engine like UE4 or UE5, the quality increase may not be noticeable as UE has good enough TAA/Alpha/Motion Vector implementation, but in Unity, it just improves every aspect of rendering.

    Just try the latest 2.2 shipped with Rainbow Six Siege and you will know what I am talking about. I am currently working on large open world FPS, and the performance and quality increase with DLSS is just amazing.
     
    Last edited: Jul 10, 2021
    Deleted User and Ruchir like this.
  17. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I also do NOT notice any positive changes with DLSS enabled:
    Download latest StudioDrivers, enabled DLSS in HDRP-Asset, also in Camera.
    Trial & Erroring around with:
    - Use Optimal Settings
    - Dynamic resolution type ("Hardware" drops framerate from 90 to down to 8)
    - Min screen percentage
    - Max screen percentage

    Besides that "Max Screen percentage" crops the camera nothing noticable happens, framerate is unchanged compared to DLSS disabled.
    Please provide more detailed information about the mentioned parameters and their correlation, the docs are almost empty here.

    Please see attached screenshot where you can see all settings (Camera, HDRP asset, rendering debugger).

    Do we additionally have to to deal with the Dynamic Resolution / Upscale filter?
     

    Attached Files:

    • DLSS.jpg
      DLSS.jpg
      File size:
      740.7 KB
      Views:
      322
    Last edited: Sep 27, 2021
  18. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    The documentation sort of feel like marketing material for DLSS (Basically saying DLSS automagically does everything) instead of talking in absolute terms what all the parameters do :(

    I really have no idea how and why it scale the resolution between min and max screen percentage, only way I get it to work is to force a screen percentage.
    How does the algorithm choose the resolution, sharpness (optimal setting) and other factors?
     
    Last edited: Sep 27, 2021
  19. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    custom post process currentl doesn't work with DLSS, this is why your frame is cropped. We are using DLSS and experience major performance boost with extremely high quality antialiasing (best ever!)
     
  20. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    @olavrv
    Thanks, disabling "Use Custom Quality" toggle on the camera seems to have solved the cropping.
    (Strangely, I can now re-enable the toggle and still the cropping is gone.)
    I can now get double framerate at 4k (30 > 70 fps).
    At FullHD there´s no benefit, maybe because the framerate is already above 90 fps.

    Two little issues left:
    1. Lensflare (SRP) remains placed at quarter resolution position when DLSS enabled, see attachment.
    2. Enabling/Disabling DLSS at runtime doesn´t work here:
    Code (CSharp):
    1.     public void SetDLSS(bool enable)
    2.     {
    3.         Camera.main.allowDynamicResolution = enable; // No effect
    4.     }
    5.  
     

    Attached Files:

    Last edited: Sep 29, 2021
  21. MisfitVillage

    MisfitVillage

    Joined:
    Jan 3, 2017
    Posts:
    14
    It's not non-functional. It's backwards. The Ultra Perfomance setting which should be the one with the lowest internal resolution, is actually native resolution. The rest work as intended. Can we get someone from Unity to fix this?
     

    Attached Files:

  22. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Managed to repro it, logged something.
    We'll look into it right away.
    Thanks for the info !
     
    olavrv likes this.
  23. andylewisart

    andylewisart

    Joined:
    Nov 4, 2013
    Posts:
    19
    I'm also experiencing basically no effect on frame rates with DLSS on. I can force the scaling down to 10% and as expected, the image quality degrades immensely, but there's no change in FPS within editor or build. I verified that the resolution is being reduced via DLSS in the Rendering Debugger. Everything seems to be working except for the FPS boost. I'm doing these tests both on my own project and also in a new project within the HDRP demo scene. I tried everyone's advice above several times over with no luck. I'm running a 3090 and a 5950x, so there shouldn't be any bottlenecks.
     
  24. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Maybe your bottleneck is the CPU and not the GPU? In the profiler, activate the GPU module.
    How long does 'playerloop' take in the CPU compared to the GPU? Remember if you're GPU bottlenecked, CPU will wait for the GPU so don't look at the "CPU" time, look at player loop and see if it's waiting on the GPU or not


    Better yet, compare with DLSS at 50% to without at native res, and see if GPU cost is reduced or not
     
  25. andylewisart

    andylewisart

    Joined:
    Nov 4, 2013
    Posts:
    19
    Seems to be working now - I did a lot of stuff and can't pinpoint exactly what got it working, but I'm pretty sure it was just upgrading to the latest studio driver. The one I was using was only a few weeks old, which is strange.
     
  26. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    I Upgraded from 2021.2.7 to 2021.2.11:
    In Editor everything is fine but the executable shows a blown up quarter of the rendered frame!
     
  27. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    yes, this is the reported issue :)
     
  28. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Copy pasta from the other thread.

    Sorry guys, the landing process engine side is not super fast.
    The batch landed as 2021.2.12f1.4373, so it's expected that still not fixed on 11f1 :|
     
    olavrv likes this.
  29. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Ok, so I wait for 2021.2.12
     
    olavrv likes this.
  30. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    I tried DLSS today, Ive been dreaming about it for years and watching everything I can on it. But for me all it did was make my game very jittery (literally whole game is moving around like a few pixels with no lerp, maybe due to my camera idle movement), same performance. And messing the settings all it every did was make a small jittery image in the corner, I could never get that image fullscreen, maybe without the jitter that could look good fullscreen hard to say.. I guess I convinced myself this was more magical than it really is.
     
  31. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Tried this again.. DLSS still does nothing for me performance-wise, now it causes an unnacceptable ghosting effect and removes some of the glow (no jitter anymore though) - It seems to apply a AA which removes some jagged edges. I wish I could say it helps my fps but it doesnt. CPU and GPU bound has always kind of confused me, in this case if I resize the unity game window to be tiny, the frame rate is about the same, does that mean its cpu bound not gpu bound? cpu main is taking around 60ms, rendering about 40ms but profiler shows that 27% of game is going to "render pipeline manager" which I assume is gpu related mostly. So all very confusing, not sure what the "studio drivers" are, would you need to make sure your players have special drivers too if you use these?
     
  32. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Wow, so I upgraded to unity 2022.1.22f, works a lot better, results not perfect and performance gains not apparent really but I can see it working quite well. It can even construct a frame from using just 1% sized version of original. I guess sooner or later this tech will be perfect, since my render thread ms is the same even using 1% I assume graphics are not holding me back. I think its actually all the batches, 12,000 right now in my current position! Still very cool to have DLSS in my hands working nice. The thing about unity is even with a blank menu scene I never get over 150fps, so to maintain even over 40fps is a miracle, I wonder why its not higher considering I see demos showing 150fps etc. This is all in the editor of course.