Cycles: CUDA takes ages to render what takes seconds on CPU and OPTIX (it also needs way more RAM) #93089

Open
opened 2021-11-15 09:20:14 +01:00 by Raimund Klink · 19 comments
Contributor

System Information
Operating system: Windows-11-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65

Blender Version
Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash: dc2d180181, 2.93, 2.92
Worked: I think it was always the case

Short description of error
The dino demo file (Splash Blender 2.92 https://cloud.blender.org/p/gallery/60337d495677e942564cce76) takes with CUDA (BVH2) way longer to build the scene than CPU (Embree).
It also needs a lot more RAM.
Ca. 100GB of RAM

CUDA (BVH2)
Fra:1 Mem:1175.90M (Peak 51547.35M) | Time:21:52.48 | Compositing | De-initializing execution
Saved: 'C:\tmp\0001.png'
 Time: 21:53.12 (Saving: 00:00.63)
Optix (Embree)
Fra:2 Mem:1176.06M (Peak 14002.25M) | Time:00:36.55 | Compositing | De-initializing execution
Saved: 'C:\tmp\0002.png'
 Time: 00:37.16 (Saving: 00:00.60)
CPU (Embree)
Fra:1 Mem:1175.90M (Peak 14007.17M) | Time:01:08.57 | Compositing | De-initializing execution
Saved: 'C:\tmp\0001.png'
 Time: 01:09.21 (Saving: 00:00.63)

Exact steps for others to reproduce the error

  1. Open the scene
  2. Set it to one sample (disable denoising)
  3. Render with CPU, CUDA and OPTIX to compare.
**System Information** Operating system: Windows-11-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65 **Blender Version** Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash: `dc2d180181`, 2.93, 2.92 Worked: I think it was always the case **Short description of error** The dino demo file (Splash Blender 2.92 https://cloud.blender.org/p/gallery/60337d495677e942564cce76) takes with CUDA (BVH2) way longer to build the scene than CPU (Embree). It also needs a lot more RAM. Ca. 100GB of RAM ``` CUDA (BVH2) Fra:1 Mem:1175.90M (Peak 51547.35M) | Time:21:52.48 | Compositing | De-initializing execution Saved: 'C:\tmp\0001.png' Time: 21:53.12 (Saving: 00:00.63) Optix (Embree) Fra:2 Mem:1176.06M (Peak 14002.25M) | Time:00:36.55 | Compositing | De-initializing execution Saved: 'C:\tmp\0002.png' Time: 00:37.16 (Saving: 00:00.60) CPU (Embree) Fra:1 Mem:1175.90M (Peak 14007.17M) | Time:01:08.57 | Compositing | De-initializing execution Saved: 'C:\tmp\0001.png' Time: 01:09.21 (Saving: 00:00.63) ``` **Exact steps for others to reproduce the error** 1. Open the scene 2. Set it to one sample (disable denoising) 3. Render with CPU, CUDA and OPTIX to compare.
Author
Contributor

Added subscriber: @Raimund58

Added subscriber: @Raimund58

#98203 was marked as duplicate of this issue

#98203 was marked as duplicate of this issue

Added subscriber: @SteffenD

Added subscriber: @SteffenD
Member

Added subscriber: @leesonw

Added subscriber: @leesonw
William Leeson self-assigned this 2021-11-15 13:49:14 +01:00
Member

Currently looking into the Optix acceleration code and from what I can tell when it is compacting the accel structure the original structure is never released which may be the cause of this issue. However, this may have something to do with dynamic updates but I am not sure yet.

Currently looking into the Optix acceleration code and from what I can tell when it is compacting the accel structure the original structure is never released which may be the cause of this issue. However, this may have something to do with dynamic updates but I am not sure yet.
William Leeson removed their assignment 2021-11-15 14:58:12 +01:00
Member

Optix, did free the accel after all and this is not a regression.

Optix, did free the accel after all and this is not a regression.
Raimund Klink changed title from Cycles: CUDA takes ages to render what takes seconds on CPU and OPTIX to Cycles: CUDA takes ages to render what takes seconds on CPU and OPTIX (it also needs way more RAM) 2022-02-04 13:09:23 +01:00

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

@Raimund58 Is it possible that your system started swapping, because of RAM? Not sure how much RAM do you have. Here I did not pay attention and it crashed my system...

Checked with simplified scene I get render times 1:26 with CUDA and 0:31 with optix

@Raimund58 Is it possible that your system started swapping, because of RAM? Not sure how much RAM do you have. Here I did not pay attention and it crashed my system... Checked with simplified scene I get render times 1:26 with CUDA and 0:31 with optix
Author
Contributor

I have 32 GB of RAM.
Swap is on a SSD (Samsung EVO Plus 2TB)

blender_system_info.txt

I have 32 GB of RAM. Swap is on a SSD (Samsung EVO Plus 2TB) [blender_system_info.txt](https://archive.blender.org/developer/F12870322/blender_system_info.txt)
Author
Contributor

Here is the log:
log.txt

0002.png
Blender used around 100GB of RAM. Maybe less, maybe more.

Here is the log: [log.txt](https://archive.blender.org/developer/F12870346/log.txt) ![0002.png](https://archive.blender.org/developer/F12870350/0002.png) Blender used around 100GB of RAM. Maybe less, maybe more.
Author
Contributor

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Changed status from 'Needs User Info' to: 'Needs Developer To Reproduce'

Thanks for info. So prolonged rendering time seems to be result of swapping and not unexpected. But I assume you think this high memory usage is bug in first place correct?

@leesonw Do you think this memory usage is normal?

Thanks for info. So prolonged rendering time seems to be result of swapping and not unexpected. But I assume you think this high memory usage is bug in first place correct? @leesonw Do you think this memory usage is normal?
Author
Contributor

Added subscriber: @brecht

Added subscriber: @brecht
Author
Contributor

I don't know what is happening. But I wanted to note it and maybe get a dev to investigate a bit.
Not sure if you already know, but @leesonw is sadly not longer working for the Blender Foundation.
I am pretty sure that @brecht can give us quite fast an answer on what is happening here.

I don't know what is happening. But I wanted to note it and maybe get a dev to investigate a bit. Not sure if you already know, but @leesonw is sadly not longer working for the Blender Foundation. I am pretty sure that @brecht can give us quite fast an answer on what is happening here.

Added subscribers: @walt.talley, @lichtwerk

Added subscribers: @walt.talley, @lichtwerk
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 14:02:54 +01:00

Is this still an issue in Blender 4.0? @Raimund58

Is this still an issue in Blender 4.0? @Raimund58
Author
Contributor

Sure, still an issue.

Sure, still an issue.
Author
Contributor

Cycles stats via --debug-cycles and --cycles-print-stats
CPU:

I0228 17:07:31.569407 31552 scene.cpp:353] System memory statistics after full device sync:
  Usage: 6,805,075,796 (6.34G)
  Peak: 7,106,016,640 (6.62G)
Update statistics:
Scene:
    Total time: 14.533242s
        device_update                            14.533242s
Geometry:
    Total time: 14.214673s
        device_update (build object BVHs)        13.311438s
        device_update (copy meshes to device)    0.779098s
        device_update (attributes)               0.082814s
        device_update (build scene BVH)          0.023482s
        device_update (normals)                  0.016926s
        device_update (compute bounds)           0.000557s
        device_update_preprocess                 0.000349s
        device_update (displacement)             0.000009s

CUDA

I0228 17:14:08.034772 34060 scene.cpp:353] System memory statistics after full device sync:
  Usage: 42,607,531,740 (39.68G)
  Peak: 53,159,146,652 (49.51G)
Update statistics:
Scene:
    Total time: 318.981768s
        device_update                            318.981768s
Geometry:
    Total time: 318.742439s
        device_update (build scene BVH)          175.744799s
        device_update (build object BVHs)        133.445795s
        device_update (copy meshes to device)    9.378066s
        device_update (attributes)               0.129396s
        device_update (compute bounds)           0.027381s
        device_update (normals)                  0.016694s
        device_update_preprocess                 0.000294s
        device_update (displacement)             0.000013s

Notice the time and RAM.

I am not able to test Optix on this machine because I do not have enough VRAM.

Cycles stats via `--debug-cycles` and `--cycles-print-stats` CPU: ``` I0228 17:07:31.569407 31552 scene.cpp:353] System memory statistics after full device sync: Usage: 6,805,075,796 (6.34G) Peak: 7,106,016,640 (6.62G) Update statistics: Scene: Total time: 14.533242s device_update 14.533242s Geometry: Total time: 14.214673s device_update (build object BVHs) 13.311438s device_update (copy meshes to device) 0.779098s device_update (attributes) 0.082814s device_update (build scene BVH) 0.023482s device_update (normals) 0.016926s device_update (compute bounds) 0.000557s device_update_preprocess 0.000349s device_update (displacement) 0.000009s ``` CUDA ``` I0228 17:14:08.034772 34060 scene.cpp:353] System memory statistics after full device sync: Usage: 42,607,531,740 (39.68G) Peak: 53,159,146,652 (49.51G) Update statistics: Scene: Total time: 318.981768s device_update 318.981768s Geometry: Total time: 318.742439s device_update (build scene BVH) 175.744799s device_update (build object BVHs) 133.445795s device_update (copy meshes to device) 9.378066s device_update (attributes) 0.129396s device_update (compute bounds) 0.027381s device_update (normals) 0.016694s device_update_preprocess 0.000294s device_update (displacement) 0.000013s ``` Notice the time and RAM. I am not able to test Optix on this machine because I do not have enough VRAM.
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
6 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#93089
No description provided.