Adaptive subdivision modifier takes to much memory #73564

Closed
opened 2020-02-03 14:32:58 +01:00 by Torbjörn Richt · 20 comments

System Information
Operating system: Win Version 10.0.18362 Build 18362

Graphics card: dual GTX 1080 ti

Blender Version
Broken: 2.83.1
Worked: (optional)

Short description of error
Adaptive subdivision modifier takes way to much memory

Exact steps for others to reproduce the error
was playing with the Adaptive subdivision modifier and was trying out different values in offscreen and max subdivisions scale under render properties when all of a sudden this scene now wants 87 Gb of memory when rendering.
Even if I take away the modifier completely it still wants 87 Gb of memory when rendering. Something happened..
Before I made the above changes I had 6 copies of the cylinder far in the background, they where rendered but did not take more than 8 Gb in total. They where deleted before changes in properties.

treelog.blend

**System Information** Operating system: Win Version 10.0.18362 Build 18362 Graphics card: dual GTX 1080 ti **Blender Version** Broken: 2.83.1 Worked: (optional) **Short description of error** Adaptive subdivision modifier takes way to much memory **Exact steps for others to reproduce the error** was playing with the Adaptive subdivision modifier and was trying out different values in offscreen and max subdivisions scale under render properties when all of a sudden this scene now wants 87 Gb of memory when rendering. Even if I take away the modifier completely it still wants 87 Gb of memory when rendering. Something happened.. Before I made the above changes I had 6 copies of the cylinder far in the background, they where rendered but did not take more than 8 Gb in total. They where deleted before changes in properties. [treelog.blend](https://archive.blender.org/developer/F8318984/treelog.blend)

Added subscriber: @mrTorb

Added subscriber: @mrTorb

#102535 was marked as duplicate of this issue

#102535 was marked as duplicate of this issue

#100915 was marked as duplicate of this issue

#100915 was marked as duplicate of this issue
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

Notes for a more experienced triager:

Hitting F12 to render will cause a crash. However, just having the 'bark' material in the shader editor will lead to a crash in under a minute, even in 'solid' display mode. The bark material is the only one set to 'displacement and bump,' and the only one with a tangent normal map and a displacement map. Even if I turn off the subsurf modifier and take cycles out of experimental mode, it will still crash with the same errors when trying to render it.

I keep getting errors like

Calloc returns null: len=2684354560 in CDMEdge, total 1292060908
Calloc returns null: len=1073741824 in CDMLoopUV, total 1292097308
Calloc returns null: len=1073741824 in CDMLoopUV, total 1292140836
Calloc returns null: len=2147483648 in CDMLoop, total 1292313388
Calloc returns null: len=2147483648 in CDMLoop, total 1023987044
Calloc returns null: len=1342177304 in subdiv accumulated normals, total 1024028736
Calloc returns null: len=1879048200 in subdiv accumulated counters, total 1023993792
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF79DBCAD67

and

mesh_ensure_tessellation_customdata: warning! Tessellation uvs or vcol data got out of sync, had to reset!
    CD_MTFACE: 0 != CD_MLOOPUV: 2 || CD_MCOL: 0 != CD_MLOOPCOL: 1
Calloc returns null: len=2684354560 in CDMEdge, total 1008295484
Calloc returns null: len=1073741824 in CDMLoopUV, total 1008297980
Calloc returns null: len=1073741824 in CDMLoopUV, total 1008396620
Calloc returns null: len=1342177280 in CDMPoly, total 3155881156
Calloc returns null: len=2684354560 in CDMEdge, total 3155881636
Calloc returns null: len=1342177280 in CDMPoly, total 3155881636
Calloc returns null: len=1342177304 in subdiv accumulated normals, total 3155881636
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF79DBCAD67
Module  : C:\blender-git\build_windows_x64_vc16_Release\bin\Release\blender.exe

Model is a cylinder with 2 32 vert N-GON caps, which turn into a triangle fan with a high 32 valence vertex in the center with 1 level of simple sudiv. OpenSubdiv isn't a fan of such topology.

I have tried fixing the N-GONS but it has been crashing before I can.

Notes for a more experienced triager: Hitting `F12` to render will cause a crash. However, just having the 'bark' material in the shader editor will lead to a crash in under a minute, even in 'solid' display mode. The bark material is the only one set to 'displacement and bump,' and the only one with a tangent normal map and a displacement map. Even if I turn off the subsurf modifier and take cycles out of experimental mode, it will still crash with the same errors when trying to render it. I keep getting errors like ``` Calloc returns null: len=2684354560 in CDMEdge, total 1292060908 Calloc returns null: len=1073741824 in CDMLoopUV, total 1292097308 Calloc returns null: len=1073741824 in CDMLoopUV, total 1292140836 Calloc returns null: len=2147483648 in CDMLoop, total 1292313388 Calloc returns null: len=2147483648 in CDMLoop, total 1023987044 Calloc returns null: len=1342177304 in subdiv accumulated normals, total 1024028736 Calloc returns null: len=1879048200 in subdiv accumulated counters, total 1023993792 Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF79DBCAD67 ``` and ``` mesh_ensure_tessellation_customdata: warning! Tessellation uvs or vcol data got out of sync, had to reset! CD_MTFACE: 0 != CD_MLOOPUV: 2 || CD_MCOL: 0 != CD_MLOOPCOL: 1 Calloc returns null: len=2684354560 in CDMEdge, total 1008295484 Calloc returns null: len=1073741824 in CDMLoopUV, total 1008297980 Calloc returns null: len=1073741824 in CDMLoopUV, total 1008396620 Calloc returns null: len=1342177280 in CDMPoly, total 3155881156 Calloc returns null: len=2684354560 in CDMEdge, total 3155881636 Calloc returns null: len=1342177280 in CDMPoly, total 3155881636 Calloc returns null: len=1342177304 in subdiv accumulated normals, total 3155881636 Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF79DBCAD67 Module : C:\blender-git\build_windows_x64_vc16_Release\bin\Release\blender.exe ``` Model is a cylinder with 2 32 vert N-GON caps, which turn into a triangle fan with a high 32 valence vertex in the center with 1 level of simple sudiv. OpenSubdiv isn't [a fan of such topology.](http://graphics.pixar.com/opensubdiv/docs/subdivision_surfaces.html#arbitrary-topology) I have tried fixing the N-GONS but it has been crashing before I can.

Added subscriber: @MarcinTwarowski

Added subscriber: @MarcinTwarowski

Hi. I made a simplified version of the file:
treelog_simplified.blend
Simply switch from "Render Properties" tab to "Material Properties" tab. It should crash within seconds.
However, I noticed that in the "Texture Coordinate" node there's a Cylinder object referenced:
obraz.png
However this object doesn't seem to exist in that scene:
obraz.png
If you change that field to Cylinder.003
obraz.png
it won't crash when switching to "Material Properties" tab any more.

Hi. I made a simplified version of the file: [treelog_simplified.blend](https://archive.blender.org/developer/F8322966/treelog_simplified.blend) Simply switch from "Render Properties" tab to "Material Properties" tab. It should crash within seconds. However, I noticed that in the "Texture Coordinate" node there's a **Cylinder** object referenced: ![obraz.png](https://archive.blender.org/developer/F8322975/obraz.png) However this object doesn't seem to exist in that scene: ![obraz.png](https://archive.blender.org/developer/F8322978/obraz.png) If you change that field to **Cylinder.003** ![obraz.png](https://archive.blender.org/developer/F8322982/obraz.png) it won't crash when switching to "Material Properties" tab any more.

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I catched few multi-GB allocs:

>	blender.exe!customData_add_layer__internal(CustomData * data, int type, eCDAllocType alloctype, void * layerdata, int totelem, const unsigned char * name) Line 2321	C

 	blender.exe!CustomData_merge(const CustomData * source, CustomData * dest, unsigned __int64 mask, eCDAllocType alloctype, int totelem) Line 1914	C
 	blender.exe!CustomData_copy(const CustomData * source, CustomData * dest, unsigned __int64 mask, eCDAllocType alloctype, int totelem) Line 1961	C
 	blender.exe!BKE_mesh_new_nomain_from_template_ex(const Mesh * me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len, CustomData_MeshMasks mask) Line 712	C
 	blender.exe!subdiv_mesh_topology_info(const SubdivForeachContext * foreach_context, const int num_vertices, const int num_edges, const int num_loops, const int num_polygons) Line 509	C
 	blender.exe!BKE_subdiv_foreach_subdiv_geometry(Subdiv * subdiv, const SubdivForeachContext * context, const SubdivToMeshSettings * mesh_settings, const Mesh * coarse_mesh) Line 1812	C
 	blender.exe!BKE_subdiv_to_mesh(Subdiv * subdiv, const SubdivToMeshSettings * settings, const Mesh * coarse_mesh) Line 1195	C
 	blender.exe!subdiv_as_mesh(SubsurfModifierData * smd, const ModifierEvalContext * ctx, Mesh * mesh, Subdiv * subdiv) Line 166	C
 	blender.exe!applyModifier(ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh) Line 232	C
 	blender.exe!modwrap_applyModifier(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 962	C
 	blender.exe!mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Line 1187	C
 	blender.exe!mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Line 1817	C
 	blender.exe!makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Line 1931	C
 	blender.exe!BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 186	C
 	blender.exe!BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 356	C
 	[Externí kód]	
 	blender.exe!DEG::`anonymous namespace'::evaluate_node(const DEG::`anonymous-namespace'::DepsgraphEvalState * state, DEG::OperationNode * operation_node) Line 117	C++
 	blender.exe!DEG::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata, int thread_id) Line 129	C++
 	blender.exe!handle_local_queue(TaskThreadLocalStorage * tls, const int thread_id) Line 421	C
 	blender.exe!task_scheduler_thread_run(void * thread_p) Line 460	C
 	[Externí kód]	
I catched few multi-GB allocs: ``` > blender.exe!customData_add_layer__internal(CustomData * data, int type, eCDAllocType alloctype, void * layerdata, int totelem, const unsigned char * name) Line 2321 C blender.exe!CustomData_merge(const CustomData * source, CustomData * dest, unsigned __int64 mask, eCDAllocType alloctype, int totelem) Line 1914 C blender.exe!CustomData_copy(const CustomData * source, CustomData * dest, unsigned __int64 mask, eCDAllocType alloctype, int totelem) Line 1961 C blender.exe!BKE_mesh_new_nomain_from_template_ex(const Mesh * me_src, int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len, CustomData_MeshMasks mask) Line 712 C blender.exe!subdiv_mesh_topology_info(const SubdivForeachContext * foreach_context, const int num_vertices, const int num_edges, const int num_loops, const int num_polygons) Line 509 C blender.exe!BKE_subdiv_foreach_subdiv_geometry(Subdiv * subdiv, const SubdivForeachContext * context, const SubdivToMeshSettings * mesh_settings, const Mesh * coarse_mesh) Line 1812 C blender.exe!BKE_subdiv_to_mesh(Subdiv * subdiv, const SubdivToMeshSettings * settings, const Mesh * coarse_mesh) Line 1195 C blender.exe!subdiv_as_mesh(SubsurfModifierData * smd, const ModifierEvalContext * ctx, Mesh * mesh, Subdiv * subdiv) Line 166 C blender.exe!applyModifier(ModifierData * md, const ModifierEvalContext * ctx, Mesh * mesh) Line 232 C blender.exe!modwrap_applyModifier(ModifierData * md, const ModifierEvalContext * ctx, Mesh * me) Line 962 C blender.exe!mesh_calc_modifiers(Depsgraph * depsgraph, Scene * scene, Object * ob, int useDeform, const bool need_mapping, const CustomData_MeshMasks * dataMask, const int index, const bool use_cache, const bool allow_shared_mesh, Mesh * * r_deform, Mesh * * r_final) Line 1187 C blender.exe!mesh_build_data(Depsgraph * depsgraph, Scene * scene, Object * ob, const CustomData_MeshMasks * dataMask, const bool need_mapping) Line 1817 C blender.exe!makeDerivedMesh(Depsgraph * depsgraph, Scene * scene, Object * ob, BMEditMesh * em, const CustomData_MeshMasks * dataMask) Line 1931 C blender.exe!BKE_object_handle_data_update(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 186 C blender.exe!BKE_object_eval_uber_data(Depsgraph * depsgraph, Scene * scene, Object * ob) Line 356 C [Externí kód] blender.exe!DEG::`anonymous namespace'::evaluate_node(const DEG::`anonymous-namespace'::DepsgraphEvalState * state, DEG::OperationNode * operation_node) Line 117 C++ blender.exe!DEG::`anonymous namespace'::deg_task_run_func(TaskPool * pool, void * taskdata, int thread_id) Line 129 C++ blender.exe!handle_local_queue(TaskThreadLocalStorage * tls, const int thread_id) Line 421 C blender.exe!task_scheduler_thread_run(void * thread_p) Line 460 C [Externí kód] ```

Closed as duplicate of #70530

Closed as duplicate of #70530

Added subscriber: @brecht

Added subscriber: @brecht

Adaptive subdivision is not properly working yet in 2.80, and will subdivide the mesh both in Blender and Cycles. This is a known issue, one of the reasons it is still an experimental feature.

Adaptive subdivision is not properly working yet in 2.80, and will subdivide the mesh both in Blender and Cycles. This is a known issue, one of the reasons it is still an experimental feature.

Changed status from 'Duplicate' to: 'Confirmed'

Changed status from 'Duplicate' to: 'Confirmed'

There may be more to this bug, but basically anything that fails when adaptive subdivision is disabled is not a bug, but rather something to be listed on #53901 (Cycles adaptive subdivision tasks).

There may be more to this bug, but basically anything that fails when adaptive subdivision is disabled is not a bug, but rather something to be listed on #53901 (Cycles adaptive subdivision tasks).

Added subscriber: @DirSurya

Added subscriber: @DirSurya

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'

Listed as a limitation in #53901, so this report is redundant.

Listed as a limitation in #53901, so this report is redundant.

Added subscribers: @Nielsf, @OmarEmaraDev, @mano-wii

Added subscribers: @Nielsf, @OmarEmaraDev, @mano-wii

Added subscriber: @BlueNovaAnimation

Added subscriber: @BlueNovaAnimation
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#73564
No description provided.