Skip to content

Memory leak in Wgpu backend #2042

Open
Open
@joshhansen

Description

Describe the bug
Memory leaks when using the Wgpu backend, but not when using the NdArray backend.

To Reproduce
A minimal reproduction is available at https://github.com/joshhansen/burnleak.

Check out the repository and cargo run --release on the master branch. Watch the memory usage. In my case, it climbs steadily upward at a rapid pace.

Then check out the master_ndarray branch and run it again. In my case, the memory usage does not climb.

Running on Wgpu but with the WgpuDevice::Cpu device slows but does not eliminate the memory leakage.

Expected behavior
The program should run without a memory leak on the Wgpu backend like it does on the NdArray backend.

Screenshots
n/a

Desktop:

  • OS: Linux Mint 21.3, kernel 6.5.0 x86_64
  • Burn: 0.13.2
  • Rust: 1.76.0
  • Nvidia driver 545.29.06-0ubuntu0.22.04.2

Additional context
Heaptrack memory leak profile:
heaptrack1

heaptrack2

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions