OptiX 7.2 and Nsight CLI

Good Afternoon,

Can anyone point me to a tutorial/example on how to using command line Nsight with OptiX 7.2?

Thanks in advance for any assist.

Hey @picard1969,

Are you trying to use Nsight Systems, or Nsight Compute?

For Nsight Systems (host & kernel level profiling) the CLI guide is here: User Guide :: Nsight Systems Documentation

For Nsight Compute (CUDA & OptiX line level profiling) this is the guide: Nsight Compute CLI :: Nsight Compute Documentation

If you’re having trouble or have any questions, I can probably dig up some examples that have worked for me recently.


David.

Cool. Thanks.

I will git the Nsight Compute a shot and see how it works.

Hi @dhart,

I am ashamed to have to ask, but can you point me to the examples using command-line ncu?

I tried to profile a simple vector addition kernel (on a single CU file called vecAdd.cu) after it is compiled to an executable called xVecAdd in a directory called ncuTest/. Whereby the CUDA kernel will sum up a vector to a value of 1, which appears to work properly.

Using the following:
$ ncu -o profile --target-process all xVecAdd

I got the following response:

==PROF== Connected to process 7063 (/home/picard/ncuTest/xVecAdd)
==ERROR== Unknown Error on device 0.
Final result: 1.000000
==PROF== Disconnected from process 7063
==WARNING== No kernels were profiled.

I am assuming it is something very stupid, so hopefully seeing some example(s) of proper use will clear it up.

Thanks again.

You might need to run ncu.bat from an Administrator shell. If that doesn’t work, some other possibilities might be listed in the FAQ here Kernel Profiling Guide :: Nsight Compute Documentation

The command line I like to use is to launch my process as part the NCU command, like so:

ncu.bat --set full --kernel-name <your-kernel> --launch-count 1 --import-source on -o <profile-name> <your-programm-command-line-with-arguments>


David.

Oh, you’re on linux, right? Sorry, so obviously ncu and not ncu.bat. :)

Another thing you can do on Linux is permanently enable performance counters, if your security environment allows it. I’ve done this on my machine, and found it quite nice to not have to run sudo every time. https://developer.nvidia.com/nvidia-development-tools-solutions-err_nvgpuctrperm-permission-issue-performance-counters


David.