Page MenuHome

Adaptive subdivision modifier takes to much memory
Confirmed, NormalPublicTO DO

Description

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.

Event Timeline

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.

Hi. I made a simplified version of the file:


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:

However this object doesn't seem to exist in that scene:

If you change that field to Cylinder.003

it won't crash when switching to "Material Properties" tab any more.

Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Thu, Feb 6, 6:20 PM

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]

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.

Brecht Van Lommel (brecht) reopened this task as Confirmed.Thu, Feb 6, 6:44 PM

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 T53901: Cycles adaptive subdivision tasks.

Bastien Montagne (mont29) edited projects, added Cycles, Render & Cycles; removed Modifiers.
Bastien Montagne (mont29) changed the subtype of this task from "Report" to "To Do".