Read contents of PC Sampling Continuous output (dat file)

I am looking into the code samples provided in /usr/local/cuda-11.8/extras/CUPTI/samples/pc_sampling_continuous/. I am trying to get the PC stall reasons (from an executable) without modifying the source code using CUPTI. pc_sampling_continuous seems to be doing exactly the same.

When I am running the command :
./ --collection-mode 1 --sampling-period 7 --file-name pcsampling.dat --verbose --app "./executable_name", it outputs a dat file.

To read this .dat file, /usr/local/cuda-11.8/extras/CUPTI/samples/pc_sampling_utility/ contains an utility file. This is run with the command:
./pc_sampling_utility --file-name 1_pcsampling.dat and it is able to output in a human readable format.

I have 2 problems regarding this:

  1. It always says lineNumber:0, fileName: ERROR_NO_CUBIN, dirName: , in each line. However it is able to show me the stalls. But without correlating to the line number in the code and SASS (both) , it is of no use.

  2. README file tells that I should be using the cubin file for the source correlation. I am able to generate the cubin file (as cuobjdump -xelf all ./executable_name and renaming it to 1.cubin). But I am not able to understand how to input this cubin file together with the .dat file to pc_sampling_utility.

Any help is appreciated.

Please put the .cubin file in the folder in which the pc_sampling_utility executable is created.

In your case the folder should be /usr/local/cuda-11.8/extras/CUPTI/samples/pc_sampling_utility.

Yes, it is in the same folder. Hence, the confusion

Please make sure that the app is compiled with the nvcc -lineinfo option.

Also as mentioned in CUPTI/samples/pc_sampling_utility/README.txt make sure that the “cuobjdump” utility version is the same as the CUDA Toolkit version used to build the CUDA application executable or library files.