Unreasonable NVIDIA GPU VRAM usage on gnome-shell

Bug #1823544 reported by Luca Osvaldo Mastromatteo
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gnome-shell (Ubuntu)
Expired
High
Unassigned

Bug Description

GPU: NVIDIA GTX 1060 3GB
Ubuntu: 19.04, Kernel Linux luky-pc 5.0.0-8-generic #9-Ubuntu SMP Tue Mar 12 21:58:11 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
NVIDIA driver version: 418.56
Display settings: BenQ XL2411Z, 144Hz monitor, 1920x1080p

I have noticed this strange behavior only on gnome-shell where the overall gnome-shell desktop VRAM usage was taking up to 1GB of GPU VRAM which does not happen on other desktops, or on Windows, happens after some hours of normal desktop usage
Even the system RAM increases a lot during normal usage, but remains acceptable

This behaviour can be observed by using "nvidia-smi" a tool from the NVIDIA proprietary driver

gnome-shell VRAM usage on a cold start: 139MB, + 9 MB
X.org VRAM usage on cold start: 48MB + 18MB
Total: 214MB

gnome-shell VRAM usage after some hours of normal usage: 445MB + 83 MB
X.org VRAM usage after some hours of normal usage: 244MB + 18MB
Total: 800MB

On windows or other desktops the GPU VRAM usage remains the same
---
ProblemType: Bug
ApportVersion: 2.20.10-0ubuntu25
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
DisplayManager: gdm3
DistroRelease: Ubuntu 19.04
NonfreeKernelModules: nvidia_modeset nvidia
Package: gnome-shell 3.32.0-1ubuntu1
PackageArchitecture: amd64
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=it_IT.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 5.0.0-8.9-generic 5.0.1
Tags: disco
Uname: Linux 5.0.0-8-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip libvirt lpadmin plugdev sambashare sudo
_MarkForUpload: True

Revision history for this message
Luca Osvaldo Mastromatteo (lukycrociato) wrote :
Revision history for this message
Luca Osvaldo Mastromatteo (lukycrociato) wrote :

vram usage on fresh start

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks for the detailed bug report. Unfortunately we do still need more system information so please run:

 apport-collect 1823544

on the affected machine.

tags: added: disco
tags: added: nvidia performance
Changed in gnome-shell (Ubuntu):
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Note to self and others:

I suspect using HEAP_PROFILE_MMAP=true with Google Heap Profiler would help here.

https://gperftools.github.io/gperftools/heapprofile.html

Revision history for this message
Luca Osvaldo Mastromatteo (lukycrociato) wrote : Dependencies.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Luca Osvaldo Mastromatteo (lukycrociato) wrote : GsettingsChanges.txt

apport information

Revision history for this message
Luca Osvaldo Mastromatteo (lukycrociato) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

Please try uninstalling these extensions:

b'org.gnome.shell' b'enabled-extensions' b"['<email address hidden>', 'freon@UshakovVasilii_Github.yahoo.com', '<email address hidden>', '<email address hidden>', '<email address hidden>']"

As any extension could indirectly cause graphics memory to be leaked.

Changed in gnome-shell (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Luca Osvaldo Mastromatteo (lukycrociato) wrote :
Download full text (3.3 KiB)

Ok, fine

I uninstalled any non-official GNOME extension and in cold start I'm getting after 1.2h of uptime 200MB more than the normal, I am not 100% sure but I think this still persist

Cold start:
 +-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 106... Off | 00000000:1C:00.0 On | N/A |
| 51% 30C P0 28W / 120W | 225MiB / 3011MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1501 G /usr/lib/xorg/Xorg 18MiB |
| 0 1559 G /usr/bin/gnome-shell 49MiB |
| 0 2017 G /usr/lib/xorg/Xorg 44MiB |
| 0 2154 G /usr/bin/gnome-shell 109MiB |
+-----------------------------------------------------------------------------+

1.2h of uptime

Mon Apr 8 13:53:34 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.56 Driver Version: 418.56 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 106... Off | 00000000:1C:00.0 On | N/A |
| 55% 33C P8 9W / 120W | 447MiB / 3011MiB | 0% Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1501 G /usr/lib/xorg/Xorg 18MiB |
| 0 1559 G /usr/bin/gnome-shell 49MiB |
| 0 2017 G /usr/lib/xorg/Xorg 124MiB |
| 0 2154 G /usr/bin/gnome-shell ...

Read more...

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks.

The original bug (comments #1-#2) shows gnome-shell graphics memory grew:

  139MB -> 445MB

And after removing extensions it is:

  109MB -> 204MB

So there is still a large amount of growth, but it appears most of the problem was triggered by extensions. I think we would need a longer amount of time to see just how high it goes, to get a clearer picture of what improvement removing extensions makes.

Still, we should keep this bug open to investigate GPU memory usage in general.

Changed in gnome-shell (Ubuntu):
importance: High → Medium
status: Incomplete → New
Revision history for this message
Luca Osvaldo Mastromatteo (lukycrociato) wrote :

Yes but the amount of time I kept in the first test was not the same, I just do not have enough time to test

In the first one my PC was up for almost a day unlike the second scenario where the uptime was just 1h and a couple of minutes

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thanks. That suggests removing extensions might not have helped.

Still, at some point in future we'll need to investigate this in more detail. And before that, maybe test over a longer period of time.

Changed in gnome-shell (Ubuntu):
importance: Medium → High
Revision history for this message
Volodymyr Boichentsov (sakristx) wrote :

I've experienced same issue. Kept my machine running overnight with open gnome-shells.

On the morning GPU-Util was about 95% and memory usage ~500 mb for each tab

Cold start:
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1422 G /usr/lib/xorg/Xorg 73MiB |
| 0 1640 G /usr/bin/gnome-shell 118MiB |
| 0 4194 G /usr/lib/xorg/Xorg 379MiB |
| 0 4326 G /usr/bin/gnome-shell 257MiB |

System:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

5.0.0-31-generic x86_64

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-shell (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Thank you for reporting this bug to Ubuntu.
Ubuntu 19.04 (disco) reached end-of-life on January 23, 2020.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in and change the bug status to Confirmed.

Changed in gnome-shell (Ubuntu):
status: Confirmed → Won't Fix
status: Won't Fix → Incomplete
tags: removed: disco
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gnome-shell (Ubuntu) because there has been no activity for 60 days.]

Changed in gnome-shell (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.