Cycles Motion Blur + python bpy.context leads to error and VRAM overload #49797
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#49797
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Win10, 16Go RAM, gtx 980 6GB
Blender 2.78
SUMMARY:
Very specific nagging bug.
When rendering with cycles motion blur (GPU) enabled and running an addon containing 'bpy.context.active_object' inside a persistent function, blender generates an error and over loads the VRAM, leading to CUDA error: out of memory while rendering.
STEPS:
Set the renderer to Cycles, using the default scene
Install and enable the attached addon : addon_vram_overload.py
Switch to GPU compute and enable Motion Blur
Start rendering 100 frames
Monitor the VRAM usage with GPU-Z for example, or wait until Out of Memory error message appear.
You can check the console: AtributeError 'Context' object has no attribute 'active_object'
Now replace this line in the addon:
ob = bpy.context.active_object
by this one:
print("")
Render the animation again
The VRAM is no more overloaded.
COMMENT:
So yes, the workaround in python would be easy, it's all about avoiding the error:
The problem is it happens on several scripts already used by a lot of users. Is there a way to resolve this memory consumption when this error occurs?
Thanks for your great works!
Changed status to: 'Open'
Added subscriber: @LucasVeber
Added subscriber: @YAFU
This issue was referenced by blender/blender@32c2cba4ef
Changed status from 'Open' to: 'Resolved'
Thanks Lucas for the clear report and thank Sergey for the fix.
This problem had given me more of a headache with some addons, and some people out there having this problem but without them knowing exactly why.
Thanks!
Thanks for quick fix Sergey!