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
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:
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?
I have the same problem in Linux right now. Even though I changed the default environment of conda, still when I use nsys command line, it does not recognize my conda environment. How can I solve this problem?
now I experience the same issue, the program runs well, but once I profile with nsight-system, error like “module not found” occered, so have you ever solved the problem?
@lylyly6666 could you give more details about your error? What was the full command line that you ran? Which version of nsys are you using? What python application are you running?
It would be great if you could provide enough details so that we could try to reproduce the problem here.