Viewport Compositing: Scale node does not render correctly, uses a lot of VRAM in 4.1 and crashes in 4.2 #120857

Closed
opened 2024-04-20 17:55:41 +02:00 by Fabien · 9 comments

System Information
Operating system: Windows 11
Graphics card: RTX 3090

Blender Version
Broken: 4.2 alpha (026f8e8bdf - 20/04/2024)
Worked: 4.0

Short description of error
Since 4.1, Viewport compositing Scale using Render Size mode does not give identical results between Viewport and Final Compositing.
The Viewport Compositing of the attached graph also requires a lot more GPU memory, from 3GB to 12GB.
In 4.2, the scene crashes, randomly but 100% reproducible.

Exact steps for others to reproduce the error
The attached scene has a compositing graph that creates a fullscreen animated random value using a noise texture that is scaled to the render size and offset using Scene time.

  • Open the scene and render one frame using F12 to see the final compositing version.
  • Turn on Viewport Compositing.
  • Notice that the Viewport Compositing renders the Scale node with Render Size mode differently from the Final Compositing.
  • In 4.2, simply scrub or select compositing nodes to trigger a crash.

image

**System Information** Operating system: Windows 11 Graphics card: RTX 3090 **Blender Version** Broken: 4.2 alpha (026f8e8bdf68 - 20/04/2024) Worked: 4.0 **Short description of error** Since 4.1, Viewport compositing Scale using Render Size mode does not give identical results between Viewport and Final Compositing. The Viewport Compositing of the attached graph also requires a lot more GPU memory, from 3GB to 12GB. In 4.2, the scene crashes, randomly but 100% reproducible. **Exact steps for others to reproduce the error** The attached scene has a compositing graph that creates a fullscreen animated random value using a noise texture that is scaled to the render size and offset using Scene time. - Open the scene and render one frame using F12 to see the final compositing version. - Turn on Viewport Compositing. - Notice that the Viewport Compositing renders the Scale node with Render Size mode differently from the Final Compositing. - In 4.2, simply scrub or select compositing nodes to trigger a crash. ![image](/attachments/7a28a111-6710-4100-ae7a-7ad720c85151)
Fabien added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2024-04-20 17:55:42 +02:00

I can confirm crash in latest 4.2.
But, for some reason, in today lite debug build, with msvc debugging, i getting:
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in blender.exe.

>	ntdll.dll!DbgBreakPoint()	Unknown
 	ntdll.dll!DbgUiRemoteBreakin()	Unknown
 	kernel32.dll!00007ff9dd1c7344()	Unknown
 	ntdll.dll!RtlUserThreadStart()	Unknown
I can confirm crash in latest 4.2. But, for some reason, in today lite debug build, with msvc debugging, i getting: `A breakpoint instruction (__debugbreak() statement or a similar call) was executed in blender.exe.` ``` > ntdll.dll!DbgBreakPoint() Unknown ntdll.dll!DbgUiRemoteBreakin() Unknown kernel32.dll!00007ff9dd1c7344() Unknown ntdll.dll!RtlUserThreadStart() Unknown ```
@OmarEmaraDev /
Member

I can't reproduce the crash myself. Does anyone get a proper stack trace?
@chafouin Do you get any crash file written?

I can't reproduce the crash myself. Does anyone get a proper stack trace? @chafouin Do you get any crash file written?
Author

The crash txt file is empty for me.

The crash txt file is empty for me.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2024-04-21 14:28:44 +02:00
Fabien reopened this issue 2024-04-21 14:29:34 +02:00
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2024-04-21 14:29:37 +02:00
Author

Sorry, I misclicked on the "Comment and Close" button.

Address : 0x00007FF68A6E4099
Module  : blender.exe
Thread  : 00001d9c
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFD62351421
Module  : VCRUNTIME140.dll
Thread  : 00002904
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFD62351421
Module  : VCRUNTIME140.dll
Thread  : 0000047c
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFD62351421
Module  : VCRUNTIME140.dll
Thread  : 00003120
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFD62351421
Module  : VCRUNTIME140.dll
Thread  : 00005d54
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFD62351421
Module  : VCRUNTIME140.dll
Thread  : 000025a4
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF68A6E4A0A
Module  : blender.exe
Thread  : 00004d70
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF68A6E4099
Module  : blender.exe
Thread  : 0000065c
Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt
Error loading symbols C:\Users\fabie\Desktop\blender-4.2.0-alpha+main.026f8e8bdf68-windows.amd64-release\blender.pdb
        error:0xc0000005
        size = 95629312
        base=0x00007FF689FD0000

As mentioned above, that crash.txt file is empty.

Sorry, I misclicked on the "Comment and Close" button. ```Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF68A6E4099 Module : blender.exe Thread : 00001d9c Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FFD62351421 Module : VCRUNTIME140.dll Thread : 00002904 Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FFD62351421 Module : VCRUNTIME140.dll Thread : 0000047c Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FFD62351421 Module : VCRUNTIME140.dll Thread : 00003120 Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FFD62351421 Module : VCRUNTIME140.dll Thread : 00005d54 Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FFD62351421 Module : VCRUNTIME140.dll Thread : 000025a4 Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF68A6E4A0A Module : blender.exe Thread : 00004d70 Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF68A6E4099 Module : blender.exe Thread : 0000065c Writing: C:\Users\fabie\AppData\Local\Temp\randomvalue_viewportcomp.crash.txt Error loading symbols C:\Users\fabie\Desktop\blender-4.2.0-alpha+main.026f8e8bdf68-windows.amd64-release\blender.pdb error:0xc0000005 size = 95629312 base=0x00007FF689FD0000 ``` As mentioned above, that crash.txt file is empty.
Iliya Katushenock added
Status
Confirmed
and removed
Status
Needs Triage
labels 2024-04-21 14:45:47 +02:00
Member

With regards to the difference between the viewport and final render, this is expected and is a limitation of the viewport compositor, because it clips huge images to sizes that can fit on the GPU. Noting that you are creating images that are 262144 x 262144 in size, which can occupy hundreds of gigabytes of memory.

As for the crash, it is probably related to that huge allocation, and I suspect it is not related to the viewport compositor, but rather, the CPU compositor. Can you try to confirm that by disabling backdrop, closing the image editor and just leaving the 3d view?

With regards to the difference between the viewport and final render, this is expected and is a limitation of the viewport compositor, because it clips huge images to sizes that can fit on the GPU. Noting that you are creating images that are `262144 x 262144` in size, which can occupy hundreds of gigabytes of memory. As for the crash, it is probably related to that huge allocation, and I suspect it is not related to the viewport compositor, but rather, the CPU compositor. Can you try to confirm that by disabling backdrop, closing the image editor and just leaving the 3d view?
Member

@chafouin I submitted a fix for review. But even with the fix, the huge image sizes you are working with will eventually prompt the OS to kill Blender. You need to fix your node tree to avoid the "scale by a factor of 512" bit. It is probably not intentional and not something you want anyways.

@chafouin I submitted a fix for review. But even with the fix, the huge image sizes you are working with will eventually prompt the OS to kill Blender. You need to fix your node tree to avoid the "scale by a factor of 512" bit. It is probably not intentional and not something you want anyways.
Author

With regards to the difference between the viewport and final render, this is expected and is a limitation of the viewport compositor, because it clips huge images to sizes that can fit on the GPU.

This used to work in 4.0 though, the Scale using Stretch is now stretching the entire image to the render resolution, instead of applying a simple ratio multiplier based on the render resolution.

Noting that you are creating images that are 262144 x 262144 in size, which can occupy hundreds of gigabytes of memory.

Wow okay, I understand why its happening after the scaling, I didn't expect it to actually create such a large image... I know it's a dumb way to create a random value, but I was expecting it to give single pixel to the entire frame.
Having a random value node would be extremely helpful.

As for the crash, it is probably related to that huge allocation, and I suspect it is not related to the viewport compositor, but rather, the CPU compositor. Can you try to confirm that by disabling backdrop, closing the image editor and just leaving the 3d view?

Indeed, it seems to be fine with just the Viewport compositing on. Thanks for looking into it and for the fix.

> With regards to the difference between the viewport and final render, this is expected and is a limitation of the viewport compositor, because it clips huge images to sizes that can fit on the GPU. This used to work in 4.0 though, the Scale using Stretch is now stretching the entire image to the render resolution, instead of applying a simple ratio multiplier based on the render resolution. > Noting that you are creating images that are 262144 x 262144 in size, which can occupy hundreds of gigabytes of memory. Wow okay, I understand why its happening after the scaling, I didn't expect it to actually create such a large image... I know it's a dumb way to create a random value, but I was expecting it to give single pixel to the entire frame. Having a random value node would be extremely helpful. > As for the crash, it is probably related to that huge allocation, and I suspect it is not related to the viewport compositor, but rather, the CPU compositor. Can you try to confirm that by disabling backdrop, closing the image editor and just leaving the 3d view? Indeed, it seems to be fine with just the Viewport compositing on. Thanks for looking into it and for the fix.
Member

This used to work in 4.0 though, the Scale using Stretch is now stretching the entire image to the render resolution, instead of applying a simple ratio multiplier based on the render resolution.

That's true, because in 4.0, we delayed transformations, so scaling never took place at the scale node. This was changed in 4.1 to match the CPU compositor. But GPUs have limitations on how large an image can be, hence the difference and clipping I mentioned. We will probably bring back the 4.0 behavior partially though.

Having a random value node would be extremely helpful.

This is planned. See #112732.

> This used to work in 4.0 though, the Scale using Stretch is now stretching the entire image to the render resolution, instead of applying a simple ratio multiplier based on the render resolution. That's true, because in 4.0, we delayed transformations, so scaling never took place at the scale node. This was changed in 4.1 to match the CPU compositor. But GPUs have limitations on how large an image can be, hence the difference and clipping I mentioned. We will probably bring back the 4.0 behavior partially though. > Having a random value node would be extremely helpful. This is planned. See #112732.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-04-23 09:44:49 +02:00
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#120857
No description provided.