How can I tell what is taking up memory on my NVIDIA video card?
Use nvidia-smi.
nvidia-smi
is a program (usually installed by your NVIDIA driver, but also available for Fedora in the rpmfusion-nonfree
repository) that can tell you what is taking up video RAM on your NVIDIA card.
It is very useful for figuring out how big an AI model (also known as an LLM — large language model) is, once it's been loaded.
Installation on Fedora
# Ensure you have RPMFusion nonfree deployed first.
sudo dnf install /usr/bin/nvidia-smi
Usage
[root@roxanne ~]# nvidia-smi
Wed Apr 19 13:40:43 2023
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 530.41.03 Driver Version: 530.41.03 CUDA Version: 12.1 |
|-----------------------------------------+----------------------+----------------------+
| 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 2080 Ti Off| 00000000:07:00.0 On | N/A |
| 44% 44C P8 21W / 250W| 6602MiB / 11264MiB | 15% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 4735 G /usr/libexec/Xorg 94MiB |
| 0 N/A N/A 5269 G /usr/bin/kded5 3MiB |
| 0 N/A N/A 5270 G /usr/bin/ksmserver 3MiB |
| 0 N/A N/A 5271 G /usr/bin/kwin_x11 4MiB |
| 0 N/A N/A 5310 G /usr/bin/plasmashell 31MiB |
| 0 N/A N/A 5728 G ...5/polkit-kde-authentication-agent-1 3MiB |
| 0 N/A N/A 5730 G /usr/libexec/xdg-desktop-portal-kde 3MiB |
| 0 N/A N/A 6480 G /usr/libexec/kdeconnectd 3MiB |
| 0 N/A N/A 6492 G /usr/bin/kaccess 3MiB |
| 0 N/A N/A 7246 G /usr/lib64/kodi/kodi.bin 34MiB |
| 0 N/A N/A 119895 C python 6388MiB |
+---------------------------------------------------------------------------------------+