Run Nsight compute command in ubuntu 20.04


I have trouble running ncu command in ubuntu 20.04. When I run the command sudo ncu ./myscript, here is the output:

==PROF== Connected to process 2410 (/path/to/myscript)
==ERROR== Unknown Error on device 0.
==PROF== Disconnected from process 2410
==WARNING== No kernels were profiled.
==WARNING== Profiling kernels launched by child processes requires the --target-processes all option.

cuda version:
Cuda compilation tools, release 11.6, V11.6.124
Build cuda_11.6.r11.6/compiler.31057947_0

ncu version:
Version 2022.1.1.0 (build 30914944) (public-release)

Much appreciated if anyone can help.

Does the command run correctly without the profiler?

As suggested by the warning message try:
ncu --target-processes all ./myscript

Also to narrow down the issue you can try collecting a single simple metric:
ncu --target-processes all --metrics sm__cycles_elapsed.sum ./myscript

Hello Sanjiv,
This is a duplicated topic, the original one is here:

In order not to get confused, we can consider deleting this duplicated topic.