-
-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mem meter: show RAM used by the GPU in a different color #1267
Comments
Is the GTT memory information available in any file htop is currently reading already? Also: If this change is made it should be done consistently across all platforms. Please provide some information for platforms like *BSD and Darwin, on where to get the information on those systems. |
In readeontop the information is retrieved by calling a specific function of libdrm (
Sorry, I cannot say something about other platforms and have no direct access. If you have a patch, I can however boot a BSD live system on my machine to test it (if that exists and if they have support for newer AMD GPUs). |
To reduce the number of dependencies we'd best like to avoid introducing unnecessary dependencies, especially as this would only cover AMD GPUs and only some of them and only on Linux. But given this requests things from the DRM there might be a chance this can be read directly from the kernel or better yet, some file in procfs or sysfs. |
I digged around a little bit in the sysfs. This file looks really promising:
radeontop at the same time reports |
Anybody can check an NVidia system? |
For NVIDIA both |
Grepping in the Linux source results in:
So this sysfs file seems to be amdgpu specific. However, according to Wikipedia, the concept exists for Intel GPUs, too. |
The Intel driver (i915) has a lot of GTT specific code in the kernel. Maybe some usable numbers can be found in this file: |
# ls -lad / /sys/ /sys/kernel/ /sys/kernel/debug/ /sys/kernel/debug/dri/ /sys/kernel/debug/dri/0/ /sys/kernel/debug/dri/0/i915_gem_objects
drwxr-xr-x 22 root root 4096 Mär 31 2022 /
dr-xr-xr-x 13 root root 0 Jul 1 21:18 /sys/
drwxr-xr-x 17 root root 0 Jul 1 21:18 /sys/kernel/
drwx------ 53 root root 0 Jul 1 21:18 /sys/kernel/debug/
drwxr-xr-x 4 root root 0 Jul 1 21:18 /sys/kernel/debug/dri/
drwxr-xr-x 9 root root 0 Jul 1 21:18 /sys/kernel/debug/dri/0/
-r--r--r-- 1 root root 0 Jul 1 21:18 /sys/kernel/debug/dri/0/i915_gem_objects
# cat /sys/kernel/debug/dri/0/i915_gem_objects
6049 shrinkable [0 free] objects, 1290665984 bytes
system: total:0x00000007c0573000 bytes
stolen-system: total:0x0000000010000000 bytes Thus, access only with root permissions … |
On GPUs that support per-process memory reporting it may be nice to add that as as column as well. I believe Nvidia and AMD do this? I don't think it exists yet for intel, however. |
Given the right PRs I see a real chance for this. ;-) |
On an AMD Ryzen 7 PRO 6850U the GPU seems to be able to additionally use the normal RAM, via the GTT (when I searched correctly, it is possible to find out that value with radeontop by looking at the GTT line). Based on my experience this RAM is shown as "used" in htop but has no reference in the process list, which is confusing. I have a very high standard memory usage (as displayed by htop) but it seems that half of it is "eaten" by the GPU (at least the processes does not sum up at all to the used memory and
radeontop
shows around 7GB of VTT memory).As far as I know not only AMD GPUs/APUs are capable of using the main RAM, so I think it would be a nice feature of htop to display that RAM in a special color so a user is capable of classifying it.
Seems kind of related to #406, #1100, #631.
The text was updated successfully, but these errors were encountered: