How to reduce VRAM usage? How much VRAM does a scene need?
LenioTG
Posts: 2,118
Hi everyone :D
I have a problem: my GPU has only 3Gb of VRAM, and I don't need to tell you that most scenes simply are bigger than that, and the rendering uses my CPU, making my PC unusable in the meanwhile, and taking much longer.
Is there any way to check how big a story is before starting to render?
And, before all, is there any way to reduce the scene size in order to make it fit in 3Gb? Does the whole scene contribute to what I'm rendering, or is it just the part I tell Daz to render?
Thank you :D
Comments
I now have an 8GB card and even so I run out of VRAM. When I had a 4GB card it was almost impossible to fit most of my scenes so I too looked for solutions (although eventually it came down to raiding my savings account). Something I did find useful (and still use as a matter of procedure) is this Scene Optimizer from V3Digitimes:
https://www.daz3d.com/scene-optimizer
Textures take up a lot of VRAM so reducing their size is a big help. As for figuring out how much VRAM is being used, I tried the IRay Memory Assistant from this store but found it to be inaccurate (drastically so). So now I use the free utility GPU-Z from TechPowerUp:
https://www.techpowerup.com/gpuz/
Of course, you have to start the render to see the usage but it will give you an idea. Then you have to start removing things from your scene - things out of the camera view, for example. There are other threads here with more tips.
Wow, thank you so much!!!
Does this utility really work? What is says seems too convenient!
Is it easy to use? I'm a noob :'(
PS: I didn't think Daz Studio used stuff outside of the viewport...that's strange :(
I know GPU-Z, but I've never thought of that!
You mean the Scene Optimizer? Yes, it does what it says in the product description. I usually use a 2x (half-size) reduction but if your figures are not in close up you could probably reduce further. There's a very good guide that comes with the product. It is one of my most used purchases (and it is half-price at the moment).
I'll take it, thank you very much! :D
When you render in Iray all the textures of the scene is loaded on Vram and not only the texture of what is in viewport.
You can read this short guide about Vram and Iray https://www.deviantart.com/linvanoak/journal/Quick-Guide-VRAM-information-in-DAZ-Studio-684230790
I've read it, thank you! :D
I'm currently checking out Scene Optimizer. I'm reducing the maps of all the nodes in the scene by 2, this process is taking around 6/7 minutes, I'll see if I'll notice an improvement in render time!
Okay I'm starting to understand that tool!
For who comes here from Google with my same problem: You better backup everything with the blue utility (n° 1) before staring. The VRAM usage is shown as the last line before the rendering starts. At 4x reduction for things on screen the difference is huge: everything is pretty ugly. I'm doing some tries with the instant optimization on memory (from render settings, I had it on speed), but for now with half the textures reduced (I've restored most of them) I'm able to use my GPU!
1st try: with all the textures restored, except for the backgrounds at 4x, it uses the CPU
2nd try: I've reduced far away stuff by 2, still CPU
3rd try: almost everything 2x, still CPU
4th everything 2x, still CPU
5 everything 4x, VRAM usage 1,45Gb, GPU, but it's pretty ugly
6th try: everything 4x but floor, wall and part of the characters restored: CPU again. Let me at least see if this reduces the render time...
Quote: "I'm currently checking out Scene Optimizer. I'm reducing the maps of all the nodes in the scene by 2, this process is taking around 6/7 minutes..."
I've never had Scene Optimizer take more than a minute or two to reduce all of the maps in a scene. So I'm thinking that my scenes must be less crowded than yours which makes it unsurprising that you run out of VRAM. Does GPU-Z give you an indication of the usage during the render?
Just to note that I load my purchased characters at the time of purchase into an empty scene. Then I morph them, make any other changes (like add geografts), and the run the Optimizer. I then save the character as a Scene Subset so that I can include it in any further scene without worrying about optimisation. Occasionally I do the same with building or room scenes if they are texture-heavy but often they are not.
You might want to check out this product: https://www.daz3d.com/resource-saver-shaders-collection-for-iray Even if you don't want to buy it right now, there's a lot of good info in the promo pictures. They explain a lot about how Iray uses textures/geometry. Some of it sounds kind of technical, but if you want to make the most of what you have, you have to dig into the tech stuff.
Thanks for pointing to this product. For my part, I don't usually want to remove maps (as this utility seems to offer) but I do want to reduce them to a manageable size. Removal is an all-or-nothing approach which might not suit everyone. It does mention a mat optimizer but I already have that in the Scene Optimizer discussed above.
Personally, I don't like removing maps either. On hair, for instance, it ends up looking plastic in my opinion. I noticed that Mattymanx uses depth of field in some of the promo images, so removing textures wouldn't be noticeable, but I don't use it very often so I don't know if I could get away with that. He is right that most people have subdivision turned on when it's really not needed. That could save a little on memory by reducing geometry. I don't know if displacement maps count as geometry memory or as texture memory. Maybe I'll test that next weekend.
Marble,
Have a look at this thread here about the RSSC starting with this post - https://www.daz3d.com/forums/discussion/comment/4089311/#Comment_4089311
The scene I'm currently render has three Genesis 8 characters with very detailed hair, accessories and cloths.
Excuse my ignorance, what are geografts?
I use the Scene Subset trick too sometimes, but those three characters alone let me go over my 3Gb of VRAM (but I have to check this out!), so, at this point, since I don't want to lose any quality, I'm just leaving the scene to render for a lot of time :'(
During render, even with that 1,2Gb scene, my usage was nearly 3Gb, and even after closing Daz Studio it was 0,8Gb, while restarting the PC it went down to 0,2, going up gradually as soon as I open Daz Studio.
Very useful, thanks! :D
I won't buy it right know, because I don't think that even halving the VRAM usage I would be over the 3Gb, because I better save up 60€ to upgrade my RAM from 8Gb to 16Gb and because I'm currently realizing a story, so I wouldn't use the depth of field effect. I've wishlisted it :)
What an honour to have here the creator of that product, you seem to know what you're talking about! :D
I'd like to upgrade to a GTX 2060 someday in the future (selling my GTX 1060 should give me back around 160€), but they say that it will have "only" 6Gb of VRAM...at this point maybe I'd be better with an used 1070!
Update: trying out different approaches and applying your suggestions I've come to these results:
Am I doing something wrong?
PS: can I hide an object, close and reload Daz, or should I always delete everything I'm not using?
EDIT: I guess, unfortunately, that the answer to my previous question is that I have to delete everything I'm not using everytime and to restart Daz to clear the GPU VRAM.
This is because I've deleted the characters and I'm rendering the house only with the same settings of before, but this time it's always using the GPU, but with 65 iterations in 2 minutes instead of 12 (and I'm considering the time of the preparation too)
So I guess that the best way to "solve" this VRAM issue is to create a scene with everything you're going to use in those renders, then save separately as subsets the characters for every render, another subset for the house, and another one with the cameras: then I load the cameras with each subset of the characters and I render them, and I do the same for the house.
The best way to solve the render problem is to get a better GPU. No getting around that
I'm afraid that is so true and, as I said at the top, exactly what I had to do eventually too. Even with 8GB I still use Scene Optimizer and still remove items out of shot. When I was limited to 4GB, I did struggle to get three G3 (or G2) characters in a scene together even after taking all the precautions.
@kamenko : Geografts are add-ons to the original mesh. That would include the delicately named "anatomical elements".
Yes indeed, I now see the difference as you carefully explained in that thread. At the moment I'm not doing many (if any) crowded scenes so I have not had a revert-to-CPU problem for a while but I will certainly bear in mind your product for future projects. Thanks.
That's my project indeed, but currently I don't have 400€ for a GTX 1070!
And I was thinking about buying 8 more Gb of RAM before that for 60€
So, in the meanwhile (and it'll be a long while) I need some way to speed up things! Luckily I read that the upcoming version of Daz (4.11) will be much faster, do you know when this stable versione will be ready?
Thank you for everything :D
Before IRay came along - and for quite a while after - I used Reality/Luxrender for my photorealistic renders. The quality was good but it was somewhat time consuming setting up materials. In those days I had a Mac plus a PC loaded with Linux and the advantage of Luxrender is that you can render one scene on two machines at the same time over a network (there are versions of Lux for Mac, PC and Linux). In this way I was able to approach IRay render speeds. Another advantage of Luxrender is that it uses system RAM so you are not limited to the graphics card VRAM - I'm talking about CPU only here.
You're welcome! :)
Tank your texture maps. You do not need a 4k texture. If anything in your scene has a map at 4k, it should be so close to your screen that there's little else left to actually render. Mind those hair props. They put pointlessly absurd map sizes in there and literally the first thing I do when I load any of them is annihilate their textures. You can reduce them to near nothing with ~0% loss of quality. Some of the maps I flat out remove because they serve little to no purpose other than making the shader graph seem "fuller" for no actual benefit.
Just go to the texture folders, select the ones you're using and kill their sizes. Don't need a script, any free image editing tool will do. Several batch-processing tools that cost nothing out there on the Googles.
This is by far my most powerful PC, and if I have to use CPU, well, I think I can do that in Daz too, right? And I have only 8Gb of RAM
I've already bought that tool, so I can use it, I have to say it's pretty fast and simple to use!
Actually, even with 4x reduction, I saw a LOT of difference in hair, clothes and even buildings! So I try to never reduce under 2x
Reality can be allowed to run in the background for a bery long time to get renders done. My problem with it was setting up materials was a massive PITA.
Have to agree with that. I think I would have stuck with it a lot longer had it not been for that, as you say, PITA.
Another thing that could help is the free iray interior camera on share cg. It's just a camera with iray planes all around it to cut out objects that are off camera from rendering. It also helps brighten up the scene too :)
I've noticed a pretty big difference in my crowded city scenes, as well as cluttered internal scenes
Excuse me, are you sure? Until now everyone said that even not having an item on your viewport fills up your VRAM, and I've noticed that this happens even when I hide an object :'(
I have gtx 970 4GB video card, my scene consists of urban futures 1-5, 2-3 G8 characters, about a dozen or so loretta and lorenzo lorez figures, the red light district from rendo, cyberpunk city bundle, black market back alley, the sci-fi city kits, a few vehicles and the techno town buildings (I'm probably forgetting a few things)
After reducing the texture sizes on the buildings and using the iray camera, it all fits on my card for rendering :)
Nice! :)
Ahh, there's a difference. Switching off visibility in the viewport doesn't reduce the polygon count in VRAM but IRay planes exclude objects (thus polygon count) from the render and from VRAM. You can test it by adding your own IRay Plane from the top menu.
Switching off visibility certainly should prevent the emsh from being sent to Iray - hiding it via surface settings, however, won't.
That surprises me. The reason I stated using IRay planes was because the render was still dropping to CPU no matter how many items I "turned off" (switched the little eye icon to closed).