Renderer keeps switching to CPU

alex86firealex86fire Posts: 1,130

Hey guys,

I have only GPU selected as the render option for both interactive and photoreal.

Unfortunately every few renders, I see that the render slows down and when I check, CPU is used.

If I uncheck and check again GPU, it renders with GPU again but after a few renders, it starts using the CPU again.

Any idea what's happening and how I can fix it?

Post edited by alex86fire on

Comments

  • DS doesn't clear all of VRAM between renders so if you do multiple renders without shutting down DS you eventually run out of VRAM. Also if the preview window isn't closed between renders the VRAM is not cleared at all so the drop to CPU will happen more quickly.

  • alex86firealex86fire Posts: 1,130

    DS doesn't clear all of VRAM between renders so if you do multiple renders without shutting down DS you eventually run out of VRAM. Also if the preview window isn't closed between renders the VRAM is not cleared at all so the drop to CPU will happen more quickly.

    Good to know, thanks, I was also using the NVIDIA Iray photoreal in viewport which I imagine uses also enough of the VRAM.

    I will restart DS from now on when it seems to happen again.

  • IsaacNewtonIsaacNewton Posts: 1,300

    Anyone know when DAZ3d will fix this annoying bug? Memory management is key to any 3d program; this should not be happening at all.

  • Anyone know when DAZ3d will fix this annoying bug? Memory management is key to any 3d program; this should not be happening at all.

    What bug? A lot of this is the way Iray works - it's possible that there might be things Daz could do to free up memory, but even there I suspect it's largely or entirely down to Iray itself.

  • Holding the scene in VRAM as long as the preview window open is not a bug. It allows the render to be resumed.

    Not clearing all the VRAM once a render is truly closed is some siort of memory leak. Some amount of VRAM allocated to the render process(es) is not being freed once the render is otherwise cleared from VRAM. Any of the more obvious causes of memory leaks should have been caught by automated code quality reviews and testing so I'm guessing this is one the sort that sucks to track down and sinceiRay is not a huge profit center for Nvidia they just aren't that concerned,assuming they even know its a problem.

  • IsaacNewtonIsaacNewton Posts: 1,300
    edited February 2020

    I don't know if the bug is due to Iray or DAZ Studio, however, there clearly is a bug. Rendering one or two images works fine but after that even with no previews still open, the following renders are increasingly likely to slow to a crawl. Closing down DAZ Studio and restarting it resets this situation. If the fault is due to Iray, then couldn't DAZ3d add a feature to clear the memory on demand, without having to restart the program?

    Post edited by IsaacNewton on
  • alex86firealex86fire Posts: 1,130

    I don't know if the bug is due to Iray or DAZ Studio, however, there clearly is a bug. Rendering one or two images works fine but after that even with no previews still open, the following renders are increasingly likely to slow to a crawl. Closing down DAZ Studio and restarting it resets this situation. If the fault is due to Iray, then couldn't DAZ3d add a feature to clear the memory on demand, without having to restart the program?

    Yes, it is killing me when I am rendering a scene with multiple high resolution skin maps.

    If I use Nvidia Iray in viewport, every 2 or 3 renders at most revert to CPU. This is cleary very badly optimized as every figure(together with maps) takes about 500 MB so my 8 GB of VRAM should not get filled so quickly.

    My only solution is to switch to cpu/gpu rendering as closing DS every 3 renders is not viable.

  • I don't know if the bug is due to Iray or DAZ Studio, however, there clearly is a bug. Rendering one or two images works fine but after that even with no previews still open, the following renders are increasingly likely to slow to a crawl. Closing down DAZ Studio and restarting it resets this situation. If the fault is due to Iray, then couldn't DAZ3d add a feature to clear the memory on demand, without having to restart the program?

    Yes, it is killing me when I am rendering a scene with multiple high resolution skin maps.

    If I use Nvidia Iray in viewport, every 2 or 3 renders at most revert to CPU. This is cleary very badly optimized as every figure(together with maps) takes about 500 MB so my 8 GB of VRAM should not get filled so quickly.

    My only solution is to switch to cpu/gpu rendering as closing DS every 3 renders is not viable.

    Why not? It takes seconds to close and open DS. 

    Also size on disk or in RAM is not directly comparable to size in VRAM. Further the output image has to be stored in VRAM and the render process itself uses VRAM. I'm not saying there isn't a memory leak, there clearly is, but the work arounds are pretty trivial. I get between 5 and 20 (depending on how many scenes I can setup in a day) rendered over night every day.

  • TheKDTheKD Posts: 2,677

    I don't know how your PC is so zippy with opening and closing, but it takes a few minutes here. Close DS, wait for the process to go away is sometimes up to ten minutes by itself. Loading a scene can take many minutes as well. I don't have a masterrace rich boy PC, but it's not a cheap walmart rig either lol.

  • alex86firealex86fire Posts: 1,130
    TheKD said:

    I don't know how your PC is so zippy with opening and closing, but it takes a few minutes here. Close DS, wait for the process to go away is sometimes up to ten minutes by itself. Loading a scene can take many minutes as well. I don't have a masterrace rich boy PC, but it's not a cheap walmart rig either lol.

    Same. It's not like I close and open an empty scene to be fast. If the scene is complex it sometimes takes a few minutes just to clear it.

    I don't know if the bug is due to Iray or DAZ Studio, however, there clearly is a bug. Rendering one or two images works fine but after that even with no previews still open, the following renders are increasingly likely to slow to a crawl. Closing down DAZ Studio and restarting it resets this situation. If the fault is due to Iray, then couldn't DAZ3d add a feature to clear the memory on demand, without having to restart the program?

    Yes, it is killing me when I am rendering a scene with multiple high resolution skin maps.

    If I use Nvidia Iray in viewport, every 2 or 3 renders at most revert to CPU. This is cleary very badly optimized as every figure(together with maps) takes about 500 MB so my 8 GB of VRAM should not get filled so quickly.

    My only solution is to switch to cpu/gpu rendering as closing DS every 3 renders is not viable.

    Why not? It takes seconds to close and open DS. 

    Also size on disk or in RAM is not directly comparable to size in VRAM. Further the output image has to be stored in VRAM and the render process itself uses VRAM. I'm not saying there isn't a memory leak, there clearly is, but the work arounds are pretty trivial. I get between 5 and 20 (depending on how many scenes I can setup in a day) rendered over night every day.

    I didn't look how much disk space they occupy. I looked at the space they mention when it starts rendering: Geometry consumption, materials consumption. I would expect those numbers to be what they occupy on the VRAM.

    Just rendering images isn't a problem, for me the problem occurs during the day when I try to setup scenes, tones and such when I have to use Nvidia in the viewport.

  • fastbike1fastbike1 Posts: 4,077

    @alex86fire "when I have to use Nvidia in the viewport"

    You never "have" to use Nvidia in the viewport. If you're checking lighting or positioning of props and figures, just do a small render and leave the render window open. If you don't make major changes this will actually speed up your final render somewhat since the bulk of the scene will already be loaded. This is particularly effective when you are only checking genral composition, lighting etc.

  • sajikysajiky Posts: 28

    DS doesn't clear all of VRAM between renders so if you do multiple renders without shutting down DS you eventually run out of VRAM. Also if the preview window isn't closed between renders the VRAM is not cleared at all so the drop to CPU will happen more quickly.

    Good to know, thanks, I was also using the NVIDIA Iray photoreal in viewport which I imagine uses also enough of the VRAM.

    I will restart DS from now on when it seems to happen again.

    Switch the window to smooth shaded, or texture shaded or something before rendering. Anything but iray preview. Leaving the window on iray preview then trying to render about doubled the rendering time for me. Saw something somewhere once that said leaving the iray preview on would speed up renders, they were very wrong. At least in my case.

  • TheKD said:

    I don't know how your PC is so zippy with opening and closing, but it takes a few minutes here. Close DS, wait for the process to go away is sometimes up to ten minutes by itself. Loading a scene can take many minutes as well. I don't have a masterrace rich boy PC, but it's not a cheap walmart rig either lol.

    Same. It's not like I close and open an empty scene to be fast. If the scene is complex it sometimes takes a few minutes just to clear it.

    I don't know if the bug is due to Iray or DAZ Studio, however, there clearly is a bug. Rendering one or two images works fine but after that even with no previews still open, the following renders are increasingly likely to slow to a crawl. Closing down DAZ Studio and restarting it resets this situation. If the fault is due to Iray, then couldn't DAZ3d add a feature to clear the memory on demand, without having to restart the program?

    Yes, it is killing me when I am rendering a scene with multiple high resolution skin maps.

    If I use Nvidia Iray in viewport, every 2 or 3 renders at most revert to CPU. This is cleary very badly optimized as every figure(together with maps) takes about 500 MB so my 8 GB of VRAM should not get filled so quickly.

    My only solution is to switch to cpu/gpu rendering as closing DS every 3 renders is not viable.

    Why not? It takes seconds to close and open DS. 

    Also size on disk or in RAM is not directly comparable to size in VRAM. Further the output image has to be stored in VRAM and the render process itself uses VRAM. I'm not saying there isn't a memory leak, there clearly is, but the work arounds are pretty trivial. I get between 5 and 20 (depending on how many scenes I can setup in a day) rendered over night every day.

    I didn't look how much disk space they occupy. I looked at the space they mention when it starts rendering: Geometry consumption, materials consumption. I would expect those numbers to be what they occupy on the VRAM.

    Just rendering images isn't a problem, for me the problem occurs during the day when I try to setup scenes, tones and such when I have to use Nvidia in the viewport.

    Those numbers mean essentially nothing. You can easily enough use GPU-Z or Afterburner to see how much VRAM is in use during a render and it will not corespond to those numbers.

  • alex86firealex86fire Posts: 1,130
    fastbike1 said:

    @alex86fire "when I have to use Nvidia in the viewport"

    You never "have" to use Nvidia in the viewport. If you're checking lighting or positioning of props and figures, just do a small render and leave the render window open. If you don't make major changes this will actually speed up your final render somewhat since the bulk of the scene will already be loaded. This is particularly effective when you are only checking genral composition, lighting etc.

    I takes some time to start the render each time, preparing the scene.

    If I make changes to the lighting or skin tones or stuff like that, I don't want to start rendering every time I do a small change to see the difference. I believe that is why we have the Iray viewport, so we can see those changes real time.

    Of course it can be done without, but it will increase the time I spend working and it could also disrupt the process.

     

    sajiky said:

    DS doesn't clear all of VRAM between renders so if you do multiple renders without shutting down DS you eventually run out of VRAM. Also if the preview window isn't closed between renders the VRAM is not cleared at all so the drop to CPU will happen more quickly.

    Good to know, thanks, I was also using the NVIDIA Iray photoreal in viewport which I imagine uses also enough of the VRAM.

    I will restart DS from now on when it seems to happen again.

    Switch the window to smooth shaded, or texture shaded or something before rendering. Anything but iray preview. Leaving the window on iray preview then trying to render about doubled the rendering time for me. Saw something somewhere once that said leaving the iray preview on would speed up renders, they were very wrong. At least in my case.

    Sometimes I do that, sometimes I forget. I noticed that if it doesn't switch to CPU rendering, it does not affect my render time.

     

    TheKD said:

    I don't know how your PC is so zippy with opening and closing, but it takes a few minutes here. Close DS, wait for the process to go away is sometimes up to ten minutes by itself. Loading a scene can take many minutes as well. I don't have a masterrace rich boy PC, but it's not a cheap walmart rig either lol.

    Same. It's not like I close and open an empty scene to be fast. If the scene is complex it sometimes takes a few minutes just to clear it.

    I don't know if the bug is due to Iray or DAZ Studio, however, there clearly is a bug. Rendering one or two images works fine but after that even with no previews still open, the following renders are increasingly likely to slow to a crawl. Closing down DAZ Studio and restarting it resets this situation. If the fault is due to Iray, then couldn't DAZ3d add a feature to clear the memory on demand, without having to restart the program?

    Yes, it is killing me when I am rendering a scene with multiple high resolution skin maps.

    If I use Nvidia Iray in viewport, every 2 or 3 renders at most revert to CPU. This is cleary very badly optimized as every figure(together with maps) takes about 500 MB so my 8 GB of VRAM should not get filled so quickly.

    My only solution is to switch to cpu/gpu rendering as closing DS every 3 renders is not viable.

    Why not? It takes seconds to close and open DS. 

    Also size on disk or in RAM is not directly comparable to size in VRAM. Further the output image has to be stored in VRAM and the render process itself uses VRAM. I'm not saying there isn't a memory leak, there clearly is, but the work arounds are pretty trivial. I get between 5 and 20 (depending on how many scenes I can setup in a day) rendered over night every day.

    I didn't look how much disk space they occupy. I looked at the space they mention when it starts rendering: Geometry consumption, materials consumption. I would expect those numbers to be what they occupy on the VRAM.

    Just rendering images isn't a problem, for me the problem occurs during the day when I try to setup scenes, tones and such when I have to use Nvidia in the viewport.

    Those numbers mean essentially nothing. You can easily enough use GPU-Z or Afterburner to see how much VRAM is in use during a render and it will not corespond to those numbers.

    I actually have the utility from Asus (as I have an Asus Video card). I will use it next time I load up the scene and see how much VRAM it uses, I am quite curious. I can't believe I didn't think to check it before.

    This way I can also see if the switching to CPU really overlaps with the filling of the VRAM.

  • brvsnbrvsn Posts: 213
    edited March 2021
    I just noticed that Daz has a script to flush the ram; I still don't know if it works has intended since I'm still testing it.. If you want to test it as well you'll find it into the default library under the script section (I used Content Library tab because it's better for this kind of stuff) and it's called Purge Memory EDIT: it seems to work only for RAM, not VRAM But maybe it could at least speed up the close process..
    Post edited by brvsn on
  • Hey, guys I just saw your posts, here is my discovery. In my Daz 4.15, it always uses GPU and all the CUDA cores.

    By default, the task manager doesn't show the CUDA performance. Once you switch it on, it will show you actually both GPU and CPU are rendering full throttle.

    Good luck rendering!

  • Faeryl WomynFaeryl Womyn Posts: 3,547

    I'm not sure this is an Nvidia problem, or an Iray problem. I kinda sorta follow what all of you are saying as you make your comparisons, however, I don't have an Nvidia card and I avoid Iray like the plague cause of how long it takes on this ancient beast, yet I have a problem with Daz not wanting to work after doing a certain number of renders. Most cases it just closes out of the blue any time after doing 5 renders, sometimes I can do more, but it's rare.I also don't think this is limit to 4.15 since I'm using 4.12 and this is happening.

    If this is the same thing you're talking about, perhaps all your information and what I have said can give you guys a clue to what is going on.

Sign In or Register to comment.