A Noob's Experiment: Reducing Needed VRAM And Render Time

LenioTGLenioTG Posts: 2,118
edited January 2019 in Daz Studio Discussion

Hi everyone! :D I’m just a noob, and I’m going to summarize here some tips I’ve learnt, mostly thanks to this forum, to be able to render with my little 3Gb VRAM (GTX 1060).
The test scene is very simple, I’m even using the auto headlamp (I don’t usually do that), and it contains a room, a dome and a G8F character with makeup, clothes, shoes, a necklace, 2 bracelets and 4 rings.


For each test I’ll render for 2 minutes, and attach the result (when relevant), saying how many iterations my system has achieved. For rendering settings, is everything at default except 1920x1400 resolution, memory optimization and noise filter (not post-denoiser).


•    TEST 1 – The result is horrible, just 29 iterations in 2min. The scene goes over my VRAM: it requires 1,8Gb, plus 0,7Gb for using it to display my OS at 1080p, 150Mb to display the scene in Texture Shaded, and I don’t know about the other 350Mb.
2019-01-18 15:32:15.242 Iray VERBOSE - module:category(IRAY:RENDER):   1.5   IRAY   rend stat : Geometry memory consumption: 53.5922 MiB (device 0), 0 B (host)
2019-01-18 15:32:22.625 Iray VERBOSE - module:category(IRAY:RENDER):   1.5   IRAY   rend stat : Texture memory consumption: 888.049 MiB for 87 bitmaps (device 0)
2019-01-18 15:32:22.625 Iray VERBOSE - module:category(IRAY:RENDER):   1.5   IRAY   rend stat : Lights memory consumption: 379.176 KiB (device 0)
2019-01-18 15:32:22.747 Iray VERBOSE - module:category(IRAY:RENDER):   1.5   IRAY   rend stat : Materials memory consumption: 454.965 KiB (GPU)


•    TEST 2 – I’ve used Scene Optimizer (https://www.daz3d.com/scene-optimizer), a famous utility. With the 1st tool I’ve made a backup, with the 2nd one I’ve reduced by 2x every texture (room, skin, hair, clothes…), and by 4x the small items textures (towels, rings…). It just changed the “Texture Memory Consumption”, that went from 888Mb to 154Mb, and I can’t tell the difference in the picture. 35 iterations this time, but I was able to start from Iray preview. I'll attach the image so that you'll be able to judge by yourself, but to me just the background right item seems affected by this huge texture size reduction, and of course you could restore it.
2019-01-18 16:06:26.644 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Geometry memory consumption: 53.5922 MiB (device 0), 0 B (host)
2019-01-18 16:06:29.079 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Texture memory consumption: 153.508 MiB for 90 bitmaps (device 0)
2019-01-18 16:06:29.079 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Lights memory consumption: 379.176 KiB (device 0)
2019-01-18 16:06:29.220 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Materials memory consumption: 454.965 KiB (GPU)


•    TEST 3 – I’ll start to test Resource Saver Shaders Collection for Iray (https://www.daz3d.com/resource-saver-shaders-collection-for-iray), a more complex tool that I’ve just purchased. Here I’ve just used the “G8 Material Optimizer”. 35 iterations again. Everything was the same, but the textures went down from 154 to 133Mb: it’s reasonable to think that this would have happened even without the first tool, but we wouldn’t have been able to automatically reduce the other textures too. I have to specify that the product page has a nice guide, but I’ve not truly studied it yet, and it’s more thought for big scenes rather than for this simple one.
2019-01-18 16:19:49.450 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Geometry memory consumption: 53.5922 MiB (device 0), 0 B (host)
2019-01-18 16:19:50.605 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Texture memory consumption: 132.508 MiB for 84 bitmaps (device 0)
2019-01-18 16:19:50.605 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Lights memory consumption: 379.176 KiB (device 0)
2019-01-18 16:19:50.745 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Materials memory consumption: 454.965 KiB (GPU)


•    TEST 4 – With the same utility, this time I’ve “removed transmap” from hair, replacing them with the included black hair color. I’ve done the same to the shoes. Then, I’ve used “Remove B – D – N Maps” from the G8F. Still 35 iterations. We’ve just lost 17 other Mb of textures. At least the image quality isn’t affected by this.
2019-01-18 16:30:46.330 Iray VERBOSE - module:category(IRAY:RENDER):   1.11  IRAY   rend stat : Geometry memory consumption: 53.5922 MiB (device 0), 0 B (host)
2019-01-18 16:30:47.405 Iray VERBOSE - module:category(IRAY:RENDER):   1.11  IRAY   rend stat : Texture memory consumption: 115.258 MiB for 79 bitmaps (device 0)
2019-01-18 16:30:47.405 Iray VERBOSE - module:category(IRAY:RENDER):   1.11  IRAY   rend stat : Lights memory consumption: 379.176 KiB (device 0)
2019-01-18 16:30:47.484 Iray VERBOSE - module:category(IRAY:RENDER):   1.11  IRAY   rend stat : Materials memory consumption: 454.965 KiB (GPU)


•    TEST 5 – This time I’ve used the utilities “Low Resolution” and “SubD Level 0”. Still 35 iterations. We’ve reduced the Geometry memory consumption this time, by 14Mb.
2019-01-18 16:37:31.606 Iray VERBOSE - module:category(IRAY:RENDER):   1.2   IRAY   rend stat : Geometry memory consumption: 40.315 MiB (device 0), 0 B (host)
2019-01-18 16:37:32.575 Iray VERBOSE - module:category(IRAY:RENDER):   1.2   IRAY   rend stat : Texture memory consumption: 115.258 MiB for 79 bitmaps (device 0)
2019-01-18 16:37:32.575 Iray VERBOSE - module:category(IRAY:RENDER):   1.2   IRAY   rend stat : Lights memory consumption: 379.176 KiB (device 0)
2019-01-18 16:37:32.653 Iray VERBOSE - module:category(IRAY:RENDER):   1.2   IRAY   rend stat : Materials memory consumption: 454.965 KiB (GPU)


•    TEST 6 – I’ve used “Remove glossy” and “top coat maps” on G8F, and remove bump, displacement, normal and top coat maps on everything in the scene. Absolutely nothing changed, so I understood I’ve done this wrong: it works going on the “Surface” tab and selecting each surface. It’s a long work but it may be worth it if you’re going to use the asset many times, otherwise it would just be better to render it just like it is maybe. So, on the hair you can definitely tell the difference, but you can’t on the other items. I’ve also hidden the item that weren’t on display. We did it: 48 iterations! We’ve reduced geometry, texture and materials, going to 912Mb, but maybe here the main factor was to hide the item not on display. D'oh, I've lost the end result, but it was close to 35 iterations anyway, and the hair had no translucensy.
2019-01-18 16:55:03.966 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Geometry memory consumption: 38.6689 MiB (device 0), 0 B (host)
2019-01-18 16:55:04.732 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Texture memory consumption: 93.115 MiB for 70 bitmaps (device 0)
2019-01-18 16:55:04.732 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Lights memory consumption: 379.176 KiB (device 0)
2019-01-18 16:55:04.810 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Materials memory consumption: 401.277 KiB (GPU)


•    TEST 7 – Okay, after all these tests I’m gonna do what I normally do: render separately the background, blur it in Photoshop (with some image editing), and adding the character. The problem here is that you can tell the lights are different, and if there are mirrors the characters will disappear, but the quality overall is much higher according to me. I’ve kept everything from TEST 6, except the hair, that I’ve reapplied, reduced the texture by 2x, and applied the 2nd utility shader on. 196 iterations, but in 1 minute this time (I want the overall time to always be 2 minutes).
Always TEST 7, but the background this time. Always 35 iterations, but in just 1 minute: blurred out it will seem even less “noisier”.


BOTTOM LINE: delete everything you don’t see in the scene, Scene Optimizer is very fast and easy to use and it really could your scene fit in your VRAM, the other utility is very powerful too, but I still don’t understand how to fully use it. The best tip, after all, is to optimize everything, then render the characters and the room separately. I hope I haven't just lost 2 hours of my life! ^^


Here I’ll attach a Test 1 vs 7 comparison: both images were rendered in 2 minutes on the same system, but I guess you’ll judge the difference between them. I hope you'll forgive me if the camera angle is slightly different.
I hope this is going to help someone, but please, if you know something more, share it with me, I need to improve! :D

 

EDIT: I'm doing one more test, rendering the same character with just hair before and after using these two tools.

  • Render #1: it occupies 873Mb. In 2 minutes I've reached 61 iterations.

2019-01-18 19:00:59.548 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Geometry memory consumption: 21.235 MiB (device 0), 0 B (host)
2019-01-18 19:00:59.968 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Texture memory consumption: 767.75 MiB for 48 bitmaps (device 0)
2019-01-18 19:00:59.983 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Lights memory consumption: 196 B (device 0)
2019-01-18 19:01:00.110 Iray VERBOSE - module:category(IRAY:RENDER):   1.4   IRAY   rend stat : Materials memory consumption: 84.3711 KiB (GPU)

  • Render #2: I've optimized the G8F and hair maps with RSSCI, without being too aggressive. The hair colour changed a bit, of course, because I've used the included shader. I've reached 103 iterations, almost 2x times than before. As you can see, there's not that much difference in the character quality. It occupies 283Mb, losing 80% of texture size and leaving the rest unaltered.

2019-01-18 19:10:50.773 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Geometry memory consumption: 21.235 MiB (device 0), 0 B (host)
2019-01-18 19:10:51.198 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Texture memory consumption: 177.25 MiB for 24 bitmaps (device 0)
2019-01-18 19:10:51.198 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Lights memory consumption: 196 B (device 0)
2019-01-18 19:10:51.198 Iray VERBOSE - module:category(IRAY:RENDER):   1.8   IRAY   rend stat : Materials memory consumption: 84.3711 KiB (GPU)

  • Render #3: I've reduced the G8F and hair texture by 2x with Scene Optimizer. I've also noticed a reduction in scene loading time. 106 iterations. As expected, we've further reduced by 50% the texture size: now the scene occupies 180Mb.

2019-01-18 19:22:09.267 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Geometry memory consumption: 21.235 MiB (device 0), 0 B (host)
2019-01-18 19:22:09.676 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Texture memory consumption: 74.5001 MiB for 24 bitmaps (device 0)
2019-01-18 19:22:09.676 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Lights memory consumption: 196 B (device 0)
2019-01-18 19:22:09.676 Iray VERBOSE - module:category(IRAY:RENDER):   1.6   IRAY   rend stat : Materials memory consumption: 84.3711 KiB (GPU)

I'll attach a comparison between Render #1 and #3.

BOTTOM LINE #2: We've got 74% more iterations in the same time, reducing the VRAM using by almost 5 times, without a noticeable quality loss, even with the face so close to the camera!

Test 1.png
1920 x 1440 - 5M
Test 2.png
1920 x 1440 - 5M
Test 1 vs 7.jpg
1920 x 1440 - 2M
Render 1 vs Render 3.jpg
1684 x 1440 - 2M
Post edited by LenioTG on

Comments

  • MattymanxMattymanx Posts: 6,949

    Hey kameneko,

    Glad you like the tools.  I would like to make a couple suggestions, use the Resource Saver Shaders Collection first on everything you want to use it on, and then use the Scene Optimizer.  Also remove everything that will not be seen in the image.  The main reason being that the Scene Optimizer will only resize what is there.  So if you reduce the number of textures in the scene first before the SO is run, it will have less to do and work faster.  Also, if you use the RSSC first, you can judge for yourself if you can use the original skin textures to maintain details without going over your vram.

  • LenioTGLenioTG Posts: 2,118
    edited January 2019
    Mattymanx said:

    Hey kameneko,

    Glad you like the tools.  I would like to make a couple suggestions, use the Resource Saver Shaders Collection first on everything you want to use it on, and then use the Scene Optimizer.  Also remove everything that will not be seen in the image.  The main reason being that the Scene Optimizer will only resize what is there.  So if you reduce the number of textures in the scene first before the SO is run, it will have less to do and work faster.  Also, if you use the RSSC first, you can judge for yourself if you can use the original skin textures to maintain details without going over your vram.

    Thank you for your answer Mattymanx!! :D

    I can tell that you're a master in such things, I'll apply your suggestion!

    You're talking about the "Remove Maps" utilities, right?

    I've done another test (I've edited the first post), following your suggestion, and I managed to reduce the texture size even further!

    Post edited by LenioTG on
  • MattymanxMattymanx Posts: 6,949
    edited January 2019

    Yup, use the different utilities from the RSSC that remove maps (that you want or need to remove) and then run the Scene-Optimizer and it should take less time since there is less for it to work on.

     

    Something you can do for yourself, if you dont already, is after you get a character set up the way you want them, you can save the character as a character preset, save the maps as a material preset (save the material preset before doing the scene optimizer just incase you need the higher res skin maps for a close up scene in the future) and lastly, save the character with their hair as a scene subset.  The Scene Subset is simular to a saved scene in that it will retain the characters shape, materials and anything else in the scene you want including clothes and hair.  But the difference is that when you load a scene subset, it is automatically merged into the excisting scene whereas a saved scene closes out your excisting one, if saved, and replaces everything.  All of my G2F and G3F girls that I keep using are all saved as scene subsets with their makeup, skin and hair already optimized via the RSSC so I can load them up anytime and not have to fiddle with things before they are ready to be rendered.

    Post edited by Mattymanx on
  • LenioTGLenioTG Posts: 2,118
    Mattymanx said:

    Yup, use the different utilities from the RSSC that remove maps (that you want or need to remove) and then run the Scene-Optimizer and it should take less time since there is less for it to work on.

     

    Something you can do for yourself, if you dont already, is after you get a character set up the way you want them, you can save the character as a character preset, save the maps as a material preset (save the material preset before doing the scene optimizer just incase you need the higher res skin maps for a close up scene in the future) and lastly, save the character with their hair as a scene subset.  The Scene Subset is simular to a saved scene in that it will retain the characters shape, materials and anything else in the scene you want including clothes and hair.  But the difference is that when you load a scene subset, it is automatically merged into the excisting scene whereas a saved scene closes out your excisting one, if saved, and replaces everything.  All of my G2F and G3F girls that I keep using are all saved as scene subsets with their makeup, skin and hair already optimized via the RSSC so I can load them up anytime and not have to fiddle with things before they are ready to be rendered.

    Thank you. that's a great suggestion! :D

    I usually save my characters as scenes, then I merge them into the main scene when I need them, and I think that this way they're keeping the alterations!

Sign In or Register to comment.