How does --cache-control all clear the L2 cache?

How does Nsight Compute clear the caches before each replay pass with --cache-control all?

  • Does it write to a large block of memory to evict L2?
  • Or does it use a special instruction or driver operation that invalidates L2 directly?

From local experiments, it appears to be the latter. The DRAM write bytes reported for a profiled kernel (dram__bytes_op_write.sum) generally match the size of the kernel’s own output. Even when the kernel reads several times the L2 size, there’s no extra write-back from the flush, which a write-based flush would leave behind as dirty lines.

After the flush, is L2 empty, or can clean lines from whatever was used to evict it still be resident?

If it invalidates rather than writes, could there be an option that instead leaves L2 full of dirty lines before each pass (e.g. --cache-control dirty)? Real world scenario usually start with L2 dirty from the previous kernel. Today the only way to profile that state is application replay with --cache-control none in conjunction to --replay-mode application, which is very slow for --set full.

Environment: Nsight Compute 2026.2.0, CUDA 13.3, NVIDIA GeForce RTX 5080, driver 616.92, under WSL2.

Thanks!
Jimmy