5.7 KiB
Debugging with Streamline ImGUI
NOTE 1: This document applies to non-production, development builds only.
sl.imguiwon't load in production builds. Additionally, you will need to turn off any checks for signed libraries when loading Streamline libraries in order to be able to load the non-production libraries.
What SL ImGUI Does
At a high level, the sl.imgui plugin uses imgui to show certain metrics/information about specific SL plugins that can be useful for validating and debugging your app integration.
The sl.imgui plugin is a wrapper around imgui. On plugin load, sl.imgui creates its own context and exposes functions for other plugins to:
- Build their UI
- Render their UI (via callbacks, or directly by calling the
sl::imgui::render()function)
Using SL ImGUI to debug existing plugins
Summary
When running a non-Production build of SL, you should see the imgui pop-ups on the app screen.
Note 1: plugin may NOT load their UI if they are not engaged/turned on from the app-side.
Note 2: you can toggle the imgui pop-ups with Ctrl + Shift + Home hotkey. Hotkey mappings can change in the future. In general, refer to the hotkey shortcuts at the bottom of the screen, or next to the UI control, for ground-truth hotkeys.
| Plugin | Debug information | Reference Image |
|---|---|---|
| Overall Streamline | - Bottom of screen: imgui debug menu keyboard shortcuts and warnings - Right side of screen: imgui debug menu (Each plugin that builds a UI will have its UI show up here) Note: some apps won't let the mouse interact with the imgui menus. For those apps, it's best to change the controls to be hotkey-controllable |
|
sl.interposer |
- SDK build date - SL SDK version |
|
sl.common |
- System (OS, driver, GPU, etc.) - Graphics API - VRAM usage |
|
sl.reflex |
- Mode/FPS cap - Marker usage - Stats on sleep time |
|
sl.dlss |
- Version - Mode - Performance stats |
|
sl.dlss_g |
- Version - Mode - FPS boost stats (i.e., Scaling) - VRAM consumption - Constants passed in through sl.common |
|
sl.nis |
- Mode - Viewport dimensions - Execution time on GPU |
|
reflex-sync |
- Ignore, NVIDIA Internal Only |
|
ImGUI Buffer Visualizer
For certain plugins, debugging some GPU buffers can be done through sl.imgui. For now, only sl.dlss_g supports this feature.
Debugging buffers for sl.dlssg
Note: debug hotkey mappings can change in the future. In general, refer to the hotkey shortcuts at the bottom of the screen, or next to the UI control, for ground-truth hotkeys.
- Turn on
dlssgfrom the app-side, and verify that thesl.imguipop-up shows thatdlssgis On - Use the visualizer:
- Turn on visualizer:
Ctrl + Shift + Insert - Cycle views:
Ctrl + Shift + End. - Turn off visualizer:
Ctrl + Shift + Insert
- Turn on visualizer:
In addition to the sl.dlssg input buffers (e.g. depth, motion vectors, etc.), the visualizer should help you view the debug buffers:
| Buffer | What it means | Correctness Interpretation | Reference Image |
|---|---|---|---|
| Alignment | Visualizes the alignment of depth, motion vectors, and color buffers using a Sobel filter | - Image should be mostly blue (color data) - You should see yellow/green edges around moving objects, including when the camera is moving (mvec data) - You should see red edges everywhere else (depth data) |
![]() |
| Dynamic Objects | Visualizes pixels that have non-zero motion vector values. This excludes motion caused by camera movement | - Only (parts) of dynamic objects should be colored red (not due to camera movement!) - All other pixels should be black/zero |
![]() |
Adding SL ImGUI to new plugins
The sl.common plugin's usage of sl.imgui is an easy to follow example on how to add sl.common UI and render it. Implementing something similar is advised.
#ifndef SL_PRODUCTION
// 1. Check for UI and register our callback
imgui::ImGUI* ui{};
param::getPointerParam(api::getContext()->parameters, param::imgui::kInterface, &ui);
if (ui)
{
// 2. Define the UI building callback
auto renderUI = [](imgui::ImGUI* ui, bool finalFrame)->void
{
// Use `ui` to build buttons/text/sliders/etc.
};
// 3. Register the callback so sl::imgui can render it
ui->registerRenderCallbacks(renderUI, nullptr);
}
#endif









