Materials linked to 'Object' cause increased memory usage in Cycles #109978

Open
opened 2023-07-11 18:38:50 +02:00 by slowburn · 2 comments

System Information
Operating system: Windows-11 64 Bits
Graphics card: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 535.98

Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: c7fc78b81ecb
Worked: never?

Short description of error
If an object has a material that is linked to Object (in the material tab), then such object cannot be instanced efficiently in Cycles. Each linked copy of the object uses a large amount of memory when rendering.
In this example rendering 100 instances of Suzanne takes as much memory as 1 object, if material is linked to object's data. When material is linked to object, vram usage goes up a lot.

link.jpg link2.jpg

Exact steps for others to reproduce the error

  • Open the provided .blend file
  • Render the scene and note the memory usage
  • Select all monkeys
  • Go to material tab
  • While holding Alt click on the Link drop-down menu and chose Object
  • Render again
  • You should see memory usage increase significantly
**System Information** Operating system: Windows-11 64 Bits Graphics card: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 535.98 **Blender Version** Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: `c7fc78b81ecb` Worked: never? **Short description of error** If an object has a material that is linked to Object (in the material tab), then such object cannot be instanced efficiently in Cycles. Each linked copy of the object uses a large amount of memory when rendering. In this example rendering 100 instances of Suzanne takes as much memory as 1 object, if material is linked to object's data. When material is linked to object, vram usage goes up a lot. ![link.jpg](/attachments/512ca3ac-e137-4e3a-ae41-5dedff02b87c) ![link2.jpg](/attachments/a2fbe6bd-6457-4fce-bcab-e397daec7e97) **Exact steps for others to reproduce the error** - Open the provided .blend file - Render the scene and note the memory usage - Select all monkeys - Go to material tab - While holding `Alt` click on the `Link` drop-down menu and chose Object - Render again - You should see memory usage increase significantly
slowburn added the
Status
Needs Triage
Type
Report
Priority
Normal
labels 2023-07-11 18:38:50 +02:00
Member

Thanks for the report. Can confirm the rise in RAM/VRAM usage with cycles render engine.

Link-object option associates material with object data. Since there are 100 object and only 1 mesh data block, I thought there would be 100 material instances and that's why memory consuption increased but it's not. Material tab indicates the data-block has 100 users.

Thanks for the report. Can confirm the rise in RAM/VRAM usage with cycles render engine. Link-object option associates material with object data. Since there are 100 object and only 1 mesh data block, I thought there would be 100 material instances and that's why memory consuption increased but it's not. Material tab indicates the data-block has 100 users.
Pratik Borhade added
Module
Render & Cycles
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-07-12 07:45:37 +02:00

Adding this here as it might be related:
https://archive.blender.org/developer/differential/0017/0017158/index.html
TLDR; Cycles assigns shaders to geometry not object so if a unique shader is applied to an instance, Cycles must duplicate memory. This patch is an attempt at addressing it.

Although reading above, it might be that there can be some logic to detect the same material being used and not have unique geometry data per-instance without the need for my patch in this case...

Adding this here as it might be related: https://archive.blender.org/developer/differential/0017/0017158/index.html TLDR; Cycles assigns shaders to geometry not object so if a unique shader is applied to an instance, Cycles must duplicate memory. This patch is an attempt at addressing it. Although reading above, it might be that there can be some logic to detect the same material being used and not have unique geometry data per-instance without the need for my patch in this case...
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
3 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#109978
No description provided.