NVIDIA Nsight PerfSDK integration for the Flax Editor GPU Profiler. Double-click a GPU profiler region to open live chip counter metrics for that draw range.
- Live throughput bars and counter values grouped by GPU subsystem (SM, caches, VRAM, raster, etc.)
- + Add metric — browse and add any supported NVPerf counter, ratio, or throughput metric at runtime
- Custom metrics appear under a Custom group; built-in defaults stay available
- Works while the scene is playing with the GPU profiler recording
- Windows x64 or Linux x64
- Flax 1.13+
- NVIDIA GPU + Nsight Perf SDK installed
- Environment variable
NVPERF_SDK_PATHpointing at your Perf SDK root (e.g.C:\Downloads\PerfSDK_2025_5or/opt/NVIDIA_Nsight_Perf_SDK)
- Set
NVPERF_SDK_PATHin your user or system environment. - On Linux, ensure the NvPerf host library directory is on the loader path. The plugin prepends
NvPerf/lib/a64toLD_LIBRARY_PATHat runtime; you can also set it yourself before launching the editor. - Clone the plugin via the Editor Plugin Window tool, then reference it from your game project:
...
"References": [
{
"Name": "$(EnginePath)/Flax.flaxproj"
},
{
"Name": "$(ProjectPath)/Plugins/PerfSDK/PerfSDK.flaxproj"
}
]
- Open the project and Build & Run (or Tools → Recompile Scripts) so the PerfSDK native module links against NVPerf. Check the Output Log for
Using PerfSDK v...during compile. - Play the scene, open Profiler → GPU, enable live recording, then double-click a region to open the metrics window.
| Platform | Graphics APIs |
|---|---|
| Windows x64 | DirectX 11, DirectX 12, Vulkan |
| Linux x64 | Vulkan only |
- Double-click a GPU profiler region — the Nvidia PerfSDK Metrics window opens for that range.
- Click + Add metric (toolbar or button) to open the picker.
- Load available metrics, filter by name or type, and click a row to add it.
- New metrics appear under Custom after the next sample collection cycle.
Status text at the top of the window shows session state (collecting passes, ready, errors). If profiling fails with ERR_NVGPUCTRPERM, enable GPU profiling permissions — see NVIDIA ERR_NVGPUCTRPERM.
To use PerfSDK types from your game scripts, import the module in Game.Build.cs:
public override void Setup(BuildOptions options)
{
base.Setup(options);
// Adds PerfSDK to PrivateDependencies when supported (Windows/Linux x64)
PerfSDK.ConditionalImport(options, options.PrivateDependencies);
}Game projects do not need this for the editor metrics UI — only if you call RenderPerfTools from your own code.
| Layer | Location |
|---|---|
| Native NVPerf + range profiler | Source/PerfSDK/*.cpp (plugin DLL) |
| Metrics editor window | Source/PerfSDK/PerfSdkMetricsWindow.cs |
| Add-metric picker | Source/PerfSDK/PerfSdkAddMetricWindow.cs |
| Editor plugin wiring | Source/PerfSDK/PerfSDK.cs, GpuProfilerBridge.cs |
| GPU frame hooks | PerfSDK.cpp via profiler callbacks |
| Profiler click plumbing | Engine GpuProfilerRegionCallbacks + GPU profiler UI |
All native NVPerf code lives in the plugin. The Flax engine does not define COMPILE_WITH_RENDER_PERF or link NVPerf — only the plugin does when NVPERF_SDK_PATH is set at build time.
PerfSDK requires extra Vulkan device extensions (VK_EXT_buffer_device_address, VK_KHR_device_group, plus NVPerf profiler extensions). The engine enables these at device creation when NVPERF_SDK_PATH is set before starting the editor.
- Set
NVPERF_SDK_PATH(andVULKAN_SDKfor plugin builds). - Fully close and reopen Flax Editor so Vulkan device creation picks up the extensions.
- Rebuild the engine (if you changed engine sources) and Recompile Scripts.
