Is there a way to render part of a scene instead of the whole thing ?

HLEET_3DHLEET_3D Posts: 172
edited January 2022 in Daz Studio Discussion

Hi there, 

I'm new to daz3D studio.
I have an 3070 rtx 8GB VRAM graphic card.

The problem is that it often failover to CPU rendering because of lack of video card memory availability.

I tried the plugin scene optimizer, it works but not always :/
For example, my last render it didn't fit at all in my 8GB card.
Fun fact is that it renders fine with cuda on preview but when I do a render my card memory's running out.
And when I stop the render, it stays with the CPU render in the preview (why ?).
See the picture attached : the render in preview is clean as it is generated by the graphic card and then when I click render it fails over to CPU rendering. (I hid the popup window of the render in the screenshot. CPU rendering is way too slow)

So I was wondering maybe there is some kind of way to "pre-bake" (I hope it is the good term/word) some part of the scene and then be able to alleviate the full render later ?

I could eventually export by hiding stuff and do some photoshop like afterwork but I won't get the transparency of some stuff like behind curtain for example.

Thank you in advance for your advices.

Note : Yes I know, 8GB of vram card is a poor choice for messing with 3D softwares ... I didn't know it before and blame nvidia for this poor choice too lol.

2022-01-09 10_49_06-DAZ Studio 4.16 Pro - hleet_3D_0020.duf.png
2237 x 1310 - 4M
Post edited by HLEET_3D on

Comments

  • GordigGordig Posts: 10,053

    If you hide the figure (CTRL+click on the eye icon in the scene pane so it hides all child items), can you render the rest of the scene on your GPU?

    HLEET_3D said:

    Note : Yes I know, 8GB of vram card is a poor choice for messing with 3D softwares ... I didn't know it before and blame nvidia for this poor choice too lol.

    I know you're joking, but Nvidia doesn't make GPUs exclusively, or even primarily, for working in 3D. 

  • PerttiAPerttiA Posts: 10,024

    Getting stuff to fit VRAM on the GPU

    Reduce SubD on the figures, full body images don't need even SubD 3
    Strand hair, grass and leaves can easily use more VRAM that's available

    An 8GB RTX card, running Windows 10, has about 4.2GiB's available for textures and geometry (as reported by DS log), geometry is usually not the problem.

  • cgidesigncgidesign Posts: 442
    edited January 2022

    One hack could be to use an agressive setting for iray's build in image compression.

    It is in the render settings.

    Meaning:

    Medium Threshold: Any texture with a resolution below this or equal to this value will not get compressed
    Inbetween Medium and High Threshold: Any Texture with a resolution in this range will get medium compression
    High Threshold: Any texture with equal or greater resolution will get maximum compression

    If you set e.g. Medium to 128 and High to 256 you tell iray to use maximum compression on all textures (most textures are at least 512x512). This might let you render scenes which would not fit into vram with less agressive compression but it might reduce image quality.

    Side note: I agree, Nvidia should have put at least 12 GB min. into the 3070, 3080 etc.

    compression.png
    492 x 313 - 50K
    Post edited by cgidesign on
  • HLEET_3DHLEET_3D Posts: 172

    Hello

    @cgidesign
    @PerttiA

    I tried both of your advices : 
    - switched my nvidia iray advanced parameters to : 128 (medium) / 256 (high Threeshold)
    - reduced the subd of the figure (that was at 3 by default) -> I put to 0

    Trying a render : still going back to CPU instead of GPU.

    @Gordig :
    I kept the new settings above from cgidesign and PerttiA.
    And I tried your advice to turn-off the figure visibility.
    => Yes, now it fits my card memory ! 
    Okay, now ... how can I blend everything out ? 
    Should I export only the figure now and then do some photoshop afterwork to blend everything together ? What about the shaders on the figure if I switch everythingelse on my scene visibility off ? 

    Thank you again for all your help guys

    hleet_3D_0020_test.jpg
    2000 x 1125 - 3M
  • cgidesigncgidesign Posts: 442
    edited January 2022

    I fear you won't have luck with rendering only parts and compositing everything together. I would take a lot of masking etc. and not look good in the end.

    One more idea that might help.

    Check the shaders of the figure. Depending on the skin set used, it might be that a lot of textures for special effects are used. Those might help in creating e.g. more realism but they cosume precious vram.

    Example:
    Maybe Top Coat Wheight is active and uses a texture.
    Another one could be Normal Map.

    A distant shot like yours might work without those. So, if you remove the Normal map and the Top Coat Weight map you save some vram. Same for Hair. If it uses e.g. a texture in Base Bump you can remove that as well and see how the render looks like.

    Another one is Displacement. I assume it is used on the water (if that is not a background picture). There you would need to keep it (without it, the water might become just a flat plane), but other surfaces might work without displacement.

    Same goes for all the other objects in the scene.

    But, all this might make your render look less good.

    Regarding the SubDivision Level - if possible keep it at least at 1 because 0 will disable subdivision completely which gives a blocky appearance.

     

    Post edited by cgidesign on
  • cgidesigncgidesign Posts: 442

    One more in case you are not aware of it:

    DAZ Studio does not free all vram once it rendered an image or the iray preview was used. It also keeps vram when you leave a render window open. To get as much vram as possible close DS restart it and hit render without using the iray preview. It might also help to set the viewport to smooth shaded instead of texture shaded.

    sub-d.png
    858 x 446 - 120K
  • HLEET_3DHLEET_3D Posts: 172
    edited January 2022

    @cgidesign thanks for the tips.
    I closed daz3D software and waited a little bit until the vram was free again.
    I reloaded the scene with the "wire bounding box" just to be shure that it won't eat any more vram that the preview should.
    When the scene loaded, it already eats up 1GB of vram (!!!). Maybe if there was some kind of external program to render without opening the scene ? 

    When I launched the render, after a little while, it seems that all my vram is taken in one shot ! overload and then failback to CPU.
    Here is a snippet down below of my log.
    I use that background : https://www.daz3d.com/dgv-palm-resort
    The water and plants might be the culprit ... or not, I don't know.

    Note : I tried some more of your parameters advices, as I'm still new in this field (3D), I will look-up on google what each thing does. Thank you.

    My log (it seems that I'm 1GB short of vram .... T.T) : 

    2022-01-09 22:18:12.835 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : Available GPU memory has increased since out-of-memory failure. Re-enabling CUDA device 0 (NVIDIA GeForce RTX 3070)
    2022-01-09 22:18:12.848 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : Initializing OptiX for CUDA device 0
    2022-01-09 22:18:12.929 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : Rendering with 1 device(s):
    2022-01-09 22:18:12.929 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : CUDA device 0 (NVIDIA GeForce RTX 3070)
    2022-01-09 22:18:12.929 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : Rendering...
    2022-01-09 22:18:12.929 Iray [INFO] - IRAY:RENDER ::   1.10  IRAY   rend progr: CUDA device 0 (NVIDIA GeForce RTX 3070): Processing scene...
    2022-01-09 22:18:13.401 Iray [VERBOSE] - IRAY:RENDER ::   1.13  IRAY   rend stat : Geometry memory consumption: 2.571 GiB (device 0), 0.000 B (host)
    2022-01-09 22:18:14.008 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(359): Iray [ERROR] - IRAY:RENDER ::   1.13  IRAY   rend error: Unable to allocate 5.073 GiB from 4.153 GiB of available device memory
    2022-01-09 22:18:14.008 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(359): Iray [ERROR] - IRAY:RENDER ::   1.10  IRAY   rend error: CUDA device 0 (NVIDIA GeForce RTX 3070): Scene setup failed
    2022-01-09 22:18:14.011 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(359): Iray [ERROR] - IRAY:RENDER ::   1.10  IRAY   rend error: CUDA device 0 (NVIDIA GeForce RTX 3070): Device failed while rendering
    2022-01-09 22:18:14.011 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(359): Iray [WARNING] - IRAY:RENDER ::   1.10  IRAY   rend warn : CUDA device 0 (NVIDIA GeForce RTX 3070) ran out of memory and is temporarily unavailable for rendering.
    2022-01-09 22:18:14.011 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(359): Iray [WARNING] - IRAY:RENDER ::   1.10  IRAY   rend warn : All available GPUs failed.
    2022-01-09 22:18:14.013 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(359): Iray [WARNING] - IRAY:RENDER ::   1.10  IRAY   rend warn : No devices activated. Enabling CPU fallback.
    2022-01-09 22:18:14.013 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(359): Iray [ERROR] - IRAY:RENDER ::   1.10  IRAY   rend error: All workers failed: aborting render
    2022-01-09 22:18:14.013 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : CPU: using 24 cores for rendering
    2022-01-09 22:18:14.013 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : Rendering with 1 device(s):
    2022-01-09 22:18:14.015 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : CPU
    2022-01-09 22:18:14.015 Iray [INFO] - IRAY:RENDER ::   1.0   IRAY   rend info : Rendering...
    2022-01-09 22:18:14.015 Iray [INFO] - IRAY:RENDER ::   1.10  IRAY   rend progr: CPU: Processing scene...

    Post edited by HLEET_3D on
  • cgidesigncgidesign Posts: 442
    edited January 2022

    Yes, about 1 GIG is missing.

    The set you are using has a lot of objects, but only a few of them are visible in your render. Can you hide everything that is not in camera view and see if that helps (disable eye icon in the scene tree - if done, DS will not load the object and its textures into vram). And, the description mentions Normal Maps. In my experence those can comsume quite a bit of vram if made correctly. So, disabling them in the shaders might help.

    surface.png
    1092 x 967 - 291K
    Post edited by cgidesign on
  • HLEET_3DHLEET_3D Posts: 172
    edited January 2022

    Yes I have already hide all the props that wasn't into the field of render before asking on the forum.
    I have reduced also beforehand the texture size with scene optimizer plugin. 

    I continued reducing all the bump and normal map on the scene (even tweaked a little bit the water attribute) ; figure and props. I messed the subd down that was available for some part of the props and figure.

    I followed your screenshot and changed the map for the trunk of the trees that wasn't visible on the picture anyway.

    But I had to reset the normal map to 1.0 for the hair, because at 0 it looked like thick falling rubber from the tip of her head lol.

    With all theses sacrifices, it finally worked to fit into my 8GB vram ! yeah ! 

    10 min to render (what could have been easily 2 hours with CPU).
    That's a pity, the 3070 rtx isn't a bad card but it is so limited because of the small video ram attribute.

    It would be cool if daz3D studio could make a way to chop in chunks the rendering, like so it would only render part of the scene and then at the end of the render, patch the whole thing together !

    Thanks again, I learned a lot today :)

    Post edited by HLEET_3D on
  • PerttiAPerttiA Posts: 10,024

    "Geometry memory consumption: 2.571 GiB"

    That is your problem, you should get that at least one GiB lower

  • cgidesigncgidesign Posts: 442
    edited January 2022

    Great that it worked in the end.

    The main issue is not the Nvidia card but that Microsoft reserves physical vram. The more GB the card has the more Windows takes for itself (figures I found online range from 10% to 25% of total vram). It is part of the WDDM (Windows Display Driver Model 2.0) and nothing can be done to solve it. Even Otoy (those who make the Octane renderer) asked Microsoft to solve this but MS does not care. There are also rants from AI and KI science teams who scream about their neural networks crashing because Windows helds vram hostage for nothing. Most of the information I found, says it is less a problem with Wndows 7.

    The only solution in Wndows 10 would be to use two GPUs. One for the displays another one for compute (like iray rendering). The compute card must be a Quadro, Tesla or Titan model (edit: these product names refer to the previous generation models) and be set to TCC mode instead of WDDM. In that case most of the card's vram can be used for compute.

    Post edited by cgidesign on
Sign In or Register to comment.