Nsight Systems CLI (nsys.exe) Program not found:

I installed NVIDIA Nsight Systems 2021.1.1 on Windows 10, version 20H2.
I added below path to PATH environment variable.

C:\Program Files\NVIDIA Corporation\Nsight Systems 2021.1.1\target-windows-x64\

So that I can launch nsys.exe easily like this.

C:\>nsys --help
 usage: nsys [--version] [--help] <command> [<args>] [application] [<application args>]

And when I try to profile an application, nsys prints out Program not found message.

d:\projects\nvtx_test>nsys profile python demo.py
WARNING: CPU sampling requires administrative privileges, disabling.
WARNING: CPU context switches trace requires administrative privileges, disabling.
WARNING: Backtraces will not be collected because sampling is disabled.
Program not found: python

If I specify [application] with an absolute path, it runs fine.

d:\projects\nvtx_test>nsys profile C:\Users\beru\AppData\Local\Programs\Python\Python38\python.exe demo.py
WARNING: CPU sampling requires administrative privileges, disabling.
WARNING: CPU context switches trace requires administrative privileges, disabling.
WARNING: Backtraces will not be collected because sampling is disabled.
Collecting data...
Processing events...
Saving temporary "C:\Users\beru\AppData\Local\Temp\nsys-report-37a2-1c75-f889-e3df.qdstrm" file to disk...

Creating final output files...
Processing [==============================================================100%]
Saved report file to "C:/Users\beru\AppData\Local\Temp\nsys-report-37a2-1c75-f889-e3df.qdrep"
Report file moved to "d:\projects\nvtx_test\report2.qdrep"

The question is why nsys.exe does not look up PATH environment variable on Windows?
I don’t see the same problem when running nsys on Linux.

5 Likes

Same issue from my side, hope someone can answer.

1 Like

Hi- I’m seeing the same issue with Nsight Systems, but not Nsight Compute. In particular, it appears that the Nsight Systems 2022.2.1\target-windows-x64\nsys.exe executable is disregarding the PATH environment variable. Here are some tests from PowerShell Core on Windows 11:

  1. julia → works fine (found on the user’s PATH)
  2. ncu julia → works fine
  3. nsys launch julia → “Unknown command: julia”
  4. nsys launch C:\Users\<username>\AppData\Local\Programs\Julia-1.7.2\bin\julia.exe → works fine

I also printed out the PATH variable from within the Julia process running under nsys in (4) above, and it looked fine. I’m not sure why the Windows target version of ncu is able to find julia on the path just fine, but nsys cannot. @dofek - are you able to reproduce? Is this something I could help troubleshoot further?

2 Likes

This is an old post, but I’m still having problems today. Any resolution?

What version are you using?

Same issue, but on a Linux machine trying to run with sudo priviliges. Only works with absolute paths.
I’m running the newest version (2023.1.1)

@rknight, can you take a look at this?

Hi linus4,

Just to make sure I understand, with the 2023.1.1 release of nsys on an x86_64 Linux system, nsys fails to launch the application when you do
sudo nsys launch app
and the application is in the current PATH? But, when you do
sudo nsys launch /path/to/app
nsys correctly launches the application. Is that correct?

Can you share the full sequence of nsys CLI commands are you using?

Hi rknight,
that is correct. I’m using nothing other than that. /path/to/app lies in my /home dir but the path to the binary is exported to PATH (in .bashrc) So i guess that nsys uses it’s own shell bypassing .bashrc?