https://bugs.kde.org/show_bug.cgi?id=524042

            Bug ID: 524042
           Summary: kontact uses all my gpu memory
    Classification: Applications
           Product: kontact
      Version First 6.7.3
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

DESCRIPTION

Kontact was left running by itself and used all my GPU memory:

```
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 610.57.04              KMD Version: 610.57.04     CUDA UMD
Version: 13.3     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile
Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util 
Compute M. |
|                                         |                        |           
   MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3070        Off |   00000000:01:00.0 Off |           
      N/A |
|  0%   32C    P8             11W /  220W |    7788MiB /   8192MiB |      3%   
  Default |
|                                         |                        |           
      N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                   
          |
|  GPU   GI   CI              PID   Type   Process name                       
GPU Memory |
|        ID   ID                                                              
Usage      |
|=========================================================================================|
|    0   N/A  N/A          447637    C+G   /usr/bin/kontact                    
  7776MiB |
+-----------------------------------------------------------------------------------------+
```

The leak is in the main `kontact` process itself, not in the QtWebEngine
renderer
subprocesses — those stay at ~20 MB RSS each. The main process had also grown
to
7.4 GB RSS after ~6 days of uptime:

```
$ grep VmRSS /proc/447637/status
VmRSS:   7448104 kB

$ ps -o pid,etime,cmd -C kontact
    PID     ELAPSED CMD
 447637  06:33:05 /usr/bin/kontact

$ ps --ppid 447637 -o pid,rss,cmd
    PID   RSS CMD
 447674 20128 /usr/lib/qt6/QtWebEngineProcess --type=zygote --no-zygote-sandbox
...
 447675 20396 /usr/lib/qt6/QtWebEngineProcess --type=zygote ...
```

The RSS and the GPU allocation track each other closely, which looks like GPU
buffers being allocated and never released rather than one large allocation.

This is a hybrid-graphics machine: Plasma itself runs on the Intel UHD 770
iGPU,
but the kontact process has the NVIDIA EGL/GLX stack mapped in and is holding
memory on the discrete GPU:

```
$ grep -oE '/[^ ]*(nvidia|libGL|EGL)[^ ]*' /proc/447637/maps | sort -u
/dev/nvidia0
/dev/nvidiactl
/usr/lib/libEGL_mesa.so.0.0.0
/usr/lib/libEGL_nvidia.so.610.57.04
/usr/lib/libGLX_nvidia.so.610.57.04
/usr/lib/libnvidia-eglcore.so.610.57.04
/usr/lib/libnvidia-egl-gbm.so.1.1.3
/usr/lib/libnvidia-egl-wayland.so.1.1.21
/usr/lib/libnvidia-glcore.so.610.57.04
...
```

STEPS TO REPRODUCE
1. Start Kontact on a Wayland session with an NVIDIA GPU present (here: Intel
iGPU
   drives the desktop, NVIDIA RTX 3070 as secondary GPU, nvidia-open-dkms
610.57.04).
2. Leave it running and idle for several days without restarting it.
3. Watch `nvidia-smi` and the process RSS over time.

OBSERVED RESULT

After ~6 days of idle uptime, the kontact process is holding 7776 MiB of the
GPU's 8192 MiB of VRAM and 7.4 GB of system RAM. The GPU is effectively full,
so other GPU workloads fail to allocate. GPU utilisation is only 3-5% and the
card is in P8, so nothing is actively rendering — the memory is just never
freed. Restarting Kontact releases all of it.
The HTML Message view area is not working, and has not been working for a
while, and I can't view email in their own window either.

EXPECTED RESULT

It's not even supposed to use the Nvidia GPU, the Intel GPU drives the desktop
and everything else, including the browser I'm typing this in. Nothing is
plugged into the Nvidia GPU and I'm only using it for acceleration (apparently
accelerating my email now)

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.7.4
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1

ADDITIONAL INFORMATION

kontact 26.04.3-1 (Arch)
qt6-webengine 6.11.1-5
Kernel: 7.1.5-arch1-2 (64-bit)
Graphics Platform: Wayland
CPU: 12th Gen Intel Core i7-12700 (20 threads)
RAM: 64 GiB
Primary GPU: Mesa Intel UHD Graphics 770
Secondary GPU: NVIDIA GeForce RTX 3070, nvidia-open-dkms / nvidia-utils
610.57.04

Relevant environment on the affected process (not sure if it matters):
QT_WAYLAND_RECONNECT=1
QT_DEBUG_PLUGINS=1

I have not isolated which component is responsible. If it would help I can
run Kontact with only specific plugins enabled (KMail, KOrganizer, Akregator,
etc.) to narrow it down, or something else.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to