cli: Using regex in --metrics causes n/a values to be output vs specifying the metric directly

Am I using the regex in --metrics in an incorrect way? When I try to query all the metrics with pred in them, it shows n/a for all the metrics. But when I specify the regex to be a bit more specific so that there is only one metric, it works. Eg pred.* gives n/a for all metrics. But pred.*ratio selects only one metric to be output and it works.

This does not work.

$ nv-nsight-cu-cli --metrics "regex:pred.*" ./divergence/divergence 16 | grep ratio
smsp__thread_inst_executed_pred_on_per_inst_executed.ratio  (!) n/a

This works:

$ nv-nsight-cu-cli --metrics "regex:pred.*ratio" ./divergence/divergence 16
==PROF== Connected to process 10080
Warp size: 32
==PROF== Profiling "kernel" - 1: 0%....50%....100% - 1 pass
==PROF== Disconnected from process 10080
[10080] divergence@
  kernel, 2019-Jul-07 12:11:18, Context 1, Stream 7
    Section: Command line profiler metrics
    ---------------------------------------------------------------------- --------------- ------------------------------
    smsp__thread_inst_executed_pred_on_per_inst_executed.ratio              13.87
    ---------------------------------------------------------------------- --------------- ------------------------------

You are using the regex correctly. Possibly, in your first case, a metric is included that fails to be collected, causing the profiling to fail. If you could let us know you Nsight Compute version, OS and GPU, we will look into this. Thank you.

Thank you. In my first case, I was guessing may be it might have led to 100s of metrics being computed and the profiler just bailed out? (A nice error msg would be nice if that’s the case :) )

Nsight Compute Version: NsightCompute-2019.3
Cuda: 10.1
Driver: 430.26
GPU: GeForce GTX 1660
OS: Ubunt 19.04 64bit

Thank you for the information. In general, collecting hundreds of metrics is no problem, I was able to successfully profile all 4931 metrics that map to “regex:pred.*” on my RTX 2080 Ti. We will try to check this on your GPU/config and get back to you.

I can confirm the issue on my side with your version of Nsight Compute. It is a known issue, and will be fixed in the next release of Nsight Compute.

The reason is that your regex includes matches some metrics (smsp__sass_thread_inst_executed_pred_on.*) that were enabled in some part of the tool, but not in others. This issue will be fixed in the next release. The same problem can be seen here:

Thanks a lot for the explanation :)