# Doom GPU Flame Graphs

DevFeed: [Doom GPU Flame Graphs](<https://devfeed.tech/articles/doom-gpu-flame-graphs-13603.md>)

Original publisher: [Read original article](<http://www.brendangregg.com/blog//2025-05-01/doom-gpu-flame-graphs.html>)

Published: 2025-04-30T14:00:00Z

Content type: article

Language: en

Sources: [Brendan Gregg's Blog](<https://devfeed.tech/sources/brendan-gregg-s-blog.md>)

Topics: [GPU](<https://devfeed.tech/topics/gpu.md>), [shaders](<https://devfeed.tech/topics/shaders.md>), [intel](<https://devfeed.tech/topics/intel.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [doom](<https://devfeed.tech/tags/doom.md>), [dust](<https://devfeed.tech/tags/dust.md>), [flame-graph](<https://devfeed.tech/tags/flame-graph.md>), [games](<https://devfeed.tech/tags/games.md>), [gaming](<https://devfeed.tech/tags/gaming.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [intel](<https://devfeed.tech/tags/intel.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [performance](<https://devfeed.tech/tags/performance.md>), [plugin](<https://devfeed.tech/tags/plugin.md>), [profile](<https://devfeed.tech/tags/profile.md>), [shaders](<https://devfeed.tech/tags/shaders.md>), [svg](<https://devfeed.tech/tags/svg.md>)

## AI overview

The article demonstrates full-stack GPU flame graphs and GPU FlameScope using GZDoom, including Intel Battlemage GPU support. It shows how synchronized CPU and GPU profiling can correlate workload periods and identify GPU shader compilation and NIR preprocessing as sources of CPU activity.

## Source excerpt

AI Flame Graphs are now open source and include Intel Battlemage GPU support, which means it can also generate full-stack GPU flame graphs for providing new insights into gaming performance, especially when coupled with FlameScope (an older open source project of mine). Here's an example of GZDoom, and I'll start with flame scopes for both CPU and GPU utilization, with details annotated: (Here are the raw CPU and GPU versions.) FlameScope shows a subsecond-offset heatmap of profile samples, where each column is one second (in this example, made up of 50 x 20ms blocks) and the color depth represents the number of samples, revealing variance and perturbation that you can select to generate a flame graph just for that time range. Update: the row size can be ajusted (it is limited by the sample rate captured in the profile), e.g., you could generate 60 rows to match 60fps games. Putting these CPU and GPU flame scopes side by side has enabled your eyes to do pattern matching to solve what would otherwise be a time-consuming task of performance correlation. The gaps in the GPU flame scope on the right - where the GPU was not doing much work - match the heavier periods of CPU work on the left. CPU Analysis FlameScope lets us click on the interesting periods. By selecting one of the CPU shader compilation stripes we get the flame graph just for that range: This is brilliant, and we can see exactly why the CPUs were busy for about 180 ms (the vertical length of the red stripe): it's doing compilation of GPU shaders and some NIR preprocessing (optimizations to the NIR intermediate representation that Mesa uses internally). If you are new to flame graphs, you look for the widest towers and optimize them first. Here is the interactive SVG. CPU flame graphs and CPU flame scope aren't new (from 2011 and 2018, both open source). What is new is full-stack GPU flame graphs and GPU flame scope. GPU Analysis Interesting details can also be selected in the GPU FlameScope for generating