SM Used by a particular program

I am trying to run a CUDA program which utilizes my GPU and find out which SM this program is being assigned to. I don’t want just SM utilization %. Is there a way to do this? nvidia-smi looks useful but I don’t know if it can give me the ID of the SM being used.

there aren’t any tools to do this.

If you have access to the source code and want to modify kernel code, you can write code to keep track of it. Here is a recent discussion about it.