Bug 510518 - GPU VRAM sensor reports erratic values
Summary: GPU VRAM sensor reports erratic values
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (other bugs)
Version First Reported In: 6.4.5
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-12 07:28 UTC by Bandit
Modified: 2025-10-17 20:32 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.5.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bandit 2025-10-12 07:28:45 UTC
SUMMARY
Added some GPU Sensors to a custom Layout. Using 2 Nvidia RTX Cards, one with 12GB VRAM other one with 10GB VRAM, on proprietary Drivers.  Measured values of the sensors exeed the Cards VRAM capacity. E.g. 26GB measured by sensor, shoud be 2,4GB by reference (measured by btop++) send shows 3,9GB - should be 380M (measured by btop++). 

STEPS TO REPRODUCE
1. Add GPU1 and GPU2 total video memory with sensor GPU1 Video Memory Used
2. 
3. 

OBSERVED RESULT
GPU1 has 12GB VRAM, 26GB used is shown, does not show lower numbers after that
Same thing on GPU2 with 10GB VRAM.

EXPECTED RESULT
Should show similar Measurements as btop++

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2
Kernel Version: 6.17.1-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 3700X 8-Core Processor
Memory: 64 GiB of RAM (62.7 GiB usable)
Graphics Processor 1: NVIDIA GeForce RTX 3060
Graphics Processor 2: NVIDIA GeForce RTX 3080


ADDITIONAL INFORMATION
Thank you!  <3 KDE !
Comment 1 David Redondo 2025-10-13 08:48:05 UTC
So seems we are wrong by factor 10 approximately? 

Can you give me your driver version and a few samples  of  'nvidia-smi dmon -c 2 -s pucm' thanks !
Comment 2 Bandit 2025-10-13 17:23:14 UTC
Hello. Here the requested Info (I hope i did it right):

NVIDIA-SMI 580.95.05              Driver Version: 580.95.05      CUDA Version: 13.0

nvidia-smi dmon -c 2 -s pucm
# gpu    pwr  gtemp  mtemp     sm    mem    enc    dec    jpg    ofa   mclk   pclk     fb   bar1   ccpm 
# Idx      W      C      C      %      %      %      %      %      %    MHz    MHz     MB     MB     MB 
    0     21     56      -     22     27      0      0      0      0    810    450   2594   2630      0 
    1     16     45      -      0      0      0      0      0      0    405    210     18     19      0 
    0     21     56      -     26     29      0      0      0      0    405    405   2594   2630      0 
    1     16     45      -      0      0      0      0      0      0    405    210     18     19      0 

and with some load on it:

 nvidia-smi dmon -c 2 -s pucm
# gpu    pwr  gtemp  mtemp     sm    mem    enc    dec    jpg    ofa   mclk   pclk     fb   bar1   ccpm 
# Idx      W      C      C      %      %      %      %      %      %    MHz    MHz     MB     MB     MB 
    0     53     64      -      4      3      0      0      0      0   7301   1965   9061   9097      0 
    1     85     48      -      0      0      0      0      0      0   9251   1725   6468   6468      0 
    0     46     63      -      4      3      0      0      0      0   7301   1807   9061   9097      0 
    1     86     48      -      0      0      0      0      0      0   9251   1725   6468   6468      0

On load btop says

GPU0   9,1G / 12G
GPU1   6,7G / 10G

If you need more let me know.

Thank you for looking into it.
Comment 3 David Redondo 2025-10-14 08:11:34 UTC
It seems like we add fb and bar1 together which results in which means we show ~double the amount in your case. It doesnt explain the tenfold increase that you saw earlier through.
Comment 4 Bug Janitor Service 2025-10-14 08:36:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/ksystemstats/-/merge_requests/115
Comment 5 David Redondo 2025-10-16 08:19:27 UTC
Git commit 3c929b0113d356e3242b75a6ef9e0ba962ebe44b by David Redondo.
Committed on 14/10/2025 at 08:41.
Pushed by davidre into branch 'master'.

gpu/nvidia: Only count fb memory

This matches what nvidia-settings does to show used memory.
In some cases bar can be as high as fb causing wildly incorrect
readings.
FIXED-IN:6.5

M  +3    -3    plugins/gpu/NvidiaSmiProcess.cpp
M  +3    -3    plugins/gpu/autotests/nvidia.cpp

https://invent.kde.org/plasma/ksystemstats/-/commit/3c929b0113d356e3242b75a6ef9e0ba962ebe44b
Comment 6 David Redondo 2025-10-16 08:40:13 UTC
Git commit fc8120f7500c3bfac1de23b6dc5d53e9eb34de06 by David Redondo.
Committed on 16/10/2025 at 08:20.
Pushed by davidre into branch 'Plasma/6.5'.

gpu/nvidia: Only count fb memory

This matches what nvidia-settings does to show used memory.
In some cases bar can be as high as fb causing wildly incorrect
readings.
FIXED-IN:6.5


(cherry picked from commit 3c929b0113d356e3242b75a6ef9e0ba962ebe44b)

Co-authored-by: David Redondo <kde@david-redondo.de>

M  +3    -3    plugins/gpu/NvidiaSmiProcess.cpp
M  +3    -3    plugins/gpu/autotests/nvidia.cpp

https://invent.kde.org/plasma/ksystemstats/-/commit/fc8120f7500c3bfac1de23b6dc5d53e9eb34de06