Open UtkarshKunwar opened 4 years ago
I have a similar problem, also with Nvidia graphics (proprietary drivers, version 450) on an Optimus laptop. I don't notice an immediate performance problem, but each instance of GLava I open causes Xorg to consume an additional ~500MB of VRAM.
I ran into this issue recently as well and just found a solution for it (hopefully).
inxi -F:
Graphics: Device-1: Intel driver: i915 v: kernel
Device-2: NVIDIA GP107GLM [Quadro P1000 Mobile] driver: nvidia v: 440.59
Display: x11 server: X.Org 1.20.5 driver: modesetting,nvidia
unloaded: fbdev,nouveau,vesa resolution: 1920x1080~60Hz
OpenGL: renderer: Quadro P1000/PCIe/SSE2 v: 4.6.0 NVIDIA 440.59
nvidia-smi before launch:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59 Driver Version: 440.59 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P1000 Off | 00000000:01:00.0 Off | N/A |
| N/A 57C P0 N/A / N/A | 193MiB / 4042MiB | 9% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1104 G /usr/lib/xorg/Xorg 126MiB |
| 0 1682 G cinnamon 65MiB |
+-----------------------------------------------------------------------------+
FPS/UPS console output:
...
FPS: 15.71, UPS: 14.72
FPS: 15.61, UPS: 15.61
FPS: 15.45, UPS: 15.45
FPS: 15.55, UPS: 15.55
FPS: 15.73, UPS: 15.73
FPS: 15.55, UPS: 15.55
FPS: 15.47, UPS: 15.47
FPS: 15.52, UPS: 15.52
FPS: 15.51, UPS: 15.51
FPS: 15.54, UPS: 15.54
FPS: 15.47, UPS: 15.47
FPS: 15.70, UPS: 15.70
...
nvidia-smi after launch:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59 Driver Version: 440.59 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P1000 Off | 00000000:01:00.0 Off | N/A |
| N/A 61C P0 N/A / N/A | 3952MiB / 4042MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1104 G /usr/lib/xorg/Xorg 3844MiB |
| 0 1682 G cinnamon 65MiB |
| 0 8004 G glava 40MiB |
+-----------------------------------------------------------------------------+
What worked for me was simply opening NVIDIA X Server Settings, navigating to XScreen 0 > Antialiasing Settings and fooling around with the settings there. There seems to be some sort of issue with having 'Use Application Settings' selected here for some reason. It seemed like most configurations worked well, aside from pumping AA up to 64x. I eventually settled on selecting 'Enhance Application Settings' and checking the box next to 'Enable FXAA'.
FPS/UPS console output:
...
FPS: 112.58, UPS: 105.60
FPS: 112.30, UPS: 111.31
FPS: 112.74, UPS: 106.76
FPS: 109.42, UPS: 108.43
FPS: 112.33, UPS: 106.36
FPS: 111.84, UPS: 111.84
FPS: 109.00, UPS: 107.02
FPS: 111.21, UPS: 107.24
FPS: 112.75, UPS: 111.75
FPS: 110.90, UPS: 109.90
FPS: 113.58, UPS: 112.60
FPS: 113.19, UPS: 111.20
FPS: 112.75, UPS: 111.75
FPS: 113.62, UPS: 109.63
FPS: 111.94, UPS: 109.94
FPS: 111.95, UPS: 106.95
FPS: 109.85, UPS: 109.85
FPS: 113.31, UPS: 110.33
...
nvidia-smi output:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.59 Driver Version: 440.59 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Quadro P1000 Off | 00000000:01:00.0 Off | N/A |
| N/A 71C P0 N/A / N/A | 281MiB / 4042MiB | 100% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1104 G /usr/lib/xorg/Xorg 168MiB |
| 0 1682 G cinnamon 61MiB |
| 0 8435 G glava 50MiB |
+-----------------------------------------------------------------------------+
@epmancini can confirm that this workaround works for me. But I still don't think it should require tinkering with the NVIDIA X Server Settings.
Edit: After saving the settings and logging out and logging back in, it's back to the same memory hogging (I have added glava
in the autostart programs in KDE). I have to kill that instance and launch it again for it to work with this workaround. For now I have changed the command of glava
in the program to sleep 10 && glava
and it seems to be temporarily working.
I found more compact solution. Thanks @epm0dev for a hint. Just execute and add this to autostart:
nvidia-settings -a "FSAAAppControlled=0"
More details: https://download.nvidia.com/XFree86/FreeBSD-x86_64/530.41.03/README/openglenvvariables.html
I was struggling with this issue of exorbitant GPU memory usage by Xorg on my Kubuntu 18.04 until someone told me to try killing Glava (which showed only about 20MB GPU memory usage). My laptop temperatures were really high, the fans were constantly on at full speed, and my DE was lagging like crazy. And indeed after killing Glava, Xorg started behaving normally and my GPU memory usage dropped from 3.7GB/4GB to just a measly 479MB.
However, Glava runs just fine when I switch to the weaker intel graphics. No throttling or performance issues whatsover. This happens only when I switch to the higher perfomance NVIDIA graphics.
Here are the outputs from the
nvidia-smi
command with Glava running and after a couple of minutes of force-closing.While running Glava:
After killing Glava: