| name | gpu-debug |
| description | Interactive GPU frame debugging with RenderDoc. Capture frames from windowed apps, inspect draw calls, pipeline state, textures, shaders, and pixel history. Also supports rdc-cli for scripted inspection. For headless apps, use gpu-capture instead. |
| argument-hint | [capture.rdc | binary args...] |
| allowed-tools | Bash, Read, Glob, Grep |
GPU Debug Skill
Interactive GPU frame debugging using RenderDoc and rdc-cli. Best for windowed apps (milo-viewer) where you need to visually inspect draw calls, pipeline state, textures, and shaders.
For headless apps (render-test), use the gpu-capture skill with GFXReconstruct instead — RenderDoc requires a swapchain (vkQueuePresentKHR) to trigger capture.
All Bash calls in this skill MUST use dangerouslyDisableSandbox: true (GPU/Vulkan access is blocked by the sandbox).
Arguments
$ARGUMENTS
Capture a Frame
With the wrapper script
scripts/gpu/rdc_capture.sh -o /tmp/venue.rdc native/build/milo-viewer \
~/code/milohax/milo-engine-libs/harmonix-repos/milo-rnd-library/dc3/world/glitterati/gen/glitterati.milo_xbox
scripts/gpu/rdc_capture.sh -d 5 -o /tmp/char.rdc native/build/milo-viewer \
~/code/milohax/milo-engine-libs/harmonix-repos/milo-rnd-library/dc3/char/main/gen/main.milo_xbox
MILO_RENDER=1 scripts/gpu/rdc_capture.sh -d 10 -o /tmp/dc3.rdc native/build/dc3-native
Note: For headless capture (no window), use /gpu-capture (GFXReconstruct) instead. RenderDoc needs a swapchain.
With renderdoccmd directly
ENABLE_VULKAN_RENDERDOC_CAPTURE=1 \
../gpu/renderdoc/build/bin/renderdoccmd capture \
--wait-for-exit \
-c /tmp/frame.rdc \
native/build/milo-viewer path/to/scene.milo_xbox
Script Options
| Option | Description | Default |
|---|
-o <path> | Output .rdc file | /tmp/gpu_capture.rdc |
-d <seconds> | Delay before capture trigger | 2 |
--no-wait | Don't wait for app exit | off |
Inspect with renderdoccmd
The built-in CLI has basic inspection commands:
RDCCMD=../gpu/renderdoc/build/bin/renderdoccmd
$RDCCMD thumb /tmp/frame.rdc /tmp/thumb.jpg
$RDCCMD replay /tmp/frame.rdc
$RDCCMD convert /tmp/frame.rdc /tmp/frame.xml
$RDCCMD version
Inspect with rdc-cli (66 commands)
rdc-cli wraps the RenderDoc Python API into shell commands. It requires renderdoc.so built against the same Python version.
Setup
pip install rdc-cli
export RENDERDOC_PYTHON_PATH=../gpu/renderdoc/build/lib
rdc doctor
If rdc doctor reports Python version mismatch, rebuild RenderDoc against your active Python or use a matching Python version.
Session Workflow
Every inspection follows open -> work -> close:
rdc open /tmp/frame.rdc
rdc info --json
rdc draws --limit 20
rdc close
Draw Call Inspection
rdc draws
rdc draws --limit 50
rdc draw 42
rdc events --type draw
Pipeline State
rdc pipeline 42
rdc pipeline 42 rs
rdc pipeline 42 om
rdc pipeline 42 vs
rdc pipeline 42 ps
rdc bindings 42
Shader Inspection
rdc shader 42 vs --source
rdc shader 42 ps --source
rdc shader 42 vs --constants
rdc shader 42 vs --reflect
rdc shaders --json
rdc search "main" --json
Visual Export
rdc rt 42 -o rt.png
rdc texture 15 -o tex.png
rdc thumbnail -o thumb.png
rdc mesh 42 -o mesh.obj
rdc buffer 10 -o buf.bin
Claude can view exported PNGs directly via the Read tool (multimodal).
Pixel Debugging
rdc pixel 256 256
rdc pixel 256 256 42
rdc pick-pixel 256 256 42
rdc debug pixel 42 256 256
rdc debug vertex 42 0
Shader Edit & Replay
rdc shader 42 ps --source > shader.glsl
rdc shader-build shader_modified.glsl --encoding GLSL
rdc shader-replace 42 ps --with 123
rdc shader-restore 42 ps
Frame Comparison
rdc diff /tmp/before.rdc /tmp/after.rdc --shortstat
rdc diff /tmp/before.rdc /tmp/after.rdc --draws --json
rdc diff /tmp/before.rdc /tmp/after.rdc --framebuffer --diff-output diff.png
Assertions (CI/testing)
rdc assert-count vkCmdDraw 3
rdc assert-pixel 256 256 42 "1.0 0.0 0.0 1.0"
rdc assert-image rt.png ref.png --tolerance 0.01
MCP Server Integration
The renderdoc-skill repo includes an MCP server exposing rdc-cli as 13 Claude Code tools:
pip install -r ../gpu/renderdoc-skill/requirements-mcp.txt
claude mcp add rdc-tools -- python ../gpu/renderdoc-skill/mcp_server/server.py
After registration, /mcp shows rdc-tools with tools like rdc_session, rdc_draws, rdc_pipeline, rdc_export, rdc_pixel, rdc_diff, etc. See ../gpu/renderdoc-skill/README.md for full details.
Debugging Recipes
Object is invisible
- Open capture, list draws — is the draw present?
- Check rasterizer state — backface culling direction?
- Check depth state — depth test/write enabled?
- Check blend state — alpha zero?
- Export vertex buffer — are positions correct?
- Debug vertex shader — is clip position valid?
Colors are wrong
- Export render target at the draw — what color is actually written?
- Check descriptor bindings — correct texture bound?
- Check blend state — unexpected blend mode?
- Debug fragment shader — trace the computation
- Check uniforms/constants — correct values?
Performance issues
rdc draws — count draw calls (too many = batching issue)
rdc resources --sort size — find oversized textures/buffers
- Check for redundant state changes between draws
- Look for unnecessary barriers/transitions
Source Code
- RenderDoc:
../gpu/renderdoc/ (github.com/baldurk/renderdoc)
- CLI source:
../gpu/renderdoc/renderdoccmd/
- Capture layer:
../gpu/renderdoc/renderdoc/
- Build docs:
../gpu/renderdoc/docs/CONTRIBUTING/Compiling.md
- Dependencies:
../gpu/renderdoc/docs/CONTRIBUTING/Dependencies.md
- rdc-cli: github.com/BANANASJIM/rdc-cli
- 66-command reference:
../gpu/renderdoc-skill/.claude/skills/renderdoc-gpu-debug/references/commands-quick-ref.md
- Debugging recipes:
../gpu/renderdoc-skill/.claude/skills/renderdoc-gpu-debug/references/debugging-recipes.md
- renderdoc-skill:
../gpu/renderdoc-skill/ (github.com/rudybear/renderdoc-skill)
- MCP server:
../gpu/renderdoc-skill/mcp_server/server.py
- Capture script:
../gpu/renderdoc-skill/capture_frame.py
Building (if not already built)
cd ../gpu/renderdoc
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_QRENDERDOC=OFF -Bbuild -H.
cmake --build build -j$(nproc)
../gpu/renderdoc/build/bin/renderdoccmd vulkanlayer --register --user
pip install rdc-cli