VRAM is not being freed when rendering (Invalid graphics context in cuGraphicsUnregisterResource) #95631

Closed
opened 2022-02-09 05:57:38 +01:00 by Flynn Duniho · 15 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65

Blender Version
Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-08 11:12, hash: de71860555
Worked: 3.0.1.0 from the Microsoft Store

Short description of error
When I render a simple scene

, the VRAM usage steadily increases until it stops rendering with the error "system is out of gpu memory." This is reproduceable, I had to render about 165 frames at 1080p for the memory to run out, but it was consistent. The usage would not reset back to the idle 13% (I was monitoring using the Windows Game bar). The VRAM usage would reset if I restarted Blender. The only way I could render the entire animation was by rendering until it gave the error, restarting Blender, then resuming the render at the frame that it had stopped. I tested Blender version 3.0.1.0 and it works just fine, the VRAM usage is staying steady as I render, as expected.

Exact steps for others to reproduce the error
[Please describe the exact steps needed to reproduce the issue]
[Based on the default startup or an attached .blend file (as simple as possible)]
Render the animation. The test scene that I made: Test.blend

**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.65 **Blender Version** Broken: version: 3.1.0 Beta, branch: master, commit date: 2022-02-08 11:12, hash: `de71860555` Worked: 3.0.1.0 from the Microsoft Store **Short description of error** When I render a simple scene , the VRAM usage steadily increases until it stops rendering with the error "system is out of gpu memory." This is reproduceable, I had to render about 165 frames at 1080p for the memory to run out, but it was consistent. The usage would not reset back to the idle 13% (I was monitoring using the Windows Game bar). The VRAM usage would reset if I restarted Blender. The only way I could render the entire animation was by rendering until it gave the error, restarting Blender, then resuming the render at the frame that it had stopped. I tested Blender version 3.0.1.0 and it works just fine, the VRAM usage is staying steady as I render, as expected. **Exact steps for others to reproduce the error** [Please describe the exact steps needed to reproduce the issue] [Based on the default startup or an attached .blend file (as simple as possible)] Render the animation. The test scene that I made: [Test.blend](https://archive.blender.org/developer/F12856737/Test.blend)
Author

Added subscriber: @flynn03

Added subscriber: @flynn03
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

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

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

Can you try the latest 3.2 daily build and check if the problem persists? https://builder.blender.org/download/daily/

Did you notice any particular feature that starts to leak memory when used? Or does it happen even in the simplest files?

Can you try the latest 3.2 daily build and check if the problem persists? https://builder.blender.org/download/daily/ Did you notice any particular feature that starts to leak memory when used? Or does it happen even in the simplest files?
Author

I tried the 3.2 daily build last night, the problem still persisted. Even the simple file that I had included, with just the cube and camera, cause an issue after about 100 frames.

I tried the 3.2 daily build last night, the problem still persisted. Even the simple file that I had included, with just the cube and camera, cause an issue after about 100 frames.
Member

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

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

Added subscriber: @wannes.malfait

Added subscriber: @wannes.malfait
Member

I could not reproduce this on my laptop with NVIDIA GeForce GTX 1050 and 2GB VRAM. The VRAM usage was consistent throughout the 400 frames in the attached blend file.

I could not reproduce this on my laptop with NVIDIA GeForce GTX 1050 and 2GB VRAM. The VRAM usage was consistent throughout the 400 frames in the attached blend file.
Author

Interesting. This is what I get: https://youtu.be/kZFrhL54pOo
I also tried downloading the newest build of Blender 3.2, without importing my old preferences, and I still have this issue. I'm not really sure what's going on or how I'm seemingly the only person having this issue. I even tried rendering with no addons enabled (except the cycles render engine) and it still runs out of memory.

Interesting. This is what I get: https://youtu.be/kZFrhL54pOo I also tried downloading the newest build of Blender 3.2, without importing my old preferences, and I still have this issue. I'm not really sure what's going on or how I'm seemingly the only person having this issue. I even tried rendering with no addons enabled (except the cycles render engine) and it still runs out of memory.
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I tried it again, because I realised I was rendering with CPU + GPU. When I render with GPU only I can reproduce the same problems. Sorry for the confusion.

When the "leaking" happens this is printed in the console:

Invalid graphics context in cuGraphicsUnregisterResource(cu_graphics_resource_) (C:\Blender-git\blender\intern\cycles\device\cuda\graphics_interop.cpp:36)

Since that code seems to free some resources this could be the source of the leak. This is not printed when rendering with CPU + GPU. It could also be unrelated and have to do with some weird issues with my blender build.

I tried it again, because I realised I was rendering with CPU + GPU. When I render with GPU only I can reproduce the same problems. Sorry for the confusion. When the "leaking" happens this is printed in the console: ``` Invalid graphics context in cuGraphicsUnregisterResource(cu_graphics_resource_) (C:\Blender-git\blender\intern\cycles\device\cuda\graphics_interop.cpp:36) ``` Since that code seems to free some resources this could be the source of the leak. This is not printed when rendering with CPU + GPU. It could also be unrelated and have to do with some weird issues with my blender build.
Philipp Oeser changed title from VRAM is not being freed when rendering to VRAM is not being freed when rendering (Invalid graphics context in cuGraphicsUnregisterResource) 2022-02-18 10:17:25 +01:00
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

We now have #95837 (Regression: GPU memory accumulation in Cycles render) with the same error message. Not sure if this is exactly the same (it probably is), but I've made that one High priority.

We now have #95837 (Regression: GPU memory accumulation in Cycles render) with the same error message. Not sure if this is exactly the same (it probably is), but I've made that one High priority.

This issue was referenced by e4b7d52fe4

This issue was referenced by e4b7d52fe4fe3076f5f68ff575c200f5cf16e416

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sergey Sharybin self-assigned this 2022-02-18 15:32:33 +01: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
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#95631
No description provided.