Unable to allocate device memory - GTX 2080 Ti

I am fairly new to Daz, and have only recently been trying to render larger scenes involving 3 or more characters, and the render fails with a generic error message (an error occurred during render). Looking at the log I find the following entry:

2020-04-18 00:49:07.036 Iray [VERBOSE] - IRAY:RENDER ::   1.6   IRAY   rend progr: CUDA device 0 (GeForce RTX 2080 Ti): Processing scene...
2020-04-18 00:49:07.332 Iray [VERBOSE] - IRAY:RENDER ::   1.5   IRAY   rend stat : Geometry memory consumption: 1.1742 GiB (device 0), 0 B (host)
2020-04-18 00:49:07.332 Iray [INFO] - IRAY:RENDER ::   1.5   IRAY   rend info : Using OptiX version 6.1.2
2020-04-18 00:49:07.444 Iray [INFO] - IRAY:RENDER ::   1.5   IRAY   rend info : Initializing OptiX for CUDA device 0
2020-04-18 00:51:06.041 WARNING: ..\..\..\..\..\src\pluginsource\DzIrayRender\dzneuraymgr.cpp(305): Iray [ERROR] - IRAY:RENDER ::   1.5   IRAY   rend error: Unable to allocate 5242884 bytes from 4652461260 bytes of available device memory

I saw the post here: https://www.daz3d.com/forums/discussion/368406/unable-to-allocate-memory-exception-in-4-12-when-plenty-of-memory-available but one, I don't want to raise a post from six months ago, and the memory difference is much different - in my case I can't allocate 5MB out of 4.5GB available. This isn't a "remove a few characters" or "change a shader here and there". I have also run Windows metrics and the utility that came with the card when rendering to verify that there is over 4Gb free memory on the card at all times. I have reinstalled the drivers for the card as well, with no success.

What can I look at or try to get renders to work? Other 3D software such as Blender is able to render fairly complex scenes fairly easily.

Comments

  • To be blunt, it doesn't matter if it's 5MB or 2.5GB if it can't allocate it, it can't allocate it.

    You're just running out of vram.

    Try increasing the available to over 6GB.

    Shut down anything other than DS when you're trying to render.

    Adjust the interface settings, F2>Interface tab. adjust the Texture resources to performance  and the Display optimization to Best. These two setting can significantly reduce the vram usage while working in DS.

    The visuals in the viewport can become a bit funky, but it's a trade off for freeing up system resources.

    If you're still having vram issues, then start checking character's, clothing, hair and the other assets in the scene's Render sub-d levels.Parameters tab>Mesh Resolution.

    If it's above 1(default), you may want to turn it down. be aware though that it may cause an unacceptable result in the render, so adjust accordingly to whether the change will or won't be noticible.

    Next would be the render settings. Try adjusting to default and see if that makes a difference.

    Next, save out each character as a scene subsset. Delete all the characters out and try rendering with just the base scene. Track the vram usage when rendering.

    Then start adding the characters back into the scene, one at a time. Closing DS, due to the memory leak problem, between each add and test render.

    It's possible there's a conflict of some sort in the characters causing the error.

    Next, try adjusting shader settings.

    As a last resort, try something like scene optimizer, but be judicious with it and don't just start cutting all the textures in the scene down, or adjusting every shader setting, the results can be sub-optimal if you do.

  •  

    To be blunt, it doesn't matter if it's 5MB or 2.5GB if it can't allocate it, it can't allocate it.

    You're just running out of vram.

    But, it should matter. I need 5 million bytes. I have 4.7 billion bytes available, according to the error message. Since when is 5 MEGAbytes bigger than 4.7 GIGAbytes?

    How am I "running out of vram" when I have literally 940 times more free VRAM than the renderer says I need?

  • felisfelis Posts: 4,205

    I am not sure how to read that message.

    But if your GPU for some reason has 3.5 GB allocated to other activities, then it will have 4.5 GB left for the render. And a scene with 3 characters exceeding 4.5 Gb is very likely.

    Other activities can here also be Daz Studio, if you for instance are using Iray preview in the viewport.

    I would suggest, as a test, hide 1 or 2 characters and retry. If it then goes well for sure it is because you have run out of memory.

  • So, I am running a debug utility from the card manufacturer to monitor actual memory usage as I render. When the render crashes, I typically have around 6GB of video memory (and 20GB of system memory) free.

    Everyone insists the problem is that I am out of memory.

    How am I out of memory if I have 6GB free and am trying to allocate 5 MB of data? And for the record, the utility from EVGA, Windows Resource Monitor and Daz all report there is 4 - 6 Gb free when this error occurs.

    Also, even if I was running out of memory (again, I'm not) why would the renderer crash? Blender can render large scenes. Maya can render large scenes. Other Daz users can render large scenes. Why can't I?

  • GroveFastGroveFast Posts: 19
    edited April 2020

    Try to use an external program to monitor if you really have the memory needed available.

    I use openHW monitor while rendering to keep an eye out on GPU recourses. I have a GTX970 (wish I had your card:) ) and constantly fighting the VRAM limitation! So I need to monitor this closely. After rendering a scene I often need to restart the PC to make sure a VRAM is made available, since I see alot of garbage left in VRAM after end render. So apparently that means that data can be left in the VRAM from other software or Daz it self. I know no way to make sure it is clean, so that's why the reboot. This means that maybe ofter software (or driver issue) causes your VRAM to be allocated to other programs. This is what the open Hardware monitor softeare can give you a clue about.

    I'm new to daz and render, so my comment may be completly irrelevant / wrong, so some verification may be needed...

    Post edited by GroveFast on
  • I have been doing the renders after a reboot. When I start the render, according to both Windows monitor and the utility from eVGA, 1Gb of VRAM (of 27 Gb total, including shared) is available.This is including having the Daz preview showing the scene. When the render crashes, both of those tools show about 6Gb remaining free. That amount of free memory is also shown in the error message itself.

    I do agree, after doing a successful render (typically I can only manage that of 1-2 Gen 8 characters standing in an empty room) there is a lot of memory left unreleased. However, I have found that if I reopen Daz, it clears out that used VRAM.

Sign In or Register to comment.