Iray Viewport and GPU Memory Issue

ChasmalimChasmalim Posts: 15
edited October 2022 in Daz Studio Discussion

I'm having a pretty annoying issue with Daz. If I switch my viewport to Iray to check the lighting of my scene, the gpu memory is allocated or whatever. But when I switch back to texture shaded the allocated memory isn't freed up. When I try to render an image, it get's kicked to CPU because none of the memory on my GPU is available. Is there a way to force the GPU to release the memory. For additional information, I'm using a GTX 1070 and a GTX 1080 TI.

Post edited by Chasmalim on

Comments

  • how much vram on them? 
    As I recall I had to do the save and restart routinue more when I was using my 980ti 6g then now with my titanx 12g.
    One thing I have noticed but not actually timed... is that doing test renders as I work on a scene ... later ones seem to go faster possibly because some of the data is already on the card?
    But I don't do viewport renders... and my test renders are often only 1kx1k ... 
    But is it possible that a viewport render and a render render ... don't share the same space but each trys to use the space on the card? 

  • ChasmalimChasmalim Posts: 15
    edited October 2022

    alan bard newcomer said:

    how much vram on them? 
    As I recall I had to do the save and restart routinue more when I was using my 980ti 6g then now with my titanx 12g.
    One thing I have noticed but not actually timed... is that doing test renders as I work on a scene ... later ones seem to go faster possibly because some of the data is already on the card?
    But I don't do viewport renders... and my test renders are often only 1kx1k ... 
    But is it possible that a viewport render and a render render ... don't share the same space but each trys to use the space on the card? 

     

    The GTX 1070 is a 8gb card and the 1080 TI is a 11gb card. I'll try to use a quick render to see if that makes a difference. Cancelling an actual render does seem to free up the memory for a second attempt.

    Post edited by Richard Haseltine on
  • One thing to consider is if you're trying to use both gpus for rendering, is that the gpu with the lowest amount of vram is the deciding factor on whether the render will drop to cpu or not.

    In this case, the 1070's 8GB. Exceeding the 8GB will cause iray to drop to cpu.

    If you're using it for monitor output, it'll be even less.

     

    Something else to be aware of, preview mode and render mode use different math, with certain things being ignored,  so preview mode generally uses less vram.

    It can be negligable to significant, depending on your scene and render settings.

     

    The general solution to this issue, is to close DS and reload the scene.

    If it's still exceeding vram, there's either too much data for the gpu, or a problem with the scene, generally a shader conflict or miscalculation somewhere.

    Try reducing the 'stuff' in the scene. Remove anything that's not going to be necessary for the final render.

    If it's still going over, then it get's complicated. You may need to go so far as rebuilding the scene in its entirety. One piece at a time. Or reducing material complexity(remove or shrink maps), reducing geometry, change render settings, etc.

     

    Let me say though, i've never had this 'memory leak' issue.

    I mostly chalk it up to up to using 'professional' gpus(tesla/quadro) and not having them as my monitor connected gpu, if being used for rendering.

    In most benchmarking i do, the difference between clean load>render and render>close render>render again, is non-existent to 'margin of error'. As long as there are no major changes to the scene, or render settings.

     

    As a for instance, just loading a G8F, naked, all default render settings(sans hdri) at 1kx1k, with camera set to 'front'(cube control, not isometric,6.11,134.32,521.41,0,0,0), has a render vram utilization of 1596MB.

    Close the render and monitoring software(SMI) reports vram usage as 1249MB.

    Render it again, 1596MB, close, 1249MB.

    Preview mode, 1527MB when active, and 1248MB when going back to texture shaded mode.

     

    Even if i render a scene that exceeds vram and drops to cpu, then switch to the previous benchmark scene, without closing DS, the vram utilization doesn't change for that scene. It's till 1596MB and 1249MB, respectively.

    This is even with the reported vram showing 349MB, after closing the render that exceeded vram.

     

    In answer to Alan's questions.

    alan bard newcomer said:

    One thing I have noticed but not actually timed... is that doing test renders as I work on a scene ... later ones seem to go faster possibly because some of the data is already on the card?
     

    Unless you have a previous render pop-out open, nothing is retained in memory, and the speed difference is due to something you did in the scene, or with render settings.

    To test this, do a render, close the pop out, don't change anything in the scene and render again, then compare the times listed in the log file.

    You may get some variation, but that's going to be 'margin of error', unless there's a problem.

     

    alan bard newcomer said:


    But is it possible that a viewport render and a render render ... don't share the same space but each trys to use the space on the card? 

    no.

    If the iray preview mode isn't active, there's nothing retained in vram, even if there's reported usage.

    If iray preview mode is active, then most of the data is loaded into vram, and then is 'shared' with the 'render render'. The same as having a render pop-out left open and starting another render of the same scene.

    Going back to my benchmark scene from above, the vram utilization, when iray preview mode is active and a render is started is 1660MB.

    This is an increase of 133MB over the preview mode alone at 1527MB.

    Starting then stopping a render, but leaving the window open shows a similar jump.

    1599MB for the for the first render, the second, 1732MB.

    An increase of....133MB.

     

    Lastly, there can be variation in vram usage between when the render starts and the image appears in the popout.

    In the case of my test scene above, the difference is 1576MB and 1599MB, or 23MB.

    If i stop the render, before the image appears, the 1576MB is reported.

    Start it up again, and it jumps to 1599MB as soon as the image appears.

     

    Did i mention just how insanely complex this subject can get?

     

     

     

     

     

  • PerttiAPerttiA Posts: 9,456

    @DrunkMonkeyProductions, are the 1576MB and 1599MB's total VRAM usage numbers, or the amounts on top of the base load by Windows, DS and the scene?

  • DrunkMonkeyProductions said:

    One thing to consider is if you're trying to use both gpus for rendering, is that the gpu with the lowest amount of vram is the deciding factor on whether the render will drop to cpu or not.

    In this case, the 1070's 8GB. Exceeding the 8GB will cause iray to drop to cpu.

    If you're using it for monitor output, it'll be even less.

    No, each GPU is assessed separately and lower capacity device may be dropped without interferring with the higher capacity device.

    Something else to be aware of, preview mode and render mode use different math, with certain things being ignored,  so preview mode generally uses less vram.

    It can be negligable to significant, depending on your scene and render settings.

     

    The general solution to this issue, is to close DS and reload the scene.

    If it's still exceeding vram, there's either too much data for the gpu, or a problem with the scene, generally a shader conflict or miscalculation somewhere.

    Try reducing the 'stuff' in the scene. Remove anything that's not going to be necessary for the final render.

    If it's still going over, then it get's complicated. You may need to go so far as rebuilding the scene in its entirety. One piece at a time. Or reducing material complexity(remove or shrink maps), reducing geometry, change render settings, etc.

     

    Let me say though, i've never had this 'memory leak' issue.

    I mostly chalk it up to up to using 'professional' gpus(tesla/quadro) and not having them as my monitor connected gpu, if being used for rendering.

    In most benchmarking i do, the difference between clean load>render and render>close render>render again, is non-existent to 'margin of error'. As long as there are no major changes to the scene, or render settings.

     

    As a for instance, just loading a G8F, naked, all default render settings(sans hdri) at 1kx1k, with camera set to 'front'(cube control, not isometric,6.11,134.32,521.41,0,0,0), has a render vram utilization of 1596MB.

    Close the render and monitoring software(SMI) reports vram usage as 1249MB.

    Render it again, 1596MB, close, 1249MB.

    Preview mode, 1527MB when active, and 1248MB when going back to texture shaded mode.

     

    Even if i render a scene that exceeds vram and drops to cpu, then switch to the previous benchmark scene, without closing DS, the vram utilization doesn't change for that scene. It's till 1596MB and 1249MB, respectively.

    This is even with the reported vram showing 349MB, after closing the render that exceeded vram.

     

    In answer to Alan's questions.

    alan bard newcomer said:

    One thing I have noticed but not actually timed... is that doing test renders as I work on a scene ... later ones seem to go faster possibly because some of the data is already on the card?
     

    Unless you have a previous render pop-out open, nothing is retained in memory, and the speed difference is due to something you did in the scene, or with render settings.

    To test this, do a render, close the pop out, don't change anything in the scene and render again, then compare the times listed in the log file.

    You may get some variation, but that's going to be 'margin of error', unless there's a problem.

     

    alan bard newcomer said:


    But is it possible that a viewport render and a render render ... don't share the same space but each trys to use the space on the card? 

    no.

    If the iray preview mode isn't active, there's nothing retained in vram, even if there's reported usage.

    If iray preview mode is active, then most of the data is loaded into vram, and then is 'shared' with the 'render render'. The same as having a render pop-out left open and starting another render of the same scene.

    Going back to my benchmark scene from above, the vram utilization, when iray preview mode is active and a render is started is 1660MB.

    This is an increase of 133MB over the preview mode alone at 1527MB.

    Starting then stopping a render, but leaving the window open shows a similar jump.

    1599MB for the for the first render, the second, 1732MB.

    An increase of....133MB.

     

    Lastly, there can be variation in vram usage between when the render starts and the image appears in the popout.

    In the case of my test scene above, the difference is 1576MB and 1599MB, or 23MB.

    If i stop the render, before the image appears, the 1576MB is reported.

    Start it up again, and it jumps to 1599MB as soon as the image appears.

     

    Did i mention just how insanely complex this subject can get?

     

     

     

     

     

Sign In or Register to comment.