Question about Iray memory usage

I have a scene set up in Daz Studio 4.10. When I render it on the GPU, the reported texture memory usage is about 1 GB.The same scene when rendered in Daz Studio 4.12 uses only about 400 MB for textures .These are the numbers reported by Daz itself. However, when I use Process explorer etc. to check the GPU memory usage, it's the same in both cases, about 1 GB.

Doing a few experiments, I found this:

In Daz Studio 4.10, if a texture is used multiple times in a scene, the total texture memory usage is the number of times it is being used * texture size

So if the texture is 4MB and is used to two different surfaces, the memory use is 2*4 = 8 MB.

In Daz Studio 4.12 however, it remains at 8 MB, no matter if it is used more than once.

Note, that these numbers are reported by DAZ itself, process explorer shows the same memory/VRAM in both cases.

So, is Daz Studio 4.12 more efficient in terms of memory usage or is it that it reports VRAM usage differently compared to Daz Studio 4.10?

Comments

  • if VRAM is your concern just reduce your textures using scripts for that. 

    https://www.daz3d.com/scene-optimizer

    (I'm not the creator of the script, btw)

     

  • That's not the issue. I just want to know how DAZ Studio manages VRAM. Imo, texture memory use should not increase if a texture is used more than once in a scene. If a texute is already stored in memory, there's no need to load it again. That would be really inefficient.
  • onixonix Posts: 282

    As I found in the discussion on one Russian site some time ago, one guy did extensive research on iRay memory consumption,

    https://daz3d.ru/iray-i-ispolzovanie-pamyati-videokarty

    according to his research just rendering a single polygon will already consume nearly 4gb GPU memory

    denoiser will eat up to 400MB extra 

    Texture memory consumption is actually unpredictable entirely because Iray will resample textures depending on their distance from the camera which Nvidia calls texture compression but this may be also a false theory.

    This texture compression can reduce memory usage several times and it may be the reason why scene can fail when changing camera position.

     

  • TaozTaoz Posts: 9,971
    edited December 2020
    onix said:

    according to his research just rendering a single polygon will already consume nearly 4gb GPU memory

    Maybe under certain unusual circumstances, but definitely not in general.  It's true that any scene rendered in Iray, even an empty one, seems to use a minimum of VRAM (on my system (GTX 1070) it's about 2.3-2.5 GB including what Windows is using for display), but that seems to be some necessary overhead usage for any scene.  Adding a simple 6 polygon cube increases VRAM use with only about 50 MB.   Adding a character with hair and clothing as shown here increases VRAM use with 1 GB to 3.5 GB.  


     

    iray_vram_use.png
    797 x 925 - 448K
    Post edited by Taoz on
  • onixonix Posts: 282
    Taoz said:
    onix said:

    according to his research just rendering a single polygon will already consume nearly 4gb GPU memory

    Maybe under certain unusual circumstances, but definitely not in general.  It's true that any scene rendered in Iray, even an empty one, seems to use a minimum of VRAM (on my system (GTX 1070) it's about 2.3-2.5 GB including what Windows is using for display), but that seems to be some necessary overhead usage for any scene.  Adding a simple 6 polygon cube increases VRAM use with only about 50 MB.   Adding a character with hair and clothing as shown here increases VRAM use with 1 GB to 3.5 GB.  


     

    I tested it myself and yes that information may be incorrect or outdated,

    But starting Iray preview port immediately consumed about 2gb even without any geometry at all.

    Windows itself used 2GB already(probably used by chrome) what made it 4gb total

    adding geometry did not increase memory consumption that much

  • This is certainly more complicated than I thought.

    Taoz said:
    onix said:

    according to his research just rendering a single polygon will already consume nearly 4gb GPU memory

    Maybe under certain unusual circumstances, but definitely not in general.  It's true that any scene rendered in Iray, even an empty one, seems to use a minimum of VRAM (on my system (GTX 1070) it's about 2.3-2.5 GB including what Windows is using for display), but that seems to be some necessary overhead usage for any scene.  Adding a simple 6 polygon cube increases VRAM use with only about 50 MB.   Adding a character with hair and clothing as shown here increases VRAM use with 1 GB to 3.5 GB.  


     

    You're right here. Even if it's an empty scene, VRAM goes upto 1GB at least. Adding anything extra increases VRAM usage more (as expected). However, 2.3-2.5 GB is quite a lot for "necessary overhead"! Iam not sure if other render engines also need this extra "overhead" because this seems to be a waste for VRAM (which is already scarce in not high-end nVidia cards).

    Also, I mentioned two things in the OP:

    • Daz studio 4.10 reports using about 1 GB memory for textures while 4.12 reports only about 400 MB
    • Process explorer however shows that the memory usage is the same in both cases (1 GB)

    What's causing this discrepancy?

  • onixonix Posts: 282
    binarynos said:

    This is certainly more complicated than I thought.

    Taoz said:
    onix said:

    according to his research just rendering a single polygon will already consume nearly 4gb GPU memory

    Maybe under certain unusual circumstances, but definitely not in general.  It's true that any scene rendered in Iray, even an empty one, seems to use a minimum of VRAM (on my system (GTX 1070) it's about 2.3-2.5 GB including what Windows is using for display), but that seems to be some necessary overhead usage for any scene.  Adding a simple 6 polygon cube increases VRAM use with only about 50 MB.   Adding a character with hair and clothing as shown here increases VRAM use with 1 GB to 3.5 GB.  


     

    You're right here. Even if it's an empty scene, VRAM goes upto 1GB at least. Adding anything extra increases VRAM usage more (as expected). However, 2.3-2.5 GB is quite a lot for "necessary overhead"! Iam not sure if other render engines also need this extra "overhead" because this seems to be a waste for VRAM (which is already scarce in not high-end nVidia cards).

    Also, I mentioned two things in the OP:

    • Daz studio 4.10 reports using about 1 GB memory for textures while 4.12 reports only about 400 MB
    • Process explorer however shows that the memory usage is the same in both cases (1 GB)

    What's causing this discrepancy?

    I suspect that it may be result of texture compression algorithm differences

    to disable compression try to change threshold numbers to something over 8000 in the render parameters advanced tab.

  • cajhincajhin Posts: 154

    You can't really believe everything the tools tell you about VRam; that's managed by the card and there's no easy way to get details on usage.

    One thing that takes VRam is iRay render kernels (as I understand it, basically the iRay engine is compiled for your graphics card, so that the card can run it on its own. Might be a trade-off between VRam usage and speed, so VRam use may change with every new iRay build. Older cards use more VRam since the raytracing stuff that RTX cards have in hardware, needs to be replicated in software for cards that don't have it. Again, that's as I understand it, I never coded any CUDA / Optix stuff).

  • PaintboxPaintbox Posts: 1,633
    cajhin said:

    You can't really believe everything the tools tell you about VRam; that's managed by the card and there's no easy way to get details on usage.

    One thing that takes VRam is iRay render kernels (as I understand it, basically the iRay engine is compiled for your graphics card, so that the card can run it on its own. Might be a trade-off between VRam usage and speed, so VRam use may change with every new iRay build. Older cards use more VRam since the raytracing stuff that RTX cards have in hardware, needs to be replicated in software for cards that don't have it. Again, that's as I understand it, I never coded any CUDA / Optix stuff).

    So if you're on new cards (20x0 and 30x0) you also get a memory buff vs older cards because the instruction sets are already in hardware? Do we have a guess how much this can differ?

  • cajhincajhin Posts: 154

    I never read anything about specific numbers. Wild, baseless speculation: it's all very low level and the hardware cannot be that complex, so probably not that much. If I had to make up a number, maybe between 5 and 50MB?

    Would be interesting to hear from someone who knows.

  • onix said:

    This is certainly more complicated than I thought.

    according to his research just rendering a single polygon will already consume nearly 4gb GPU memory

    Maybe under certain unusual circumstances, but definitely not in general.  It's true that any scene rendered in Iray, even an empty one, seems to use a minimum of VRAM (on my system (GTX 1070) it's about 2.3-2.5 GB including what Windows is using for display), but that seems to be some necessary overhead usage for any scene.  Adding a simple 6 polygon cube increases VRAM use with only about 50 MB.   Adding a character with hair and clothing as shown here increases VRAM use with 1 GB to 3.5 GB.  


     

    You're right here. Even if it's an empty scene, VRAM goes upto 1GB at least. Adding anything extra increases VRAM usage more (as expected). However, 2.3-2.5 GB is quite a lot for "necessary overhead"! Iam not sure if other render engines also need this extra "overhead" because this seems to be a waste for VRAM (which is already scarce in not high-end nVidia cards).

    Also, I mentioned two things in the OP:

    • Daz studio 4.10 reports using about 1 GB memory for textures while 4.12 reports only about 400 MB
    • Process explorer however shows that the memory usage is the same in both cases (1 GB)

    What's causing this discrepancy?

    I suspect that it may be result of texture compression algorithm differences

    to disable compression try to change threshold numbers to something over 8000 in the render parameters advanced tab.

    Tried that. Same results. Daz Studio 4.12 reports using less VRAM probably because the scene has the same texture being used in multiple surfaces and according to what's being discussed here:

    https://www.daz3d.com/forums/discussion/comment/6274266/#Comment_6274266

    Here's a quote from the page:

    If anyone is using Daz studio 4.10 or earlier, Iray will load the maps for every surface its used on.  However, in Daz Studio 4.11 and up, the maps are only loaded once.  The exception to the rule, and this has always been the case, is if you use the same map in multiple channels on the surface such as using the bump map for gloss and top coat, will cause the map to be loaded again for each channel its used in. 

    Daz 4.11 and higher only load the maps once. This could account for lower memory usage. My question however was about process explorer/gpu z reporting the same VRAM being used (1GB) in both cases. This means one of two things:

    • Process explorer/gpu z showing wrong numbers
    • Daz Studio showing wrong numbers.

    For comparison, I set up a scene both in Daz Studio and then in Blender. The scene only had a cube and two plane primitves. A few KB of geometry. Rendering in Cycles, the GPU memory went up only by about 10-15 MB (accordiing to GPU-Z). However, DAZ Studio/Iray used more than 1 GB!

    I don't think that much can be donw about this. This is probably how Iray works. I just wonder what is it that's taking up all that VRAM. VRAM use in Gigabytes for an empty scene is really absurd.

Sign In or Register to comment.