-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Intel GPU support #903
Intel GPU support #903
Conversation
oh my god i was searching how to have a gpu graph. currently using igpu-tools. would love to see this merged! |
If folks are interested in testing out this change, I'm building downloadable btop zips (with the Intel support) here: https://github.com/bjia56/btop-builder My use case is to run btop as part of a Docker or LXC container as part of the Scrypted home video platform. Using the Intel PMU requires privileged/root permissions, so the above builds also contain a workaround for pulling GPU metrics from an http server running on the host. |
@bjia56 I'm assuming there aren't any conflicting licensing from the code you pulled from |
I can clean things up a bit and fix the Makefile (have only been using the CMake builds myself). Is the http-based metrics endpoint (as a fallback data source) of interest for upstreaming, or would you like to keep only the Intel PMU collection method? The tradeoff is the http endpoint is non-standard, while the PMU requires sudo (or at least CAP_PERFMON permissions). For something like Scrypted, which can be internet-facing, we'd like to minimize the permissions required to run containers. Regarding licensing, to my understanding |
I rather avoid pulling in an entire http library for a single use case. As long as we make sure the CAP_PERFMON permission/sudo requirement is well documented. Could maybe add a
Looks like there is a MIT notice on the DRM headers also, so if that is the case from the origin it shouldn't be any issue. It's only a problem if it was GPL, since GPL don't mix with Apache. |
Nice work @bjia56 :) Merging in to main. |
Thanks for finishing up this PR! |
Are we certain that this works for Alchemist GPUs using the i915 KMD? I would assume so given the KMD is the same, and yet my A770 is unrecognized. Running in debug mode suggests no GPU collect occurs at all. |
Does the A770 show up in |
Yeah, its shown as just "Intel Dg2 (Gen 12)". Hardware device is also as expected, just /dev/dri/card1. This is rather bizarre, given the codebase should be the same between the two, though it should be worth noting I cleanbuilt igt-gpu-tools, perhaps btop is out-of-date somehow? |
The reference igt code that was pulled into btop was commit 0f02dc176959e6296866b1bafd3982e277a5e44b from https://gitlab.freedesktop.org/drm/igt-gpu-tools.git. btop uses the PMU to access metrics, so it requires sudo permissions same as igt. If the device itself is unknown by the built-in Intel chip database, then it should show as a Generic device, if I recall correctly. |
I compiled btop recently with Edit: I have an old, integrated GPU:
|
How odd, then the device is not generic. Tried to compile with GPU_SUPPORT=true, no dice. May try with Xe, maybe there is something there. @andras-tim, do you get metrics on your Alchemist card? Edit: No luck, I assumed perhaps a different KMD would expose the PMU differently if the fault was somehow localized to my machine. |
Is there anyway to do this without root? I believe nvtop (and missioncenter) gets basic usage stats without root permissions! |
For those who are still looking for a solution, there's one mentioned in the Intel kernel driver issue To allow |
This is a possible implementation for #644. It uses stripped down code from
igt-gpu-tools
to handle requests to the Linux perf framework and access metrics from the Intel PMU in the same way thatintel_gpu_top
works. Tested on an Intel Gemini Lake processor's iGPU.Much of the line count comes from sources pulled (and modified) from
igt-gpu-tools
, including a database of Intel chipsets and their corresponding pretty-print names. Extra dependencies that would have been pulled in byigt-gpu-tools
were removed to keepbtop
standalone.