Cycles slows down gradually when rendering multiple times(not related to temperature) #114671

Open
opened 2023-11-09 15:00:15 +01:00 by Ahmet-Dara-Vefa · 3 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.56

Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: c7fc78b81ecb
Broken: version 4.0.0 beta v40(november 9 release) commit link-> https://projects.blender.org/blender/blender/commit/aaf69376314f
Worked: -

Short description of error
Cycles render times gradually get worse when rendering repeatedly. This is not because of heating as the problem continues if you stop the renders and restart it after a while.
Rendering an empty scene repeatedly starts at around 0.07 seconds and keeps increasing gradually to 0.08-0.09-0.10(I recorded up to 0.54). After stopping for a while and restarting the renders, it still continues from around the last interval, it never drops back.
Issue persists when using either CPU or GPU
This is not the case in Eevee.
The only solution I found was restarting blender.

Exact steps for others to reproduce the error
Either use the attached blend file or follow until step9:

  1. open blender
  2. switch engine to cycles
  3. set render samples to 1
  4. turn off "Denoise"
  5. turn off "Use Tiling"
  6. turn on "Persistent Data"(issue continues with persistent data turned on or off)
  7. set render resolution to 128x128
  8. remove everything from the scene except the camera
  9. toggle System Console on
  10. in the scripting panel, create a new file, attach the following code which renders the scene multiple times until you press keyboard interrupt(ctrl + C) on system console
  11. run script
  12. while rendering, observe the render times increase gradually.
  13. interrupt execution
  14. Wait a bit and go back to step 11
  15. restart blender and go back to step 9, you'll see the render times become normal again.

Feel free to test on CPU or GPU or with eevee(eevee works correctly)

import bpy
import os, tempfile
tmp = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
try:
    bpy.context.scene.render.filepath = tmp.name

    while True:
        bpy.ops.render.render(write_still = True)

finally:
    tmp.close()
**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1060 3GB/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.56 **Blender Version** Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash: `c7fc78b81ecb` Broken: version 4.0.0 beta v40(november 9 release) commit link-> https://projects.blender.org/blender/blender/commit/aaf69376314f Worked: - **Short description of error** Cycles render times gradually get worse when rendering repeatedly. This is not because of heating as the problem continues if you stop the renders and restart it after a while. Rendering an empty scene repeatedly starts at around 0.07 seconds and keeps increasing gradually to 0.08-0.09-0.10(I recorded up to 0.54). After stopping for a while and restarting the renders, it still continues from around the last interval, it never drops back. Issue persists when using either CPU or GPU This is not the case in Eevee. The only solution I found was restarting blender. **Exact steps for others to reproduce the error** Either use the attached blend file or follow until step9: 1. open blender 2. switch engine to cycles 3. set render samples to 1 4. turn off "Denoise" 5. turn off "Use Tiling" 6. turn on "Persistent Data"(issue continues with persistent data turned on or off) 7. set render resolution to 128x128 8. remove everything from the scene except the camera 9. toggle System Console on 10. in the scripting panel, create a new file, attach the following code which renders the scene multiple times until you press keyboard interrupt(ctrl + C) on system console 11. run script 12. while rendering, observe the render times increase gradually. 13. interrupt execution 14. Wait a bit and go back to step 11 15. restart blender and go back to step 9, you'll see the render times become normal again. Feel free to test on CPU or GPU or with eevee(eevee works correctly) ``` import bpy import os, tempfile tmp = tempfile.NamedTemporaryFile(delete=False, suffix='.png') try: bpy.context.scene.render.filepath = tmp.name while True: bpy.ops.render.render(write_still = True) finally: tmp.close() ```
Ahmet-Dara-Vefa added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-11-09 15:00:15 +01:00

Thanks for the report, I can confirm it, although the difference is very subtle:
00:00.03 to 00:00.08 after 5 minutes

This report reminded me of this other one:
#112830: Program lags after iterative script calls to bpy.ops.render when using Cycles renderer

This other one, however, is much more obvious, affects viewport in general but only affects Windows (not Linux).

**System Information**
Operating system: Windows-10-10.0.23580-SP0 64 Bits
Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.6.0 Core Profile Context 23.20.13.01.230915
version: 4.1.0 Alpha
Thanks for the report, I can confirm it, although the difference is very subtle: `00:00.03` to `00:00.08` after 5 minutes This report reminded me of this other one: #112830: Program lags after iterative script calls to bpy.ops.render when using Cycles renderer This other one, however, is much more obvious, affects viewport in general but only affects Windows (not Linux). ``` **System Information** Operating system: Windows-10-10.0.23580-SP0 64 Bits Graphics card: AMD Radeon(TM) Graphics ATI Technologies Inc. 4.6.0 Core Profile Context 23.20.13.01.230915 version: 4.1.0 Alpha ```

Good catch; I didn't see that issue when I searched for a similar one. Similar to that issue; my entire OS lagged when I was running a similar script for a long time even though task manager showed very little resource consumption.

Additionally, my new test shows swapping back and forth from rendering with cycles to eevee reduces eevee's performance as well.

import bpy
import os, tempfile


tmp = tempfile.NamedTemporaryFile(delete=False, suffix='.png')
count = 0
try:
    bpy.context.scene.render.filepath = tmp.name

    while True:
        bpy.context.scene.render.engine = 'CYCLES'
        print("CYCLES" + str(count))
        for x in range (100):        
            bpy.ops.render.render(write_still = True)
            
        print("EEVEE" + str(count))
        gc.collect()
        bpy.context.scene.render.engine = 'BLENDER_EEVEE'
        for x in range (100):        
            bpy.ops.render.render(write_still = True)
        count+=100

finally:
    tmp.close()

Perhaps adding the performance label to the other issue and closing this issue will be better.

Good catch; I didn't see that issue when I searched for a similar one. Similar to that issue; my entire OS lagged when I was running a similar script for a long time even though task manager showed very little resource consumption. Additionally, my new test shows swapping back and forth from rendering with cycles to eevee reduces eevee's performance as well. ``` import bpy import os, tempfile tmp = tempfile.NamedTemporaryFile(delete=False, suffix='.png') count = 0 try: bpy.context.scene.render.filepath = tmp.name while True: bpy.context.scene.render.engine = 'CYCLES' print("CYCLES" + str(count)) for x in range (100): bpy.ops.render.render(write_still = True) print("EEVEE" + str(count)) gc.collect() bpy.context.scene.render.engine = 'BLENDER_EEVEE' for x in range (100): bpy.ops.render.render(write_still = True) count+=100 finally: tmp.close() ``` Perhaps adding the performance label to the other issue and closing this issue will be better.

Perhaps adding the performance label to the other issue and closing this issue will be better.

We can leave it up to the Render & Cycles team to decide.

> Perhaps adding the performance label to the other issue and closing this issue will be better. We can leave it up to the `Render & Cycles` team to decide.
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
2 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#114671
No description provided.