NSight Systems With Anaconda on Windows

Hi,

I’m trying to profile the training/inference of a CNN using Nsight. The issue is that the script runs within a conda environment. How can I configure the Nsight to run the script in the designated environment?

So far I tried inserting the python interpreter in Nsight GUI but that doesn’t work

What’s the right solution? running nsys as CLI from the environment terminal?

Thanks
Yuval

Hi Yuval,

Thanks for reaching out.

I tested the scenario you described and have concluded there is a bug in Nsight Systems 2021.1.1 that prevents the tracing of this scenario on Windows.
The bug fix will be included in the next NVIDIA Nsight Systems public release.
Note: to trace anaconda python with Nsight Systems, use a simple batch file similar to the one below. You can designate the batch file as the target app that Nsight Systems will launch for profiling. Either the CLI or the host GUI can be used to launch this batch file.

Doron

Sample batch file for launching Anaconda python scripts:

setlocal
call f:\anaconda3\condabin\conda_hook.bat
call conda activate base
f:\anaconda3\python.exe main.py

Hi, Thanks for the answer!
I modified the suggested batch file to fit my environment but still Nsight Systems can’t handle it (something crashes during profiling…). On the other hand, running the my script from the default CLI works well. One minor difference between us might be that you are using the “base” environment while I’m using a regular conda environment. For comparison, my batch file is as follows:

setlocal
call C:\Users\Yuval\Anaconda3\condabin\conda_hook.bat
call conda activate pyTorch
C:\Users\Yuval\Anaconda3\envs\pyTorch\python.exe D:\pythonProjects\PytorchProfile\main.py

Can you please try profiling inside a standard environment?
Is there any information about my system I can provide that will help debugging? Any other advice?

Thanks
Yuval

Hi Yuval,
This bug is fixed in the upcoming Nsight Systems release 2021.3.1. Thanks for reporting it.
Doron