Skip to content

Gazebo Harmonic WSLg memory leak #2873

@UavYuriyS

Description

@UavYuriyS

When I run a world with meshes in WSL2, I experience memory leak in the gz sim gui process which can be tracked both from inside the VM with htop and from outside with the Task Manager

Environment

  • OS Version: WSL Ubuntu-22.04
  • Source or binary build?
    • Binary build, Gazebo Sim, version 8.9.0, Harmonic
  • If this is a GUI or sensor rendering bug, describe your GPU and rendering system. Otherwise delete this section.
  • There are warnings [GUI] [Wrn] [ColladaLoader.cc:2395] Triangle input semantic: 'COLOR' is currently not supported and [GUI] [Wrn] [Ogre2Heightmap.cc:125] Heightmap final sampling should be 2^n
  • running on a dual GPU machine (integrated GPU + discrete GPU)
  • running on a multi-GPU machine (it has multiple discrete GPUs)
  • running on real hardware
  • running in virtual machine: WSLg
  • running in Docker/Singularity, No, but the issue persists in Doсker too.
  • running remotely (e.g. via SSH)
  • running in a cloud
  • using VirtualGL, XVFB, Xdummy, XVNC or other indirect rendering utilities
  • GPU is concurrently used for other tasks
    • desktop acceleration
    • video decoding (i.e. a playing Youtube video)
    • video encoding
    • CUDA/ROCm computations (Tensorflow, Torch, Caffe running)
    • multiple simulators running at the same time
  • other...
    • Rendering system info:
      • On Linux, provide the outputs of the following commands:
        LANG=C glxinfo -B | grep -i '\(direct rendering\|opengl\|profile\)'
        direct rendering: Yes
        Preferred profile: core (0x1)
        Max core profile version: 4.2
        Max compat profile version: 4.2
        Max GLES1 profile version: 1.1
        Max GLES[23] profile version: 3.1
        OpenGL vendor string: Microsoft Corporation
        OpenGL renderer string: D3D12 (NVIDIA GeForce RTX 4070 SUPER)
        OpenGL core profile version string: 4.2 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.3
        OpenGL core profile shading language version string: 4.20
        OpenGL core profile context flags: (none)
        OpenGL core profile profile mask: core profile
        OpenGL version string: 4.2 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.3
        OpenGL shading language version string: 4.20
        OpenGL context flags: (none)
        OpenGL profile mask: compatibility profile
        OpenGL ES profile version string: OpenGL ES 3.1 Mesa 23.2.1-1ubuntu3.1~22.04.3
        OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
        
        kotik    3680518  0.0  0.0   4024  2032 pts/4    S+   15:38   0:00 grep --color=auto Xorg
      • On Windows, run dxdiag and report the GPU-related information.
      • On Mac OS, open a terminal and type system_profiler SPDisplaysDataType. Copy the output here.
    • Please, attach the ogre.log or ogre2.log file from ~/.gz/rendering

Description

  • Expected behavior: Gazebo works and does not hog memory
  • Actual behavior: Gazebo slowly eats all the memory, starts swapping and makes the machine unusable. Setting LIBGL_ALWAYS_SOFTWARE to 1 helps, but it is a no-solution because it disables GPU and makes everything excruciatingly slow

This is the world I'm using to test
drone_scene_repro.txt

Here is my ogre2 log
ogre2.log

And dxdiag to boot
DxDiag.txt

Steps to reproduce

  1. Work on a machine with WSL2 and NVIDIA GPU installed
  2. Launch the world I provided with LIBGL_ALWAYS_SOFTWARE=0 gz sim drone_scene_repro.txt -v, observe memory leak.
  3. Launch the world I provided with LIBGL_ALWAYS_SOFTWARE=1 gz sim drone_scene_repro.txt -v, and observe NO memory leak

Output

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions