GPU Trace on Linux: "GPU Performance Counters unavailable" from NV_ERR_NO_MEMORY in ALLOC_PMA_STREAM after many trace sessions

Hi,

After many GPU Trace sessions in one boot, ngfx GPU Trace on Linux starts failing with “GPU Performance Counters unavailable”. It fails on most attempts, for minutes at a time. The kernel log shows NV_ERR_NO_MEMORY from NVB0CC_CTRL_CMD_INTERNAL_ALLOC_PMA_STREAM. No other profiler is running, and VRAM and system RAM are plentiful. We’d like to know whether this is a known issue, and whether there’s a way to recover without reloading the driver.

System

  • GPU: GeForce RTX 4090, the only GPU (it also drives the display)
  • Driver: 615.71.09, open kernel module (nvidia-open-dkms); Vulkan 1.4.351
  • OS: CachyOS (Arch-based), kernel 7.2.8-1-cachyos, Wayland (Hyprland)
  • Nsight Graphics CLI: 2026.2.0.0 (build 37991608)
  • Profiling permission: RmProfilingAdminOnly is 0; GPU Trace worked normally earlier in the same boot
  • nvidia-persistenced is not running; uptime 11 days

What we run
An automated benchmark launches a Vulkan application under GPU Trace many times in a row, about one session every 20-25 s:

ngfx --activity "GPU Trace Profiler" --no-timeout --exe <app> --dir <dir> \
     --args <app args> --output-dir <dir> --per-arch-config-path <json> \
     --set-gpu-clocks base --start-after-frames 1550 --limit-to-frames 99 \
     --max-duration-ms 4000 --trace-timeout 240 --auto-export

ngfx reports: Sample duration = 7933ns; Warp State Sampling Interval = 16; GPU PMA Buffer Size (MB) = 4294.9; SOC PMA Buffer Size (MB) = 0.

The failure
The target launches and connects normally, then:

Session established. Starting activity...
Waiting for target ready...
TARGET ERROR: GPU Performance Counters unavailable. Please close any existing GPU profiling sessions, or enable access to GPU performance counters.
Waiting for target ready... Failed

Each failed attempt logs this in dmesg:

NVRM: GPU0 nvCheckOkFailedNoLog: Check failed: Out of memory [NV_ERR_NO_MEMORY] (0x00000051) returned from pRmApi->Control(pRmApi, pClient->hClient, hObject, NVB0CC_CTRL_CMD_INTERNAL_ALLOC_PMA_STREAM, &internalParams, sizeof(internalParams)) @ kern_profiler_v2_ctrl.c:320

What we observed

  • In this boot, GPU Trace sessions (likely several hundred over 11 days, estimated) worked. Then, partway through a run, most attempts began to fail. Rendering and non-profiled runs of the same application are unaffected.
  • After a failure, a single trace sometimes succeeds. The next attempts then fail again for minutes, including ones started 90 s later. Example sequence, one trace each: pass, fail, fail, fail (+90 s), fail (+90 s).
  • At failure time, nvidia-smi showed VRAM 3.6 GiB used / 20.5 GiB free, 404 MiB reserved, and BAR1 3.7 GiB used / 29 GiB free. The process list shows only long-running desktop applications (compositor, browser, editor), all present while tracing worked.
  • No ngfx or target process is left running. No process has Nsight libraries mapped, and nothing listens on ports 49152-49215.
  • It isn’t host RAM fragmentation. After echo 3 > /proc/sys/vm/drop_caches; echo 1 > /proc/sys/vm/compact_memory, free 2 MiB+ blocks went from ~0.7 GiB to ~10 GiB, and traces still failed 2 of 3.
  • From the open kernel module source, the user-mode client allocates the PMA buffer itself, and the failing step is the internal control that registers and maps it on the GSP side. So the shortage seems to be in GSP- or RM-internal memory rather than in VRAM or host RAM.

Questions

  1. Is NV_ERR_NO_MEMORY from INTERNAL_ALLOC_PMA_STREAM a known issue, for example GSP memory leaked or freed late per profiler session, in 615.x with Nsight Graphics 2026.2?
  2. Short of reloading the driver, is there a way to reclaim it?
  3. Can the ~4 GiB GPU PMA buffer be made smaller for GPU Trace, through a CLI option or the per-architecture config, so the mapping needs less?
  4. Can ngfx report this case as an out-of-memory condition? “Close any existing GPU profiling sessions” sent us looking for a process that didn’t exist.

We can provide full dmesg, ngfx output and trace logs, and test a debug driver or ngfx build.

Thanks!

Hi @popularsaying,

Thanks for the detailed report. To help us reproduce and investigate the issue, could you share the following?

  • A sample application, either a binary or source code, along with any required assets and build/run instructions.
  • The automated benchmark script and the per-architecture configuration JSON used with the command you posted.
  • The full dmesg, ngfx output, and trace logs you mentioned.

If you cannot share the original application, a minimal reproducer would also help.

Thanks,
An