Cycles HIP-RT Memory leak #120702

Open
opened 2024-04-16 16:20:26 +02:00 by Robin-Snyders · 16 comments

Note

For the upcoming release #121050 will fix the issue. For older releases the fix will be available in a future driver update.
This note was written in August 2024.

System Information
Operating system: Windows 11
Graphics card: 7800XT

Blender Version
Broken: 4.1.0
Worked: Never (new graphics card)

Short description of error
When rendering animation using HIP and AMD GPU, after a certain amount of frames rendered (usually about 500) my VRAM is full. It's only starting at about 4Gb and build up overtime until VRAM is full and render crahes. I'm pretty sure it's because the render is not flushing VRAM between frames which seems to be a VRAM leak.

Exact steps for others to reproduce the error
Render a simple animation scene for the error to appear faster depending on your amount of VRAM this could take a while (about 500-600 frames for me)
Look at the VRAM usage and watch it grow until it's full and blender becomes unresponsive

Each task manager screenshots are spaced by a few minutes (frame render takes about 10secs)
PS : On the screenshots, in french "Mémoire du GPU dédiée" is VRAM usage

> [!NOTE] > For the upcoming release #121050 will fix the issue. For older releases the fix will be available in a future driver update. > This note was written in August 2024. **System Information** Operating system: Windows 11 Graphics card: 7800XT **Blender Version** Broken: 4.1.0 Worked: Never (new graphics card) **Short description of error** When rendering animation using HIP and AMD GPU, after a certain amount of frames rendered (usually about 500) my VRAM is full. It's only starting at about 4Gb and build up overtime until VRAM is full and render crahes. I'm pretty sure it's because the render is not flushing VRAM between frames which seems to be a VRAM leak. **Exact steps for others to reproduce the error** Render a simple animation scene for the error to appear faster depending on your amount of VRAM this could take a while (about 500-600 frames for me) Look at the VRAM usage and watch it grow until it's full and blender becomes unresponsive Each task manager screenshots are spaced by a few minutes (frame render takes about 10secs) PS : On the screenshots, in french "Mémoire du GPU dédiée" is VRAM usage
Robin-Snyders added the
Type
Report
Severity
Normal
Status
Needs Triage
labels 2024-04-16 16:20:26 +02:00
Member

I can reproduce the issue with the setup listed below.
I could only reproduce this issue when using HIP-RT. HIP seemed to be fine with no noticable increase in VRAM usage after 200 frames.

Testing can be sped up by reducing the sample count and render resolution, and turning off denoising. This issue plagues Blender 4.0.2 and 3.6.X as well meaning this issue has been present since the introduction of HIP-RT. I will mark as "high priority" due to it impacting all versions of Blender with this feature.

System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: AMD Radeon RX 7800 XT ATI Technologies Inc. 4.6.0 Core Profile Context 24.2.1.240215
Blender version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: 40a5e739e270

I can reproduce the issue with the setup listed below. I could only reproduce this issue when using HIP-RT. HIP seemed to be fine with no noticable increase in VRAM usage after 200 frames. Testing can be sped up by reducing the sample count and render resolution, and turning off denoising. This issue plagues Blender 4.0.2 and 3.6.X as well meaning this issue has been present since the introduction of HIP-RT. I will mark as "high priority" due to it impacting all versions of Blender with this feature. **System Information** Operating system: Windows-10-10.0.22631-SP0 64 Bits Graphics card: AMD Radeon RX 7800 XT ATI Technologies Inc. 4.6.0 Core Profile Context 24.2.1.240215 Blender version: 4.1.0, branch: blender-v4.1-release, commit date: 2024-03-25 20:42, hash: `40a5e739e270`
Alaska changed title from Blender 4.1 HIP Memory leak to Cycles HIP-RT Memory leak 2024-04-17 04:41:47 +02:00
CC @salipour

@salipour Have you had a chance to look at this? Can you reproduce the issue? Do you think it will be solved by upgrading to the open source version, or is this an existing issue in the Cycles integration code?

@salipour Have you had a chance to look at this? Can you reproduce the issue? Do you think it will be solved by upgrading to the open source version, or is this an existing issue in the Cycles integration code?
Member

@salipour Have you had a chance to look at this? Can you reproduce the issue?

Sort of. Frame one was using around under 6 GB and by frame 50, the usage had increased to 8 GB. Is it an issue just with HIPRT? With HIP I see the same behaviour. I tried on a different system but regardless the first frame was at 2.2 and by 20th frame, VRAM was up to 2.6. Anyway, I'd dig a bit more.

> @salipour Have you had a chance to look at this? Can you reproduce the issue? Sort of. Frame one was using around under 6 GB and by frame 50, the usage had increased to 8 GB. Is it an issue just with HIPRT? With HIP I see the same behaviour. I tried on a different system but regardless the first frame was at 2.2 and by 20th frame, VRAM was up to 2.6. Anyway, I'd dig a bit more.
Member

Is it an issue just with HIPRT? With HIP I see the same behaviour.

In my testing, VRAM usage when using HIP with BVH2 seems to stay relatively steady at 3.3GB after the first frame is rendered.

It's only HIP-RT that has the constantly growing memory usage for me.

System Information
Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: AMD Radeon RX 7800 XT ATI Technologies Inc. 4.6.0 Core Profile Context 24.5.1.240502
Blender version: 4.1.1, branch: blender-v4.1-release, commit date: 2024-04-15 15:11, hash: e1743a0317bc

> Is it an issue just with HIPRT? With HIP I see the same behaviour. In my testing, VRAM usage when using HIP with BVH2 seems to stay relatively steady at 3.3GB after the first frame is rendered. It's only HIP-RT that has the constantly growing memory usage for me. **System Information** Operating system: Windows-10-10.0.22631-SP0 64 Bits Graphics card: AMD Radeon RX 7800 XT ATI Technologies Inc. 4.6.0 Core Profile Context 24.5.1.240502 Blender version: 4.1.1, branch: blender-v4.1-release, commit date: 2024-04-15 15:11, hash: `e1743a0317bc`
Member

It seems the leak is somewhere in the hiprt runtime. I will keep you posted.

It seems the leak is somewhere in the hiprt runtime. I will keep you posted.
Member

The issue is now resolved in the latest HIP-RT SDK. I think it is too late to push it to Blender 4.2 . I expect it to become available in Blender 4.3.

The issue is now resolved in the latest HIP-RT SDK. I think it is too late to push it to Blender 4.2 . I expect it to become available in Blender 4.3.
Brecht Van Lommel added this to the 4.3 milestone 2024-06-11 21:18:50 +02:00

Thanks, I set the milestone to 4.3.

Thanks, I set the milestone to 4.3.

@salipour Can we backport the fix of this issue to blender 4.2’s version of hiprt sdk? Since 4.2 is a LTS version, I don’t think keep such an issue in it is a good choice.

@salipour Can we backport the fix of this issue to blender 4.2’s version of hiprt sdk? Since 4.2 is a LTS version, I don’t think keep such an issue in it is a good choice.
Member

We can do that, but it will require the user to update their driver (no Blender change is required). We are working to get open-sourced HIP-RT integrated in Blender 4.3 and eliminate any driver dependency.

We can do that, but it will require the user to update their driver (no Blender change is required). We are working to get open-sourced HIP-RT integrated in Blender 4.3 and eliminate any driver dependency.

Thanks for reply, so in current implementation, hiprt binary is delivered by gpu driver rather than blender? Maybe we could add a warning to users to update their gpu driver.

Thanks for reply, so in current implementation, hiprt binary is delivered by gpu driver rather than blender? Maybe we could add a warning to users to update their gpu driver.
Brecht Van Lommel added
Type
Bug
and removed
Type
Report
labels 2024-06-14 15:59:27 +02:00

@salipour @bartvdbraak I am a bit unsure about state here. Do we need to update some SDK on the buildbot still?
Or is #121050 the fix for this issue?

@salipour @bartvdbraak I am a bit unsure about state here. Do we need to update some SDK on the buildbot still? Or is #121050 the fix for this issue?
Member

No need to update the SDK. For upcoming version of Blender, the fix is already in #121050. For previous versions of Blender, the fix is in the driver.

No need to update the SDK. For upcoming version of Blender, the fix is already in #121050. For previous versions of Blender, the fix is in the driver.
Member

If I remember my previous test results correctly, it seems like the memory leak has been reduced with the latest GPU drivers, but isn't fully resolved.

According to both Windows task manager and AMD Software: Adrenalin Edition, VRAM memory usage continues to climb as more and more frames are rendered with HIP-RT. This issue isn't present with HIP with BVH2.

Rendering 1500 frames with BVH2 starts with and ends with ~3GB of VRAM usage.
Rendering 1500 frames with HIP-RT starts with ~3GB of VRAM and ends with ~12GB of VRAM.

RAM also sees a increase in utilization as each frame is rendered with HIP-RT.

After 2473 frames rendered, the AMD GPU driver complains that "Blender requested more GPU memory than is avaliable in this system" and tells the user to close Blender.

Operating system: Windows-10-10.0.22631-SP0 64 Bits
Graphics card: AMD Radeon RX 7800 XT ATI Technologies Inc. 4.6.0 Core Profile Context 24.7.1.240711

If I remember my previous test results correctly, it seems like the memory leak has been reduced with the latest GPU drivers, but isn't fully resolved. According to both Windows task manager and `AMD Software: Adrenalin Edition`, VRAM memory usage continues to climb as more and more frames are rendered with HIP-RT. This issue isn't present with HIP with BVH2. Rendering 1500 frames with BVH2 starts with and ends with ~3GB of VRAM usage. Rendering 1500 frames with HIP-RT starts with ~3GB of VRAM and ends with ~12GB of VRAM. RAM also sees a increase in utilization as each frame is rendered with HIP-RT. After 2473 frames rendered, the AMD GPU driver complains that "Blender requested more GPU memory than is avaliable in this system" and tells the user to close Blender. Operating system: Windows-10-10.0.22631-SP0 64 Bits Graphics card: AMD Radeon RX 7800 XT ATI Technologies Inc. 4.6.0 Core Profile Context 24.7.1.240711
Member

@Alaska, my apologies, in my previous comment, I should have said "the fix will be in the driver." I don't think the driver is yet publicly available.

@Alaska, my apologies, in my previous comment, I should have said "the fix _will be_ in the driver." I don't think the driver is yet publicly available.

@salipour Thanks for the clarification. I've updated the description to make this info more instantly visible for people looking into the high-severity reports.

@salipour Thanks for the clarification. I've updated the description to make this info more instantly visible for people looking into the high-severity reports.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#120702
No description provided.