Daz Blender DAZ to Blender: High VRAM usage

Baka_Energy_studios

Engaged Member
Game Developer
Aug 31, 2017
2,574
5,720
Hi there, recently I tried to convert the models from my VN into Blender to circumvent the high VRAM usage by IRAY and using Cycles instead.
But here`s the thing.
Screenshot (999).png
Lilith 7 takes up much more VRAM than her DAZ counterpart for some reason.
And same goes for a g8 figure:
Screenshot (1000).png
Both were brought into Blender with base resolution and 0 subD.
In Blender the rendered subD was 2, which is fine because lower than that and the models almost have no distinctive features anymore(like sharper cheekbones)
Is there a setting I have to click/uncheck to lower the VRAM usage in Blender or is it something in diffeomorphic that ramps it up so high?
I'm really confused because I saw a video by MRU Studios in which he used several models at the same time.
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
Daz has two kinds of SubD, one in the mesh and one in the surface displacement. Even if you set mesh to base resolution the exporter will still add Subsurf for the surface displacement. I don't like it, but on Bitbucket others said it should stay that way because it's accurate to Daz.

Do you use texture compression in Daz Studio? That might be shrinking your textures. You can do the same thing in Blender if you use the Simplify panel in the render settings. But it's a global setting so there's no way to do it only for certain characters. Diffeomorphic does let you scale an object's textures if you install a free Python library:

I usually simplify my viewport to 1024 pixels max unless I really need to see fine detail. If you're rendering a heavy scene and your camera isn't close to any surfaces you can get away with limiting the render to 2048 pixels. And if you set the viewport's max subsurf to 0, it will temporarily disable every subsurf modifier, reducing lag.

Unlike Iray, Blender shares RAM with your computer if it won't all fit on the GPU. So even if you go over it won't drag you down to CPU rendering level.

If you right click the black bar at the bottom you can turn on the stats for system and video memory. I use that to check my VRAM usage, not the Task Manager. I've never done any hardware benchmarking between Iray and Cycles though. Daz's shit posing makes it unusable for my purposes, so going back isn't an option.

I have Lilith 7 so I'll take a look at it and see if I'm getting the same results.
 

Baka_Energy_studios

Engaged Member
Game Developer
Aug 31, 2017
2,574
5,720
Daz has two kinds of SubD, one in the mesh and one in the surface displacement. Even if you set mesh to base resolution the exporter will still add Subsurf for the surface displacement. I don't like it, but on Bitbucket others said it should stay that way because it's accurate to Daz.

Do you use texture compression in Daz Studio? That might be shrinking your textures. You can do the same thing in Blender if you use the Simplify panel in the render settings. But it's a global setting so there's no way to do it only for certain characters. Diffeomorphic does let you scale an object's textures if you install a free Python library:

I usually simplify my viewport to 1024 pixels max unless I really need to see fine detail. If you're rendering a heavy scene and your camera isn't close to any surfaces you can get away with limiting the render to 2048 pixels. And if you set the viewport's max subsurf to 0, it will temporarily disable every subsurf modifier, reducing lag.

Unlike Iray, Blender shares RAM with your computer if it won't all fit on the GPU. So even if you go over it won't drag you down to CPU rendering level.

If you right click the black bar at the bottom you can turn on the stats for system and video memory. I use that to check my VRAM usage, not the Task Manager. I've never done any hardware benchmarking between Iray and Cycles though. Daz's shit posing makes it unusable for my purposes, so going back isn't an option.

I have Lilith 7 so I'll take a look at it and see if I'm getting the same results.
Thanks for the link. I'm gonna try two methods next time: Scene optimizer in DAZ for the Skin textures and another will be the python one.
Yeah, I uncheck the subsurf modifier for posing manually otherwise it's a drag to move limbs around.
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
For Lilith 7, out of the box with no clothes or hair, Daz Studio used 4.0 gigabytes of VRAM. The same scene exported to Blender 3.2 used only 3.3 gigabytes. I checked both using the Task Manager so there's probably some Windows bloat included.

Cycles in Blender 3.2 uses about 20% less VRAM.

lilith_comparison.png

Iray on the left, Cycles on the right.

You're still on 3.0, the first Cycles-X release. It's been optimized since then I think, so you may want to update and try again.

Yeah, I uncheck the subsurf modifier for posing manually otherwise it's a drag to move limbs around.
What I mean is, you can globally disable all subsurf modifiers using the Simplify menu. So if you have a character you need to do a slight tweak right before rendering, you can set max subdivisions to 0 to disable subsurf on the figure, clothing, and hair all at once.
 

Baka_Energy_studios

Engaged Member
Game Developer
Aug 31, 2017
2,574
5,720
For Lilith 7, out of the box with no clothes or hair, Daz Studio used 4.0 gigabytes of VRAM. The same scene exported to Blender 3.2 used only 3.3 gigabytes. I checked both using the Task Manager so there's probably some Windows bloat included.

Cycles in Blender 3.2 uses about 20% less VRAM.

View attachment 1882096

Iray on the left, Cycles on the right.

You're still on 3.0, the first Cycles-X release. It's been optimized since then I think, so you may want to update and try again.



What I mean is, you can globally disable all subsurf modifiers using the Simplify menu. So if you have a character you need to do a slight tweak right before rendering, you can set max subdivisions to 0 to disable subsurf on the figure, clothing, and hair all at once.
3.2 out already? Whoa blender community moves pretty fast. Do I have to install diffeomorphic again if I update to 3.2?
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
3.2 out already? Whoa blender community moves pretty fast. Do I have to install diffeomorphic again if I update to 3.2?
Blender has a set release schedule, a new version comes every three months. Anything the dev team work on in that window that's ready to ship goes into the master and gets released.

The first time you open it the splash screen will let you copy settings from an old version. I think that keeps your addons too. But even if not, installing addons is no big deal. You open the properties menu and find a zip file saved on your hard drive. Easy as can be.
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
One important thing to mention: try both the dev version and the stable version. Skin shaders look better in dev but the Rigify leg conversion has weird bending. I hop over to an old version just to convert it, and then come back to the latest. It is a pain, but Diffeomorphic is coded by only one man.
 

Baka_Energy_studios

Engaged Member
Game Developer
Aug 31, 2017
2,574
5,720
Alright. Got 3.2 and all settings were transferred without problems.
This is Lilith with CUDA in Blender 3.0
Screenshot (1001).png
Changed all her Skinmaps down to 2k versions. That didn't do much for the VRAM usage.
Then I changed to Optix(still in 3.0)
Screenshot (1002).png
A significant drop of 2.4 GB. That's massive.
But in Blender 3.2(with Optix) it doesn't change Screenshot (1003).png
It's still too high
 

MidnightArrow

Active Member
Aug 22, 2021
500
451
With CUDA my VRAM usage goes down to about 3 gigabytes.

Daz assets are usually bloated. With bad optimized makeup, clothing, and hair you can easily hit 5.5 gigs. Try exporting the base figure with only default materials and see what you come up with. I wouldn't be surprised if the high heels have giant textures or stupid shit like that.

Make sure you close and reopen Blender too. Like Iray, sometimes stuff gets stuck in the GPU and you need to flush it out. Unlike Iray, you don't need to wait five minutes for Daz Studio to load a single character.

Blender will offload memory to your system RAM too. Don't worry about fitting it all in VRAM. Even if it spills out it's much faster than a pure CPU render.

Remember, you can globally limit textures. This is Lilith with the Simplify menu limiting all render textures to 2048 or less. It got down to only 2 gigs of VRAM and the face still looks pretty good even at this close up. The body gets blurry but that's the limits of Daz torso texturing.

lilith_2048.png
Keep in mind, most VRAM usage is storing texture maps. Doesn't matter if you use Iray or Cycles, a texture map takes up the same memory unless you optimize it. You're not going to get enormous gains if you shove the exact same texture in the GPU.
 

Baka_Energy_studios

Engaged Member
Game Developer
Aug 31, 2017
2,574
5,720
With CUDA my VRAM usage goes down to about 3 gigabytes.

Daz assets are usually bloated. With bad optimized makeup, clothing, and hair you can easily hit 5.5 gigs. Try exporting the base figure with only default materials and see what you come up with. I wouldn't be surprised if the high heels have giant textures or stupid shit like that.

Make sure you close and reopen Blender too. Like Iray, sometimes stuff gets stuck in the GPU and you need to flush it out. Unlike Iray, you don't need to wait five minutes for Daz Studio to load a single character.

Blender will offload memory to your system RAM too. Don't worry about fitting it all in VRAM. Even if it spills out it's much faster than a pure CPU render.

Remember, you can globally limit textures. This is Lilith with the Simplify menu limiting all render textures to 2048 or less. It got down to only 2 gigs of VRAM and the face still looks pretty good even at this close up. The body gets blurry but that's the limits of Daz torso texturing.

View attachment 1882315
Keep in mind, most VRAM usage is storing texture maps. Doesn't matter if you use Iray or Cycles, a texture map takes up the same memory unless you optimize it. You're not going to get enormous gains if you shove the exact same texture in the GPU.
It's funny that Blender needs more GB bc rendering Lilith with clothing needs less VRAM. Don't know abt that offloading bc my Blender crashes when it hits 7.7 usage. Luckily Blender is way faster at reopening than DAZ.
Tried scene optimizer and scaled down a lot but she still uses 4.9 GB
Screenshot (1011).png
 
Last edited:

MidnightArrow

Active Member
Aug 22, 2021
500
451
In Blender you can go over your GPU limit but not your system RAM limit. If you have 16 gigs you should be able to use up to 15 (though it'd be pushing it). Anything more would definitely cause a crash. What version did it crash on and did you check to see if the other API (CUDA/Optix) solved it?

And you sure you don't have Iray texture compression on? Iray keeps it the same between sessions so it's easy to lower it and forget it. That maybe why Iray uses less VRAM. Go in your advanced render tab and see what it says under Medium Threshold and High threshold. Best as I recall, if you set it at 2048 and a texture is 4096, Iray will use lossy compression to crush it down to 2048 so it fits the GPU.

To trim the figure's VRAM down you need to take a hard look at your textures. How many of them you have, how big they are, what you can live without. If you see high heels using 4k textures and you're not making foot fetish porn, that's an easy fix.