On a system running Ubuntu 25.04 with an NVIDIA GeForce RTX 3050 Laptop GPU and the nvidia-driver-570 package, executing nvidia-smi causes the kernel OOM killer to be invoked, even though overall system memory is mostly free. The issue seems to be isolated to nvidia-smi, which rapidly allocates over 35 GiB of RAM and gets killed by the kernel.
This behavior is unexpected and highly disruptive in both desktop and development environments, as it causes the GNOME shell to freeze momentarily and sometimes terminates other apps. The issue is reproducible consistently under Wayland and X11 sessions.
✅ System Information:
Laptop: Asus Vivobook Q533MJ
CPU: Intel Core Ultra 7 155H
RAM: 40 GB DDR5
GPU: NVIDIA GeForce RTX 3050 6GB (GA107BM / GN20-P0-R-K2)
OS: Ubuntu25.04 (inux asus 6.14.0-15-generic #15-Ubuntu SMP PREEMPT_DYNAMIC Sun Apr 6 15:05:05 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux)
Driver Version: 570.133.07 (installed via ubuntu-drivers)
Display Server: Wayland (also reproduced on Xorg)
✅ Steps to Reproduce:
Boot into Ubuntu 25.04 with nvidia-driver-570 installed.
Run nvidia-smi in the terminal.
Observe brief freeze.
Kernel kills nvidia-smi due to excessive memory use.
✅ Expected Behavior:
nvidia-smi should execute successfully and report GPU statistics without consuming excessive memory or being terminated by the OOM killer.
✅ Actual Behavior:
nvidia-smi process quickly allocates over 35 GiB of memory.
Kernel OOM killer forcibly terminates the process.
GNOME shows warning:
Virtual terminal stopped. Device memory is nearly full. Virtual terminal processes were using a lot of memory and were forced to stop.
Logs confirm nvidia-smi was the target of OOM.
✅ Kernel Logs (journalctl -k | grep -i oom):
May 11 22:28:40 asus kernel: gnome-shell invoked oom-killer: gfp_mask=0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), order=0, oom_score_adj=100
May 11 22:28:40 asus kernel: oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=user.slice,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-b506ac0f-21fa-434f-b0cd-8fb6486a6523.scope,task=nvidia-smi,pid=134285,uid=1000
May 11 22:28:40 asus kernel: Out of memory: Killed process 134285 (nvidia-smi) total-vm:54692344kB, anon-rss:35251216kB, file-rss:424kB, shmem-rss:0kB, UID:1000 pgtables:95088kB oom_score_adj:200
✅ Memory at time of crash (free -h):
total used free shared buff/cache available
Mem: 37Gi 4.1Gi 32Gi 621Mi 1.4Gi 33Gi
Swap: 14Gi 2.2Gi 12Gi
✅ Top memory usage (ps aux --sort=-%mem | head -5):
USER PID %MEM VSZ RSS COMMAND
javad 134285 95.4 54692344 35251216 /usr/bin/nvidia-smi