Manually Clear GPU?
Daz 3D Forums > General > The Commons>Manually Clear GPU?
Manually Clear GPU?
Hello All,
I have an annoying and persistant problem: If I ever use the Iray in the viewport to preview my lighting, when I go to render I get kicked to CPU. This happens even if the scene is well below my 11 GB limit. I then have to restart DAZ, or it will never render on the GPU.
Anyone else experiencing this? And is there any way to manually clear the memory from my GPU?
Thanks!
Post edited by Leonides02 on
Comments
I've looked over at Nvidia and some hobbiest sites for a GPU flush like program. Nada.
It's a persistant problem and any ammount of surfing the Tech section here and over at Nvidia will show this problem is only growing. I brought this problem up a few months ago and was blown off as a one shot issue or due to a 'conflict' of 2x960GTX's and a 2070RTX. Right now my 960's are turned off via the Windows device driver to lessen the number of times this problem happens but all in all, that means $800.00 of equipment in my computer is doing nothing but take up space. (2x960GTX SC 4Gb)
Doesn't look like it's just me or you or even a few others but now people who are doing Animation sequences are now being hit. By frame order it looks to be GPU, CPU, GPU, CPU rendering. That's not good in anyones book.
It would be nice to see DAZ has gone so far as to contact Nvidia of this growing problem and relay that back to us instead of this non-stop asking for help or lame attempts for temp fixes by hobbists. Optiplex this or that, tweak this or that setting, use this driver over that driver... but at the end of the day the underlying problem is still there. A fresh out of the box, most current software and drivers should mean smooth sailing or am I wrong to have that expectation?
I'm personally to the point I before I do the final and big render is to shut down Studio, make sure my RAM is clear via my GPU monitor then Start back up reload the scene and pray it all works out from start to finish.
Good luck, and if you do come across a GPU memory flush. PLEASE OH PLEASE let us all know about it!
R/
PDSmith
@Leonides02
Rather than Iray viewport, just make a small (~500x500) render. In my experience the viewport won't render any faster.
Close the render window when done.
I have a gut feeling I started to experience this when I installed DS 4.12. Iray preview on to render, -> cpu. After a couple of aborted renders (render windows closed) -> next one goes to cpu.
I see it regularly. I've just starting incorporating a short break while Studio restarts into my workflow. Even doing a reset on the driver doesn't flush it.
TD
Yes, I didn't have the problem this consistently with 4.11 or even the previous beta version of 4.12
Hm. Seems like a decent workaround. I'll try that - although I do wish it'd get fixed!
Not a direct answer to your problem, but in using ManFriday's Render Queue I notice he restarts DAZ between renders in your queue to avoid this problem. So, I spend my evenings creating and tweaking scenes and committing them to Render Queue and when I come back in the morning, all my images are rendered and waiting - NO DRAMA!
I just got a new computer and everything is a jumble in my mind, but I could SWEAR I just saw something in DAZ (Latest Public version) under the Render Settings tab, Advanced... I remember when I saw it (or THOUGHT I saw it) I literally sat up straigther in my chair and exclaimed, "About danged time!" Now I probably won't be able to find it again, or I didn't see it in real life. :)
I used to do a lot of renders in EON Software's VUE and there was an easy, obvious 'Clear Memory' menu item. True, it was system memory and not GPU memory, but man it made a huge difference if things started getting sluggish.
So the question is, is this an Nvidia (or any GPU manufacturer) problem, an IRAY specific problem, or a DAZ Studio problem? Or all of the above?
For now, Render Queue helps TREMENDOUSLY!
Thanks, Gogger. Yeah, I have Render Queue and it's fantastic.
But normally I like to preview my renders in the viewport before committing to a full night!
This is a big problem when you have to use iray in display port for Iray-decals. The problem was definitely there in 4.10 too, but does seem to have gotten worse. Restarting Daz wouldnt be so bad were it not for the insane load times.
Happens to me a lot too. Especially when I'm experimenting with different shaders. Loading and unloading the shaders and seeing how they look with IRay preview turned on. But, as with the OP, experimenting with lighting will do it too.
I also close down DAZ Studio often to try to minimise the risk of overloading the VRAM.
I would be VERY glad of a way to clear the GPU/VRAM without having to completely restart Daz; some scenes can take quite some time to load, but quite often even a really simple scene will quickly decide to drop to VRAM after starting more than a couple of Iray renders (a particularly stupid one yesterday was when I was testing a custom update for Loretta Lorez - I'm using less than a single perecent of my VRAM, why are you doing that?!)
It's really tedious at times.
I've been having this problem since 4.11. After a couple dozen emails back and forth with DS tech support, a bunch of fresh installs, driver updates, driver downgrades, and hundreds of test renders, I found that switching between GPU+CPU and GPU-only (so switching from GPU+CPU to GPU-only or GPU-only to GPU+CPU) when DS coughs up a hairball temporarily fixes the problem. (It also works if you switch off the GPU, render a dozen or so iterations on CPU-only, then abort the render and switch on the GPU.) My guess is that switching off one of the rendering devices clears out the GPU memory cache, so the next GPU render doesn't just recycle the data from the previous run and cough up a hairball when it hits the earlier error.
Yeah, it's a pain, but it beats quitting and restarting or waiting for a CPU-only render to finish.
this clears the memory if you're using only the render button, but if you're using viewport and then render button, it does not clear the memory from the viewport. Thanks though.
@mclaugh, Have you shared this solution with Tech Support and/or the developers?
My experience with writing software is limited, but it seems to me if switching between hardware devices in the Advanced tab of the Render Settings can resolve the issue, there's a clue in there for the developers to create a way to flush the GPU memory from within DS, without having to close the program and reload everything.
Oddly enough, I still have 4.11 and I've just tested the same scenes and it doesn't happen in 4.11.
I can render in the viewport and then render the final with no issues.
This may be a bug. Can anyone else confirm? I'll report.
I commented on this in the beta thread. My last two renders, (Aftermath and Heart of Winter, linked in my sig below,) taxed both DS and my GTX 1080 to the max. I had to tweak a number of things to get them to fit on the card at all. I noticed with both, after closing down DS, GPU-Z still showed about 2GB of RAM in use for some minutes. Checking Task Manager, I could see that DS was still using several GB of RAM and about 7% of the CPU, even though it had been "closed". I was actually closing this process down with Task Manager, but Richard said that's not such a good idea.
Because 4.12 uses Optix and needs more of the card's ram to support it, I was working with both scenes in 4.11 and 4.12, testing for which would render fastest. So I can attest to the fact this behavior exists in both 4.11 and 4.12. Richard said it is a long standing issue, so apparently it's been around since well before 4.11.
@davidtriune – Use the viewport to preview, switch to texture shaded once you're satisfied with the preview, check/uncheck CPU in the Advanced panel, then render Yes, it works: I've spent more hours that I care to think about ('cuz I'm OCD) and dozens of test renders testing that exact scenario to prove it.
I'm sure there are scenarios where having an iray viewport open while running a render makes sense, but I'm having a hard time coming up with one.
@L'Adair - yes, I've documented it and passed it on to Tech Support several weeks ago. Last word was the development team was going to powwow about it with NVIDIA. Haven't heard anything further since then.
Hm. I'm only seeing this behavior consistently in 4.12. In 4.11 it was an occassional annoyance. Now it seems to be happening every single time I preview my render in the aux. viewport.
mclaugh - Thank goodness for your testing. I will try this out. My fingers are crossed! Thank you for commenting.
Mmmm. Read Richard's comment in Beta thread. The way I read his comment is he said there was consequences. If you liked your UI setup, or was close enough when you fisrt started session, then there is no real loss to speak of. Anytime I make critical UI changes I save them.
The bigger concern is are you damaging anything in the back end. Which no one has definately said Yes or No to. Years ago on XP OS, was the only time I damaged a file. But that was a hard crash. Not a task-kill. Resinstalled the corrupted file and all was good again.
I have been regularily TASK-killing DAZStudio for months now, cos it's stuck slow motion processing something, or it switches to CPU processing. Doing task-kill on DS Sometimes several times a day, without needing to reboot my PC.
The only issue I have is as I outlined in the Beta thread a few days ago, when someone responded I should sitch to 3DSMax. Given that 4.12.0.86 works fine for me, and it shares the same cache (C:\Users\username\AppData\Roaming\DAZ 3D\dson\cache) as 4.12.1.16, I don't expect my issue has anything to do with task-killing.
If you want to play it super safe that's understandable. Just wanting to say, IMO, you can continue to task-kill to save precious time. I will continue to do so.
Not sure if entirely similar. But your issue does sound not totally dissimilar either from what I and now 2 others have similarily posted in 4.12.1.16 thread.
Did you check you log file? It seems a few of us are having illegal memory allocation errors though there is a ton of VRAM left. And it's happening often during viewport rendering and then adding a change. In my case flipping many textures, and texcture settings can trigger drop to CPU.
Saxa -- SD - Perhaps I should have noted, I am using the Beta.
I started running into this in 4.9 in Win 7, and saw it more often than not in 4.10. Also saw it frequently in 4.11 until I upgraded to Win 10. I got in the habit of killing DS and Postgresql in Task Manager after quitting normally, because Task Manager was showing DS and Postgresql were still using RAM anywhere from 3 to 24+ hours after quitting. I know Daz says not to do it, but in 3+ years of killing doing it almost daily, I never ran into an issue that was even remotely attributable to killing DS/Postgresql in Task Manager.
Then it sounds like our issues may be less dissimilar. Did you check your log for illlegal memory allocation?
I have this issue with the current beta version, Beta version 4.12.0.85 works great, so I moved back, created a ticket and wait for a fix before updating.
Anyone having this problem where you render something big and it suddenly restarts at iteration 1 for no reason, and it won't clear the memory even if you close DAZ? I had to restart the computer. I tried mclaugh's method and it didnt' work.
I have had that issue, and posted a thread asking about it a few days ago, but I've not heard back from anyone as to why.
New guy here-- I assume GPU memory allocation issues, freezing, etc., when rendering Iray are still a problem lots of people are having? Not just me for the past few days? Luckily mclaugh's solutions worked for me tonight (you are a saint, mclaugh) so I bumped this particular thread. I googled and didn't see anything from this year, but have there been any developments in this regard (via Nvidia or DS)?
There won't be. As was patiently explained to at least some of the posters on this thread before the iRay viewport is a full render as far as your GPU is concerned. Leaving it open and then starting an actual render will mean you have 2 renders open and consuming VRAM at the same time. Don't use iRay viewport all the time and when you do use it switch to something else before you render.
Then you have a different issue from what is described here. What GPU do you have? What driver? What sorts of scenes are you trying torender?