Skip to content

docs: fix Intel GPU Usage in examples/README.md#2272

Merged
ammgws merged 2 commits into
greshake:masterfrom
obaibula:master
Apr 27, 2026
Merged

docs: fix Intel GPU Usage in examples/README.md#2272
ammgws merged 2 commits into
greshake:masterfrom
obaibula:master

Conversation

@obaibula
Copy link
Copy Markdown
Contributor

The example for Intel GPU usage parses the Render/3D value from the 8th field of intel_gpu_top -l output. Since this was introduced, the Render/3D field has shifted to the 9th position, breaking the example:

oleh@gentoooleh ~ $ sudo intel_gpu_top -l -n 1
 Freq MHz      IRQ RC6     Power W     IMC MiB/s             RCS             BCS             VCS            VECS 
 req  act       /s   %   gpu   pkg     rd     wr       %  se  wa       %  se  wa       %  se  wa       %  se  wa 
 388  388      582  50  0.95 36.54   3436   2309   42.43   0   0    0.00   0   0    0.00   0   0    0.00   0   0 

To prevent future field position shifts, I propose to utilize JSON output from intel_gpu_top -J and extract the Render/3D value by key with jq: [1].engines["Render/3D"].busy.

Note: the first sample in the JSON array always contains a high Render/3D spike, so the second sample ([1]) is used instead to get an accurate numbers. I also added this note to the file.

@ammgws
Copy link
Copy Markdown
Collaborator

ammgws commented Apr 26, 2026

Has the -J flag always been there?

@obaibula
Copy link
Copy Markdown
Contributor Author

obaibula commented Apr 26, 2026

To be precise, the -J flag was added more than 7 years ago. Here is the commit: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/commit/47e91cc220962fef2ad5afd1ce39fea1cec52f95

The -l flag used before my changes was added in the same commit as the -J flag.

@ammgws
Copy link
Copy Markdown
Collaborator

ammgws commented Apr 27, 2026

Thanks!

@ammgws ammgws merged commit 73c76f4 into greshake:master Apr 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants