Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling Python with Nvidia NSight

Tags:

python

nsight

Does anyone know how to profile Python scripts with NVIDIA Nsight Systems?

I'm not sure what I would put in the Target Application field. I tried putting in the Spyder IDE (from Anaconda) and then executing my Python script from there, but I can't seem to import Tensorflow when I do that.

As soon as I import Tensorflow and use it, it tells me "no such module". It seems that the Spyder IDE that I open from NSight Systems is different from the one when I open it normally (without Nsight).

like image 574
cmed123 Avatar asked Mar 15 '26 18:03

cmed123


1 Answers

I solved this in windows using the answer from nvidia forum: So basically you should use a proper python environment and use the complete python directory like:

nsys profile C:\Users\beru\AppData\Local\Programs\Python\Python38\python.exe demo.py

By the way, this answer also helps me to know what to do for profiling python code using nsight system on win. I strongly recommend anyone puzzled by this read it.

like image 101
xiaoming Li Avatar answered Mar 17 '26 08:03

xiaoming Li