High Xorg VRAM usage

When I ran nvidia-smi, I noticed ~1GiB VRAM usage. Out of which Xorg uses ~400MiB. Brave uses around ~400MiB too so I am not sure if this is normal or a memory leak. I did re-install Pop!_OS 20.04 several times and this issue still persists. However, I have not installed any other distro like Ubuntu/Fedora/Arch on this machine as System76 provides CUDA with their PPA and I don’t want to give that up as I need CUDA for AI.

Also, my monitor currently runs at 4K60. I thought high res + relatively high frame rate would be the reason behind this insane VRAM usage so I switched to 1080p60 and rebooted. But nothing changed. I still saw ~1GB VRAM usage.

─┬─[ pts/0 0 21-04-10 12:38:14 ]
 ├─[ flameboi: atheistd ▶ /home/atheistd ]
 ╰─> nvidia-smi                                                                                                                                                                                                                                                                         
Sat Apr 10 12:38:15 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.67       Driver Version: 460.67       CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| 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  GeForce RTX 3070    Off  | 00000000:09:00.0  On |                  N/A |
| 40%   42C    P5    22W / 220W |   1306MiB /  7979MiB |     16%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      2287      G   /usr/lib/xorg/Xorg                102MiB |
|    0   N/A  N/A      3312      G   /usr/lib/xorg/Xorg                642MiB |
|    0   N/A  N/A      3869      G   /usr/bin/gnome-shell              191MiB |
|    0   N/A  N/A      6743      G   ...AAAAAAAAA= --shared-files      352MiB |
|    0   N/A  N/A      7737      G   gnome-control-center                3MiB |
+-----------------------------------------------------------------------------+
─┬─[ pts/0 0 21-04-10 12:38:15 ]
 ├─[ flameboi: atheistd ▶ /home/atheistd ]
 ╰─> apt list --installed | grep nvidia | grep driver                                                                                                                                                                                                                                   

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

nvidia-driver-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed]
─┬─[ pts/0 0 21-04-10 12:38:47 ]
 ├─[ flameboi: atheistd ▶ /home/atheistd ]
 ╰─> apt list --installed | grep nvidia | grep xorg                                                                                                                                                                                                                                     

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

xserver-xorg-video-nvidia-460/focal,now 460.67-1pop0~1616430777~20.04~71e1ad1 amd64 [installed,automatic]
─┬─[ pts/0 130 21-04-10 12:39:36 ]
 ├─[ flameboi: atheistd ▶ /home/atheistd ]
 ╰─> uname -a                                                                                                                                                                                                                                                                           
Linux flameboi 5.11.0-7612-generic #13~1617215757~20.04~97a8d1a-Ubuntu SMP Thu Apr 1 21:15:20 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
─┬─[ pts/0 0 21-04-10 12:39:56 ]
 ├─[ flameboi: atheistd ▶ /home/atheistd ]
 ╰─> lsb_release -a                                                                                                                                                                                                                                                                     
No LSB modules are available.
Distributor ID:	Pop
Description:	Pop!_OS 20.04 LTS
Release:	20.04
Codename:	focal
─┬─[ pts/0 0 21-04-10 12:40:15 ]
 ├─[ flameboi: atheistd ▶ /home/atheistd ]
 ╰─> apt-cache show xserver-xorg | grep Version                                                                                                                                                                                                                                         
Version: 1:7.7+19ubuntu14

Its linux you can install it on any distro

This sounds very normal for 4K on gnome… heres 1080p on gnome

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      3529      G   /usr/lib/Xorg                     359MiB |
|    0   N/A  N/A      3952      G   /usr/bin/gnome-shell              103MiB |
|    0   N/A  N/A      6519      G   ...e/Steam/ubuntu12_32/steam       19MiB |
|    0   N/A  N/A      8868      G   ./steamwebhelper                    2MiB |
|    0   N/A  N/A      9088      G   /home/eric/.local/share/          128MiB |
|    0   N/A  N/A   1002059      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   1008932      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   1861399      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   1908066      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   1908920      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   1913728      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   1996084      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   2106307      G   ...AAAAAAAA== --shared-files       36MiB |
|    0   N/A  N/A   2755670      G   ...AAAAAAAAA= --shared-files       26MiB |
|    0   N/A  N/A   2906320      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A   4021035      G   ./ts3client_linux_amd64             3MiB |
+-----------------------------------------------------------------------------+

You have 8GB of vram. you will be fine. If you dont want Xorg using as much consider a different desktop environment or distro

If you really want CUDA, a nice experience but still want to be light weight… go to Manjaro XFCE… its about as seemless out of the box as system76 and installing CUDA on arch is as simple as following the wiki

https://wiki.archlinux.org/index.php/GPGPU#CUDA

But if im honest with you thats a very normal number.

I know, but I kinda love Pop. A lot of small things are taken care of from the get-go.

Oh, okay, thanks. Just wanted to make sure I wasn’t the only one with high VRAM usage. :slight_smile:

Ehhh?

Like what? Even the window tiling and ease of installing drivers on every linux distro. Do please stay on pop but I want everyone to know all the good distros have what pop is. Its nice that the system76 developers have put energy into it though :+1: I definitely enjoyed pop until it got in my way :slight_smile:

its not high its normal. Not even close to high. LOL God speed :wink:

To push forward something thats only half a meme… Unused memory is wasted memory

Have not tried using pop-shell on other distros, but I know it works on other distros.

I know what you mean :slight_smile: I have no “reason” but I just love how “out of the box” it is, even though I prefer arch :stuck_out_tongue:

Oh I don’t mind Xorg taking all of VRAM. I still haven’t learned DL all the way through but while searching about which GPU to get for AI/ML, I noticed the higher VRAM you have the bigger batch you can fit in your VRAM. I have yet to push the VRAM usage so I have no idea how it would dynamically allocate the processes but I guess that is something I will have to see in the future.

Oh PS. I don’t use the pop-tiling. :’)

Hmm okay so pop doesn’t necessarily need to run xorg. IIRC they have a way to go pure Wayland. Wayland is far lighter on the vRAM usage if its a major concern. Gnome integrates well it it. Some applications may be a bit well temperamental. Lol (MATLAB I’m calling you out :joy:)

MATLAB? No, Pytorch. :wink:

Pytorch won’t care

Also highly recommend tensorflow if your learning. Google is the crème dela crème and their stuff seriously outdoes stuff developed by even FB at the moment

Try not to limit yourself to languages once you’ve learned take what you did and say try to make it in rust etc.

The real talent in ML and DL and AI is going to be in people who don’t just know an API or use a set of tools but whom can write the tools in any language and make the algorithms

Best of luck it’s a fun field.

The only time I’ve touched it is using machine learning for raytracing models for prediction of RF channel aging. :wink:

You have no idea how good I felt when I read it. :smiley:

Also, I do plan on branching out to not only train NNs, but to develop necessary tools, preferably in C++/Rust as “you gotta go fast”

Thank you, it means a lot!

There’s plenty of money to be made in understanding why models work or don’t work and how to make new ones that sift through large volumes of data during inference efficiently. (combining and distillation).

At the inference is just simple math that happens to crunch some input data set with ridiculous parallelism.

Facebook, Amazon, Google… all have custom (non-GPU) silicon design-ed in house for this type of stuff - think of your GPU ML as when you’re writing code in high school/university. It’s good for learning humans and it might scale to demos of recognizing some kinds of objects in video.

If you want to extrapolate trajectories of soccer players, or kids playing soccer with a ball flying across the road to a dog and not get rear ended, you need a lot more processing horse power to crunch through the huge dataset and distil it to something that can run inference reliably on a couple of GPU class chips. But totally worth trying to do on GPUs - if only to understand how/why it doesn’t work.